@esri/hub-common 9.21.2 → 9.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/es2017/content/_fetch.js +87 -0
  2. package/dist/es2017/content/_fetch.js.map +1 -0
  3. package/dist/es2017/content/_internal.js +75 -3
  4. package/dist/es2017/content/_internal.js.map +1 -1
  5. package/dist/es2017/content/compose.js +18 -10
  6. package/dist/es2017/content/compose.js.map +1 -1
  7. package/dist/es2017/content/fetch.js +78 -0
  8. package/dist/es2017/content/fetch.js.map +1 -0
  9. package/dist/es2017/content/index.js +9 -80
  10. package/dist/es2017/content/index.js.map +1 -1
  11. package/dist/es2017/content/slugs.js +63 -0
  12. package/dist/es2017/content/slugs.js.map +1 -0
  13. package/dist/es2017/content/types.js +1 -0
  14. package/dist/es2017/content/types.js.map +1 -0
  15. package/dist/es2017/items/_enrichments.js +176 -0
  16. package/dist/es2017/items/_enrichments.js.map +1 -0
  17. package/dist/esm/content/_fetch.js +102 -0
  18. package/dist/esm/content/_fetch.js.map +1 -0
  19. package/dist/esm/content/_internal.js +75 -3
  20. package/dist/esm/content/_internal.js.map +1 -1
  21. package/dist/esm/content/compose.js +18 -10
  22. package/dist/esm/content/compose.js.map +1 -1
  23. package/dist/esm/content/fetch.js +103 -0
  24. package/dist/esm/content/fetch.js.map +1 -0
  25. package/dist/esm/content/index.js +9 -80
  26. package/dist/esm/content/index.js.map +1 -1
  27. package/dist/esm/content/slugs.js +63 -0
  28. package/dist/esm/content/slugs.js.map +1 -0
  29. package/dist/esm/content/types.js +1 -0
  30. package/dist/esm/content/types.js.map +1 -0
  31. package/dist/esm/items/_enrichments.js +177 -0
  32. package/dist/esm/items/_enrichments.js.map +1 -0
  33. package/dist/node/content/_fetch.js +90 -0
  34. package/dist/node/content/_fetch.js.map +1 -0
  35. package/dist/node/content/_internal.js +76 -4
  36. package/dist/node/content/_internal.js.map +1 -1
  37. package/dist/node/content/compose.js +17 -9
  38. package/dist/node/content/compose.js.map +1 -1
  39. package/dist/node/content/fetch.js +81 -0
  40. package/dist/node/content/fetch.js.map +1 -0
  41. package/dist/node/content/index.js +11 -86
  42. package/dist/node/content/index.js.map +1 -1
  43. package/dist/node/content/slugs.js +70 -0
  44. package/dist/node/content/slugs.js.map +1 -0
  45. package/dist/node/content/types.js +3 -0
  46. package/dist/node/content/types.js.map +1 -0
  47. package/dist/node/items/_enrichments.js +179 -0
  48. package/dist/node/items/_enrichments.js.map +1 -0
  49. package/dist/types/content/_fetch.d.ts +61 -0
  50. package/dist/types/content/_internal.d.ts +76 -0
  51. package/dist/types/content/compose.d.ts +11 -0
  52. package/dist/types/content/fetch.d.ts +23 -0
  53. package/dist/types/content/index.d.ts +4 -41
  54. package/dist/types/content/slugs.d.ts +34 -0
  55. package/dist/types/content/types.d.ts +7 -0
  56. package/dist/types/items/_enrichments.d.ts +24 -0
  57. package/dist/umd/common.umd.js +2082 -850
  58. package/dist/umd/common.umd.js.map +1 -1
  59. package/dist/umd/common.umd.min.js +1 -1
  60. package/dist/umd/common.umd.min.js.map +1 -1
  61. package/package.json +2 -1
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisHub=e.arcgisHub||{})}(this,function(n){"use strict";function o(r,n){return Object.keys(r).reduce(function(e,t){return e[t]=n(r[t],t,r),e},{})}function i(e,r,n){return n=n||"",Array.isArray(e)?e.map(t):!e||!c(e)||s(e)||l(e)||u(e)?r(e,n):Object.assign({},e,o(e,t));function t(e,t){return i(e,r,""+(n?n+"."+t:t))}}function a(e){return"string"==typeof e||e instanceof String}function s(e){return e instanceof Date}function u(e){return"function"==typeof e}function c(e){return"object"==typeof e}function l(e){return e instanceof RegExp}function E(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:void 0},e)}function p(e){var t,r={};if(Array.isArray(e))r=e.map(p);else if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(null!=(t=e[n])&&"object"==typeof t?t instanceof Date?r[n]=new Date(t.getTime()):r[n]=p(t):r[n]=t);else r=e;return r}function d(e,r,n){return e?e.reduce(function(e,t){return e=E(t,r)===n?t:e},null):null}function r(e){return""+(e=void 0===e?"i":e)+Math.random().toString(36).substr(2,8)}function f(e,t){return null!=e&&(t=p(t)).push(e),t}function h(e){return(e=(e=e.toLowerCase()).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi," ")).replace(/(\-|\_|\.|\s)+(.)?/g,function(e,t,r){return r?r.toUpperCase():""}).replace(/(^|\/)([A-Z])/g,function(e,t,r){return e.toLowerCase()})}function m(e,t,r){return r.indexOf(e)===t}function O(e){return null==e}function t(e){return(e=Array.from(e))[0]=e[0].toUpperCase(),e.join("")}function g(e){return e.reduce(function(e,t){return e.concat(t)},[])}function y(e,t,r){void 0===r&&(r={});var t=t.split("."),n=e,o=t.length-1;t.forEach(function(e,t){n.hasOwnProperty(e)&&null!=n[e]?t===o&&("object"!=typeof n[e]||Array.isArray(n[e])?n[e]=r:n[e]=Object.assign(n[e],p(r))):n[e]=t===o?r:{},n=n[e]})}function v(e,t,r){t=E(e,t);return void 0!==t?t:r}function b(e,r,n){return i(e,function(e){if(!a(e))return e;var t=l(r)?r:new RegExp(r,"g");return e.replace(t,n)})}function w(t,r,e){return Array.isArray(e)&&e.length?(e.forEach(function(e){void 0!==E(t,e)&&y(r,e,E(t,e))}),r):t}function S(e,t,r){y(r,e=Array.isArray(e)?e.join("."):e,t)}function k(r,n){return Array.isArray(r)?r.reduce(function(e,t){return n(t)?e=t:!C(t)||(t=k(t,n))&&(e=t),e},void 0):C(r)?n(r)?r:Object.keys(r).reduce(function(e,t){return!C(r[t])||(t=k(r[t],n))&&(e=t),e},void 0):void 0}function C(e){var t=!1;return t=e&&c(e)&&!s(e)&&!l(e)&&!u(e)?!0:t}function A(e,n,o){void 0===o&&(o=5);return e.reduce(function(e,t){var r=e[e.length-1];return r&&r.length!==o||e.push(r=[]),r.push(t),e},[]).reduce(function(e,r){return e.then(function(t){var e=r.map(function(e){return n(e)});return Promise.all(e).then(function(e){return t.concat(e)})})},Promise.resolve([]))}function T(e,t){return-1!==e.indexOf(t)}var P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function e(e,t){function r(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var D=function(){return(D=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function x(e,a,s,u){return new(s=s||Promise)(function(r,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function o(e){try{i(u.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(n,o)}i((u=u.apply(e,a||[])).next())})}function I(r,n){var o,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(r,s)}catch(e){t=[6,e],i=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function _(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}var U,j=(e(N,U=Error),N);function N(e,t,r){var n=this;return t=t||"UNKNOWN_ERROR",r=v(r,"rootCause",r),(n=U.call(this,t)||this).operation=e,n.name="OperationError",n.rootCause=r,Object.setPrototypeOf(n,N.prototype),n.stack=v(r,"stack",(new Error).stack),n}function R(r,n){return void 0===n&&(n={}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.apply(void 0,e).catch(function(e){return n})}}function M(e){var r=(new Date).getTime();return Array(e).fill(0).reduce(function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),e=""+e+t.toString(16)},"")}function q(e){"{"===e[0]&&(e=e.substring(1,e.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{12}(\}){0,1}$/gi.test(e)}function F(e){return"string"==typeof e?e.trim().toLowerCase().replace(/ +/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-"):e}n.Level=void 0,(It=n.Level||(n.Level={}))[It.all=0]="all",It[It.debug=1]="debug",It[It.info=2]="info",It[It.warn=3]="warn",It[It.error=4]="error",It[It.off=5]="off";var L=(G.setLogLevel=function(e){this.logLevel=e},G.log=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.debug)&&console.log.apply(console,_([e],t))},G.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.debug)&&console.debug.apply(console,_([e],t))},G.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.info)&&console.info.apply(console,_([e],t))},G.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.warn)&&console.warn.apply(console,_([e],t))},G.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.error)&&console.error.apply(console,_([e],t))},G.isLevelPermitted=function(e){return this.logLevel<=e},G.logLevel=n.Level.off,G);function G(){}function B(e){return e.capabilities.includes("updateitemcontrol")}function H(t){return Object.keys(t).some(function(e){e=t[e];if(!e)return!1;switch((e=e&&e.toParam?e.toParam():e).constructor.name){case"Array":case"Object":case"Date":case"Function":case"Boolean":case"String":case"Number":return!1;default:return!0}})}function W(o){var i={};return Object.keys(o).forEach(function(e){var t=o[e];if((t=t&&t.toParam?t.toParam():t)||0===t||"boolean"==typeof t||"string"==typeof t){switch(t.constructor.name){case"Array":var r=null===(r=null===(r=t[0])||void 0===r?void 0:r.constructor)||void 0===r?void 0:r.name,n="Array"===r?t:"Object"===r?JSON.stringify(t):t.join(",");break;case"Object":n=JSON.stringify(t);break;case"Date":n=t.valueOf();break;case"Function":n=null;break;case"Boolean":n=t+"";break;default:n=t}(n||0===n||"string"==typeof n||Array.isArray(n))&&(i[e]=n)}}),i}function Y(e){var t=W(e);return Object.keys(t).map(function(e){return function t(r,e){return Array.isArray(e)&&e[0]&&Array.isArray(e[0])?e.map(function(e){return t(r,e)}).join("&"):encodeURIComponent(r)+"="+encodeURIComponent(e)}(e,t[e])}).join("&")}var K=function(e,t,r,n,o){e=e||"UNKNOWN_ERROR",t=t||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message="UNKNOWN_ERROR_CODE"===t?e:t+": "+e,this.originalMessage=e,this.code=t,this.response=r,this.url=n,this.options=o};function z(e){console&&console.warn&&console.warn.apply(console,[e])}K.prototype=Object.create(Error.prototype),K.prototype.constructor=K;var V,J="@esri/arcgis-rest-js",$={httpMethod:"POST",params:{f:"json"}},Q=(e(X,V=K),X.prototype.retry=function(e,n){var o=this;void 0===n&&(n=3);var i=0,a=function(t,r){e(o.url,o.options).then(function(e){e=D(D({},o.options),{authentication:e});return i+=1,Z(o.url,e)}).then(function(e){t(e)}).catch(function(e){"ArcGISAuthError"===e.name&&i<n?a(t,r):"ArcGISAuthError"===e.name&&n<=i?r(o):r(e)})};return new Promise(function(e,t){a(e,t)})},X);function X(e,t,r,n,o){o=V.call(this,e=void 0===e?"AUTHENTICATION_ERROR":e,t=void 0===t?"AUTHENTICATION_ERROR_CODE":t,r,n,o)||this;return o.name="ArcGISAuthError",o.message="AUTHENTICATION_ERROR_CODE"===t?e:t+": "+e,o}function Z(n,e){void 0===e&&(e={params:{f:"json"}});var o=D(D(D({httpMethod:"POST"},$),e),{params:D(D({},$.params),e.params),headers:D(D({},$.headers),e.headers)}),t=[],e=[];if(o.fetch||"undefined"==typeof fetch?(t.push("`fetch`"),e.push("`node-fetch`")):o.fetch=fetch.bind(Function("return this")()),"undefined"==typeof Promise&&(t.push("`Promise`"),e.push("`es6-promise`")),"undefined"==typeof FormData&&(t.push("`FormData`"),e.push("`isomorphic-form-data`")),!o.fetch||"undefined"==typeof Promise||"undefined"==typeof FormData)throw new Error("`arcgis-rest-request` requires a `fetch` implementation and global variables for `Promise` and `FormData` to be present in the global scope. You are missing "+t.join(", ")+". We recommend installing the "+e.join(", ")+" modules at the root of your application to add these to the global scope. See https://bit.ly/2KNwWaJ for more info.");var e=o.httpMethod,i=o.authentication,a=o.rawResponse,s=D({f:"json"},o.params),r=null,u={method:e,credentials:o.credentials||"same-origin"};return o.headers&&o.headers["X-Esri-Auth-Client-Id"]&&-1<n.indexOf("/oauth2/platformSelf")&&(u.credentials="include"),(i?i.getToken(n,{fetch:o.fetch}).catch(function(e){return e.url=n,e.options=o,r=e,Promise.resolve("")}):Promise.resolve("")).then(function(e){e.length&&(s.token=e),i&&i.getDomainCredentials&&(u.credentials=i.getDomainCredentials(n));var t={};"GET"===u.method&&(s.token&&o.hideToken&&"undefined"==typeof window&&(t["X-Esri-Authorization"]="Bearer "+s.token,delete s.token),r=""===Y(s)?n:n+"?"+Y(s),o.maxUrlLength&&r.length>o.maxUrlLength||s.token&&o.hideToken?(u.method="POST",e.length&&o.hideToken&&(s.token=e,delete t["X-Esri-Authorization"])):n=r);var r=new RegExp("/items/.+/updateResources").test(n);return"POST"===u.method&&(u.body=function(e,t){var t=H(e)||t,r=W(e);if(t){var n=new FormData;return Object.keys(r).forEach(function(e){var t;"undefined"!=typeof Blob&&r[e]instanceof Blob?(t=r.fileName||r[e].name||e,n.append(e,r[e],t)):n.append(e,r[e])}),n}return Y(e)}(s,r)),u.headers=D(D({},t),o.headers),"undefined"!=typeof window||u.headers.referer||(u.headers.referer=J),H(s)||r||(u.headers["Content-Type"]="application/x-www-form-urlencoded"),o.fetch(n,u)}).then(function(e){if(!e.ok){var t=e.status,r=e.statusText;throw new K(r,"HTTP "+t,e,n,o)}if(a)return e;switch(s.f){case"json":case"geojson":return e.json();case"html":case"text":return e.text();default:return e.blob()}}).then(function(e){if("json"!==s.f&&"geojson"!==s.f||a)return e;var t=function(t,e,r,n){if(400<=t.code){var o=t.message,i=t.code;throw new K(o,i,t,e,r)}if(t.error){var a=t.error,o=a.message,i=a.code,s=a.messageCode,a=s||i||"UNKNOWN_ERROR_CODE";if(498===i||499===i||"GWM_0003"===s||400===i&&"Unable to generate token."===o)throw n||new Q(o,a,t,e,r);throw new K(o,a,t,e,r)}if("failed"!==t.status&&"failure"!==t.status)return t;o=void 0,i="UNKNOWN_ERROR_CODE";try{o=JSON.parse(t.statusMessage).message,i=JSON.parse(t.statusMessage).code}catch(e){o=t.statusMessage||t.message}throw new K(o,i,t,e,r)}(e,n,o,r);return r&&(e=n.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0],o.authentication.federatedServers[e]={token:[],expires:new Date(Date.now()+864e5)},r=null),t})}function ee(r,e,t){var n=D(D({params:{}},t),r);return n.params=e.reduce(function(e,t){return!r[t]&&"boolean"!=typeof r[t]||(e[t]=r[t]),e},n.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce(function(e,t){return n[t]&&(e[t]=n[t]),e},{})}function te(e){return"string"==typeof e&&"/"===(e=e.trim())[e.length-1]?e.slice(0,-1):e}function re(e){return e.replace(/^#/,"").split("&").reduce(function(e,t){var r,t=(r=t,r=(t=t.split("="))[0],t=t[1],{key:decodeURIComponent(r),value:decodeURIComponent(t)});return e[t.key]=t.value,e},{})}function ne(e,t){return t.rawResponse=!1,Z(e,t).then(function(e){var t={token:e.access_token,username:e.username,expires:new Date(Date.now()+(1e3*e.expires_in-1e3)),ssl:!0===e.ssl};return e.refresh_token&&(t.refreshToken=e.refresh_token),t})}function oe(e,t){return"undefined"!=typeof window&&window.location&&window.location.host?t.params.referer=window.location.host:t.params.referer=J,Z(e,t)}var ie=/^https?:\/\/(\S+)\.arcgis\.com.+/;function ae(e){return ie.test(e)}function se(e){if(!ie.test(e))return null;e=e.match(ie)[1].split(".").pop();return e.includes("dev")?"dev":e.includes("qa")?"qa":"production"}function ue(e,t){t=te(function(e){if(!ie.test(e))return e;switch(se(e)){case"dev":return"https://devext.arcgis.com/sharing/rest";case"qa":return"https://qaext.arcgis.com/sharing/rest";default:return"https://www.arcgis.com/sharing/rest"}}(t)).replace(/https?:\/\//,""),e=te(e).replace(/https?:\/\//,"");return new RegExp(e,"i").test(t)}var ce=(Object.defineProperty(le.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"tokenExpires",{get:function(){return this._tokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"refreshToken",{get:function(){return this._refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"refreshTokenExpires",{get:function(){return this._refreshTokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"trustedServers",{get:function(){return console.log("DEPRECATED: use federatedServers instead"),this.federatedServers},enumerable:!1,configurable:!0}),le.beginOAuth2=function(e,t){void 0===t&&(t=window),e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var r=D({portal:"https://www.arcgis.com/sharing/rest",provider:"arcgis",expiration:20160,popup:!0,popupWindowFeatures:"height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes",state:e.clientId,locale:""},e),n=r.portal,o=r.provider,i=r.clientId,a=r.expiration,s=r.redirectUri,u=r.popup,c=r.popupWindowFeatures,l=r.state,p=r.locale,r=r.params,p="arcgis"===o?n+"/oauth2/authorize?client_id="+i+"&response_type=token&expiration="+(e.duration||a)+"&redirect_uri="+encodeURIComponent(s)+"&state="+l+"&locale="+p:n+"/oauth2/social/authorize?client_id="+i+"&socialLoginProviderName="+o+"&autoAccountCreateForSocial=true&response_type=token&expiration="+(e.duration||a)+"&redirect_uri="+encodeURIComponent(s)+"&state="+l+"&locale="+p;if(r&&(p=p+"&"+Y(r)),u){var d,f=((d={promise:null,resolve:null,reject:null}).promise=new Promise(function(e,t){d.resolve=e,d.reject=t}),d);return t["__ESRI_REST_AUTH_HANDLER_"+i]=function(e,t){e?(e=JSON.parse(e),f.reject(new Q(e.errorMessage,e.error))):t&&(t=JSON.parse(t),f.resolve(new le({clientId:i,portal:n,ssl:t.ssl,token:t.token,tokenExpires:new Date(t.expires),username:t.username})))},t.open(p,"oauth-window",c),f.promise}t.location.href=p},le.completeOAuth2=function(e,o){void 0===o&&(o=window);var t=D({portal:"https://www.arcgis.com/sharing/rest",popup:!0},e),i=t.portal,a=t.clientId,s=t.popup;function r(e,t){try{var r=void 0,n="__ESRI_REST_AUTH_HANDLER_"+a;if(s&&(o.opener?o.opener.parent&&o.opener.parent[n]?r=o.opener.parent[n]:o.opener&&o.opener[n]&&(r=o.opener[n]):o!==o.parent&&o.parent&&o.parent[n]&&(r=o.parent[n]),r))return r(e?JSON.stringify(e):void 0,JSON.stringify(t)),void o.close()}catch(e){throw new Q('Unable to complete authentication. It\'s possible you specified popup based oAuth2 but no handler from "beginOAuth2()" present. This generally happens because the "popup" option differs between "beginOAuth2()" and "completeOAuth2()".')}if(e)throw new Q(e.errorMessage,e.error);return new le({clientId:a,portal:i,ssl:t.ssl,token:t.token,tokenExpires:t.expires,username:t.username})}e=re(o.location.hash);if(!e.access_token){var n=void 0,u="Unknown error";return e.error&&(n=e.error,u=e.error_description),r({error:n,errorMessage:u})}t=e.access_token,n=new Date(Date.now()+1e3*parseInt(e.expires_in,10)-6e4),u=e.username;return r(void 0,{token:t,expires:n,ssl:"true"===e.ssl,username:u})},le.fromParent=function(e,n){var o;return!n&&window&&(n=window),new Promise(function(t,r){o=function(e){if(e.source===n.parent&&e.data)try{return t(le.parentMessageHandler(e))}catch(e){return r(e)}},n.addEventListener("message",o,!1),n.parent.postMessage({type:"arcgis:auth:requestCredential"},e)}).then(function(e){return n.removeEventListener("message",o,!1),e})},le.authorize=function(e,t){e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var r=D({portal:"https://arcgis.com/sharing/rest",expiration:20160},e),n=r.portal,o=r.clientId,i=r.expiration,r=r.redirectUri;t.writeHead(301,{Location:n+"/oauth2/authorize?client_id="+o+"&expiration="+(e.duration||i)+"&response_type=code&redirect_uri="+encodeURIComponent(r)}),t.end()},le.exchangeAuthorizationCode=function(e,t){var e=D({portal:"https://www.arcgis.com/sharing/rest",refreshTokenTTL:20160},e),r=e.portal,n=e.clientId,o=e.redirectUri,i=e.refreshTokenTTL;return ne(r+"/oauth2/token",{params:{grant_type:"authorization_code",client_id:n,redirect_uri:o,code:t}}).then(function(e){return new le({clientId:n,portal:r,ssl:e.ssl,redirectUri:o,refreshToken:e.refreshToken,refreshTokenTTL:i,refreshTokenExpires:new Date(Date.now()+60*(i-1)*1e3),token:e.token,tokenExpires:e.expires,username:e.username})})},le.deserialize=function(e){e=JSON.parse(e);return new le({clientId:e.clientId,refreshToken:e.refreshToken,refreshTokenExpires:new Date(e.refreshTokenExpires),username:e.username,password:e.password,token:e.token,tokenExpires:new Date(e.tokenExpires),portal:e.portal,ssl:e.ssl,tokenDuration:e.tokenDuration,redirectUri:e.redirectUri,refreshTokenTTL:e.refreshTokenTTL})},le.fromCredential=function(e){var t=void 0===e.ssl||e.ssl,r=e.expires||Date.now()+72e5;return new le({portal:e.server.includes("sharing/rest")?e.server:e.server+"/sharing/rest",ssl:t,token:e.token,username:e.userId,tokenExpires:new Date(r)})},le.parentMessageHandler=function(e){if("arcgis:auth:credential"===e.data.type)return le.fromCredential(e.data.credential);if("arcgis:auth:error"!==e.data.type)throw new Error("Unknown message type.");var t=new Error(e.data.error.message);throw t.name=e.data.error.name,t},le.prototype.toCredential=function(){return{expires:this.tokenExpires.getTime(),server:this.portal,ssl:this.ssl,token:this.token,userId:this.username}},le.prototype.getUser=function(e){var t=this;if(this._pendingUserRequest)return this._pendingUserRequest;if(this._user)return Promise.resolve(this._user);var r=this.portal+"/community/self",e=D(D({httpMethod:"GET",authentication:this},e),{rawResponse:!1});return this._pendingUserRequest=Z(r,e).then(function(e){return t._user=e,t._pendingUserRequest=null,e}),this._pendingUserRequest},le.prototype.getPortal=function(e){var t=this;if(this._pendingPortalRequest)return this._pendingPortalRequest;if(this._portalInfo)return Promise.resolve(this._portalInfo);var r=this.portal+"/portals/self",e=D(D({httpMethod:"GET",authentication:this},e),{rawResponse:!1});return this._pendingPortalRequest=Z(r,e).then(function(e){return t._portalInfo=e,t._pendingPortalRequest=null,e}),this._pendingPortalRequest},le.prototype.getUsername=function(){return this.username?Promise.resolve(this.username):this._user?Promise.resolve(this._user.username):this.getUser().then(function(e){return e.username})},le.prototype.getToken=function(e,t){return r=this.portal,n=e,o=ae(r),i=ae(n),r=se(r),n=se(n),o&&i&&r===n||new RegExp(this.portal,"i").test(e)?this.getFreshToken(t):this.getTokenForServer(e,t);var r,n,o,i},le.prototype.validateAppAccess=function(r){return this.getToken(this.portal).then(function(e){return Z((t=void 0===t?"https://www.arcgis.com/sharing/rest":t)+"/oauth2/validateAppAccess",{method:"POST",params:{f:"json",client_id:r,token:e}});var t})},le.prototype.toJSON=function(){return{clientId:this.clientId,refreshToken:this.refreshToken,refreshTokenExpires:this.refreshTokenExpires,username:this.username,password:this.password,token:this.token,tokenExpires:this.tokenExpires,portal:this.portal,ssl:this.ssl,tokenDuration:this.tokenDuration,redirectUri:this.redirectUri,refreshTokenTTL:this.refreshTokenTTL}},le.prototype.serialize=function(){return JSON.stringify(this)},le.prototype.enablePostMessageAuth=function(e,t){!t&&window&&(t=window),this._hostHandler=this.createPostMessageHandler(e),t.addEventListener("message",this._hostHandler,!1)},le.prototype.disablePostMessageAuth=function(e){(e=!e&&window?window:e).removeEventListener("message",this._hostHandler,!1)},le.prototype.refreshSession=function(e){return this._user=null,this.username&&this.password?this.refreshWithUsernameAndPassword(e):this.clientId&&this.refreshToken?this.refreshWithRefreshToken():Promise.reject(new Q("Unable to refresh token."))},le.prototype.getServerRootUrl=function(e){var t=te(e).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/)[0].match(/(https?:\/\/)(.+)/);t[0];var r=t[1],e=t[2].split("/"),t=e[0],e=e.slice(1);return""+r+t.toLowerCase()+"/"+e.join("/")},le.prototype.getDomainCredentials=function(t){return this.trustedDomains&&this.trustedDomains.length&&this.trustedDomains.some(function(e){return t.startsWith(e)})?"include":"same-origin"},le.prototype.createPostMessageHandler=function(o){var i=this;return function(e){var t=-1<o.indexOf(e.origin),r="arcgis:auth:requestCredential"===e.data.type,n=i.tokenExpires.getTime()>Date.now();t&&r&&(r={},r=n?((n=i.toCredential()).server=n.server.replace("/sharing/rest",""),{type:"arcgis:auth:credential",credential:n}):{type:"arcgis:auth:error",error:{name:"tokenExpiredError",message:"Session token was expired, and not returned to the child application"}},e.source.postMessage(r,e.origin))}},le.prototype.getTokenForServer=function(t,r){var n=this,o=this.getServerRootUrl(t),e=this.federatedServers[o];return e&&e.expires&&e.expires.getTime()>Date.now()?Promise.resolve(e.token):this._pendingTokenRequests[o]||(this._pendingTokenRequests[o]=this.fetchAuthorizedDomains().then(function(){return Z(o+"/rest/info",{credentials:n.getDomainCredentials(t)}).then(function(e){if(e.owningSystemUrl){if(ue(e.owningSystemUrl,n.portal))return Z(e.owningSystemUrl+"/sharing/rest/info",r);throw new Q(t+" is not federated with "+n.portal+".","NOT_FEDERATED")}if(e.authInfo&&void 0!==n.federatedServers[o])return Promise.resolve({authInfo:e.authInfo});throw new Q(t+" is not federated with any portal and is not explicitly trusted.","NOT_FEDERATED")}).then(function(e){return e.authInfo.tokenServicesUrl}).then(function(e){return n.token&&n.tokenExpires.getTime()>Date.now()?oe(e,{params:{token:n.token,serverUrl:t,expiration:n.tokenDuration,client:"referer"}}):oe(e,{params:{username:n.username,password:n.password,expiration:n.tokenDuration,client:"referer"}}).then(function(e){return n._token=e.token,n._tokenExpires=new Date(e.expires),e})}).then(function(e){return n.federatedServers[o]={expires:new Date(e.expires),token:e.token},delete n._pendingTokenRequests[o],e.token})}),this._pendingTokenRequests[o])},le.prototype.getFreshToken=function(e){var t=this;return this.token&&!this.tokenExpires||this.token&&this.tokenExpires&&this.tokenExpires.getTime()>Date.now()?Promise.resolve(this.token):(this._pendingTokenRequests[this.portal]||(this._pendingTokenRequests[this.portal]=this.refreshSession(e).then(function(e){return t._pendingTokenRequests[t.portal]=null,e.token})),this._pendingTokenRequests[this.portal])},le.prototype.refreshWithUsernameAndPassword=function(e){var t=this,e=D({params:{username:this.username,password:this.password,expiration:this.tokenDuration}},e);return oe(this.portal+"/generateToken",e).then(function(e){return t._token=e.token,t._tokenExpires=new Date(e.expires),t})},le.prototype.refreshWithRefreshToken=function(e){var t=this;if(this.refreshToken&&this.refreshTokenExpires&&this.refreshTokenExpires.getTime()<Date.now())return this.refreshRefreshToken(e);e=D({params:{client_id:this.clientId,refresh_token:this.refreshToken,grant_type:"refresh_token"}},e);return ne(this.portal+"/oauth2/token",e).then(function(e){return t._token=e.token,t._tokenExpires=e.expires,t})},le.prototype.refreshRefreshToken=function(e){var t=this,e=D({params:{client_id:this.clientId,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,grant_type:"exchange_refresh_token"}},e);return ne(this.portal+"/oauth2/token",e).then(function(e){return t._token=e.token,t._tokenExpires=e.expires,t._refreshToken=e.refreshToken,t._refreshTokenExpires=new Date(Date.now()+60*(t.refreshTokenTTL-1)*1e3),t})},le.prototype.fetchAuthorizedDomains=function(){var t=this;return this.server||!this.portal?Promise.resolve(this):this.getPortal().then(function(e){return e.authorizedCrossOriginDomains&&e.authorizedCrossOriginDomains.length&&(t.trustedDomains=e.authorizedCrossOriginDomains.filter(function(e){return!e.startsWith("http://")}).map(function(e){return e.startsWith("https://")?e:"https://"+e})),t})},le);function le(e){var t;this.clientId=e.clientId,this._refreshToken=e.refreshToken,this._refreshTokenExpires=e.refreshTokenExpires,this.username=e.username,this.password=e.password,this._token=e.token,this._tokenExpires=e.tokenExpires,this.portal=e.portal?te(e.portal):"https://www.arcgis.com/sharing/rest",this.ssl=e.ssl,this.provider=e.provider||"arcgis",this.tokenDuration=e.tokenDuration||20160,this.redirectUri=e.redirectUri,this.refreshTokenTTL=e.refreshTokenTTL||20160,this.server=e.server,this.federatedServers={},this.trustedDomains=[],e.server&&(t=this.getServerRootUrl(e.server),this.federatedServers[t]={token:e.token,expires:e.tokenExpires}),this._pendingTokenRequests={}}function pe(e){e=e.privileges;return T(void 0===e?[]:e,"portal:user:createItem")}function de(e,t){var r,n=!1,o=e.itemControl,i=e.owner,a=e.orgId,s=t.roleId,u=t.role,c=t.username,l=t.groups,p=t.orgId,u=T(["admin","update"],o)||!!i&&i===c||!!(!!a&&a===p)&&!s&&"org_admin"===u,t=pe(t);return t&&u?n=!0:t&&(r=_(E(e,"groupIds")||[],[E(e,"properties.collaborationGroupId")]),n=l.some(function(e){return B(e)&&T(r,e.id)})),n}var fe=["portal:user:createGroup","portal:user:createItem","portal:user:shareToGroup","portal:user:viewOrgGroups","portal:user:viewOrgItems"];function he(e){var t=e.host,r=e.path,e=e.query,t=t.endsWith("/")?t:t+"/",t=new URL(r,t);return t.search=function(r){void 0===r&&(r={});var e=Object.keys(r).filter(function(e){return void 0!==r[e]}).reduce(function(e,t){return e[t]=r[t],e},{});return new URLSearchParams(e).toString()}(e),t.toString()}function me(e){return(e=void 0===e?{}:e).portal?te(e.portal):e.authentication?e.authentication.portal:"https://www.arcgis.com/sharing/rest"}function ge(e){var t=JSON.parse(JSON.stringify(e));return t.data&&("undefined"!=typeof Blob&&e.data instanceof Blob||"ReadStream"===e.data.constructor.name?t.file=e.data:t.text=e.data,delete t.data),t}function ye(e){return e.owner?Promise.resolve(e.owner):e.item&&e.item.owner?Promise.resolve(e.item.owner):e.authentication&&e.authentication.getUsername?e.authentication.getUsername():Promise.reject(new Error("Could not determine the owner of this item. Pass the `owner`, `item.owner`, or `authentication` option."))}function ve(t){return ye(t).then(function(e){e=t.folderId?me(t)+"/content/users/"+e+"/"+t.folderId+"/items/"+t.item.id+"/update":me(t)+"/content/users/"+e+"/items/"+t.item.id+"/update";return t.params=D(D({},t.params),ge(t.item)),Z(e,t)})}function be(e){var r,e=D({folderId:null},e);return(r=e).multipart&&!r.filename?Promise.reject(new Error("The filename is required for a multipart request.")):ye(r).then(function(e){var t=me(r)+"/content/users/"+e,e=t+"/addItem";return r.folderId&&(e=t+"/"+r.folderId+"/addItem"),r.params=D(D({},r.params),ge(r.item)),Z(e,ee(r,["owner","folderId","file","dataUrl","text","async","multipart","filename","overwrite"],{params:D({},r.params)}))})}function we(e,t){return Z(Se(e,t),D({httpMethod:"GET"},t))}var Se=function(e,t){return("string"==typeof t?t:me(t))+"/content/items/"+e};function ke(e,t){e=Se(e,t)+"/data",t=D({httpMethod:"GET",params:{}},t);return t.file&&(t.params.f=null),Z(e,t).catch(function(e){var t=RegExp(/The string did not match the expected pattern|(Unexpected end of (JSON input|data at line 1 column 1))/i);if(!t.test(e.message))throw e})}function Ce(e){var t=Se(e.id,e)+"/relatedItems",r=D({httpMethod:"GET",params:{direction:e.direction}},e);return"string"==typeof e.relationshipType?r.params.relationshipType=e.relationshipType:r.params.relationshipTypes=e.relationshipType,delete r.direction,delete r.relationshipType,Z(t,r)}function Ae(t){return ye(t).then(function(e){return Z(me(t)+"/content/users/"+e+"/items/"+t.id+"/unprotect",t)})}function Te(e){return t=e.groupId,Z(me(e=e)+"/community/groups/"+t,D({httpMethod:"GET"},e)).then(function(e){return e.userMembership.memberType}).catch(function(){return"none"});var t}function Pe(t){return ye(t).then(function(e){return Z(me(t)+"/content/users/"+e+"/items/"+t.id+"/delete",t)})}var xe=(Ie.prototype.match=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.termStack=this.termStack.concat(e),this},Ie.prototype.in=function(e){return this.hasRange||this.hasTerms?(e&&"*"!==e&&(this.q+=e+":"),this.commit()):(z("`in("+(e?'"'+e+'"':"")+")`"+" was called with no call to `match(...)` or `from(...)`/`to(...)`. Your query was not modified."),this)},Ie.prototype.startGroup=function(){return this.commit(),0<this.openGroups&&(this.q+=" "),this.openGroups++,this.q+="(",this},Ie.prototype.endGroup=function(){return this.openGroups<=0?z("`endGroup(...)` was called without calling `startGroup(...)` first. Your query was not modified."):(this.commit(),this.openGroups--,this.q+=")"),this},Ie.prototype.and=function(){return this.addModifier("and")},Ie.prototype.or=function(){return this.addModifier("or")},Ie.prototype.not=function(){return this.addModifier("not")},Ie.prototype.from=function(e){return this.hasTerms?z('`from(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'):this.rangeStack[0]=e,this},Ie.prototype.to=function(e){return this.hasTerms?z('`to(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'):this.rangeStack[1]=e,this},Ie.prototype.boost=function(e){return this.commit(),this.q+="^"+e,this},Ie.prototype.toParam=function(){return this.commit(),this.cleanup(),this.q},Ie.prototype.clone=function(){return this.commit(),this.cleanup(),new Ie(this.q+"")},Ie.prototype.addModifier=function(e){return this.currentModifer?(z("You have called `"+this.currentModifer+"()` after `"+e+"()`. Your current query was not modified."),this):(this.commit(),""===this.q&&"not"!==e?z("You have called `"+e+"()` without calling another method to modify your query first. Try calling `match()` first."):(this.currentModifer=e,this.q+=""===this.q?"":" ",this.q+=e.toUpperCase()+" "),this)},Ie.prototype.needsQuotes=function(e){return/\s|:/g.test(e)},Ie.prototype.formatTerm=function(e){return e instanceof Date?e.getTime():"string"==typeof e&&this.needsQuotes(e)?'"'+e+'"':e},Ie.prototype.commit=function(){var t=this;return this.currentModifer=void 0,this.hasRange&&(this.q+="["+this.formatTerm(this.rangeStack[0])+" TO "+this.formatTerm(this.rangeStack[1])+"]",this.rangeStack=[void 0,void 0]),this.hasTerms&&(this.q+=this.termStack.map(function(e){return t.formatTerm(e)}).join(" "),this.termStack=[]),this},Object.defineProperty(Ie.prototype,"hasTerms",{get:function(){return 0<this.termStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Ie.prototype,"hasRange",{get:function(){return this.rangeStack.length&&this.rangeStack[0]&&this.rangeStack[1]},enumerable:!1,configurable:!0}),Ie.prototype.cleanup=function(){if(0<this.openGroups)for(z("Automatically closing "+this.openGroups+" group(s). You can use `endGroup(...)` to remove this warning.");0<this.openGroups;)this.q+=")",this.openGroups--;var e=this.q;this.q=e.replace(/( AND ?| NOT ?| OR ?)*$/,""),e!==this.q&&z("`startGroup(...)` was called without calling `endGroup(...)` first. Your query was not modified."),this.q=this.q.replace(/(\(\))*/,"")},Ie);function Ie(e){void 0===e&&(e=""),this.termStack=[],this.rangeStack=[],this.openGroups=0,this.q=e}function Ee(r,n){var e,t="string"==typeof r||r instanceof xe?{httpMethod:"GET",params:{q:r}}:ee(r,["q","num","start","sortField","sortOrder","searchUserAccess","searchUserName","filter","countFields","countSize","categories","categoryFilters"],{httpMethod:"GET"});switch(n){case"item":e="/search";break;case"group":e="/community/groups";break;case"groupContent":if("string"==typeof r||r instanceof xe||!r.groupId)return Promise.reject(new Error("you must pass a `groupId` option to `searchGroupContent`"));e="/content/groups/"+r.groupId+"/search";break;default:e="/portals/self/users/search"}return Z(me(t)+e,t).then(function(t){return t.nextStart&&-1!==t.nextStart&&(t.nextPage=function(){var e;return"string"==typeof r||r instanceof xe?e={q:r,start:t.nextStart}:(e=r).start=t.nextStart,Ee(e,n)}),t})}function Oe(e){return Ee(e,"item")}function De(e,t){if(0===e.length)return[];for(var r=[],n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function _e(e){var t=e.id,r=me(e)+"/community/groups/"+t+"/addUsers",t=Object.assign({},e,{admins:void 0,users:void 0}),t=_(Ue("users",e.users,t),Ue("admins",e.admins,t)).map(function(e){return Z(r,e).catch(function(e){return{errors:[e]}})});return Promise.all(t).then(je)}function Ue(o,e,i){return!e||e.length<1?[]:De(e,25).map(function(e){return t=o,r=e,n=i,Object.assign({},n,((e={})[t]=r,e.params=D(D({},n.params),((n={})[t]=r,n)),e));var t,r,n})}function je(e){var t=e.filter(function(e){return e.notAdded}).reduce(function(e,t){return e.concat(t.notAdded)},[]),e=e.filter(function(e){return e.errors}).reduce(function(e,t){return e.concat(t.errors)},[]),t={notAdded:t};return 0<e.length&&(t.errors=e),t}function Ne(t){var e=t.id,r=t.users,n=me(t)+"/community/groups/"+e+"/removeUsers",r=De(r,25).map(function(e){e=D(D({},t),{users:e,params:{users:e}});return Z(n,e).catch(function(e){return{errors:[e]}})});return Promise.all(r).then(function(e){var t=function(r){return e.filter(function(e){return e[r]}).reduce(function(e,t){return e.concat(t[r])},[])},r=t("errors"),t={notRemoved:t("notRemoved")};return r.length?D(D({},t),{errors:r}):t})}function Re(e){var t,r=e.id,n=me(e)+"/community/groups/"+r+"/invite",e=De((t=e).users,25).map(function(e){return function(e,t){t=Object.assign({},t);return t.params=D(D({},t.params),{users:e,role:t.role,expiration:t.expiration}),t}(e,t)}).map(function(e){return Z(n,e).catch(function(e){return{errors:[e]}})});return Promise.all(e).then(Me)}function Me(e){var t=e.every(function(e){return e.success}),e=e.reduce(function(e,t){return e.concat(t.errors||[])},[]),t={success:t};return 0<e.length&&(t.errors=e),t}function qe(e){return Z(me(e)+"/community/groups/"+e.id+"/unprotect",e)}function Fe(e){return Z(me(e)+"/community/groups/"+e.id+"/delete",D({},e))}function Le(e){var t=me(e)+"/community/groups/"+e.id+"/updateUsers",r={authentication:e.authentication,params:{}};return"admin"===e.newMemberType?r.params.admins=e.users:r.params.users=e.users,Z(t,r)}function Ge(e){var n,t=me(e)+"/portals/self/createNotification",e=De((n=e).users,n.batchSize||25).map(function(e){return t=e,r=n,(e=Object.assign({},r)).params=D(D({},e.params),{users:t,subject:r.subject,message:r.message,notificationChannelType:e.notificationChannelType}),e;var t,r}).map(function(e){return Z(t,e).catch(function(e){return{errors:[e]}})});return Promise.all(e).then(Be)}function Be(e){var t=e.every(function(e){return e.success}),e=e.reduce(function(e,t){return e.concat(t.errors||[])},[]),t={success:t};return 0<e.length&&(t.errors=e),t}function He(e){var t,r,n={httpMethod:"GET"};return"string"==typeof e?r="https://www.arcgis.com/sharing/rest/community/users/"+e:(t=e.username||e.authentication.username,r=me(e)+"/community/users/"+encodeURIComponent(t),n=D(D({},e),n)),Z(r,n)}function We(t){return Oe({q:"id: "+t.id+" AND group: "+t.groupId,start:1,num:10,sortField:"title",authentication:t.authentication,httpMethod:"POST"}).then(function(e){if(0<e.total)return e.results.some(function(e){return e.id===t.id})})}function Ye(a){return We(a).then(function(e){if(e)return{itemId:a.id,shortcut:!0,notSharedWith:[]};var t=a.authentication.username,e=a.owner,n=a.confirmItemControl,e=e||t;if(e===t)return Ke(a);var o=!1,i=!1;return Promise.all([He({username:t,authentication:a.authentication}),He({username:e,authentication:a.authentication}),Te(a)]).then(function(e){var t=e[0],r=e[1],e=e[2];return o="org_admin"===t.role&&!t.roleId,i=t.orgId!==r.orgId,function(e,t,r,n,o,i){var a=[];if(i.groupId!==e.favGroupId)if(t){if(!n)throw Error("This item can not be shared to shared editing group "+i.groupId+" by "+e.username+" as they not the item owner or org admin.");a.push(ze(e,e,!1,"Error adding "+e.username+" as member to edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i),ze(e,o,!0,"none"===r?"Error adding user "+o.username+" to edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.":"Error promoting user "+o.username+" to admin in edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i))}else if(n)a.push(ze(e,e,!1,"Error adding "+e.username+" as member to view group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i));else if("none"===r)throw new Error("This item can not be shared by "+e.username+" as they are not a member of the specified group "+i.groupId+".");return a}(t,!!n,e,o,r,a)}).then(function(e){var t=e[0],r=(void 0===t?{promise:Promise.resolve({notAdded:[]}),revert:function(e){return Promise.resolve(e)}}:t).revert;return Promise.all(e.map(function(e){return e.promise})).then(function(){return Ke(a,o,i)}).then(function(e){return r(e)})})}).then(function(e){if(e.notSharedWith.length)throw Error("Item "+a.id+" could not be shared to group "+a.groupId+".");return e})}function Ke(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.authentication.username,o=e.owner||n,i=me(e)+"/content/items/"+e.id+"/share";return(o===n||t&&!r)&&(i=me(e)+"/content/users/"+o+"/items/"+e.id+"/share"),e.params={groups:e.groupId,confirmItemControl:e.confirmItemControl},Z(i,e)}function ze(e,t,r,n,o){var i,a,s=t.groups||[],u=s.find(function(e){return e.id===o.groupId});if(e.orgId!==t.orgId)throw Error("User "+t.username+" is not a member of the same org as "+e.username+". Consequently they can not be added added to group "+o.groupId+" nor can item "+o.id+" be shared to the group.");if(!u&&511<s.length)throw Error("User "+t.username+" already has 512 groups, and can not be added to group "+o.groupId+". Consequently item "+o.id+" can not be shared to the group.");return a=u?r&&"member"===u.userMembership.memberType?(i=Le({id:o.groupId,users:[t.username],newMemberType:"admin",authentication:o.authentication}).then(function(e){e=e.results.reduce(function(e,t){return t.success||e.push(t.username),e},[]);return Promise.resolve({notAdded:e})}).catch(function(){return{notAdded:[t.username]}}),function(e){return Le({id:o.groupId,users:[t.username],newMemberType:"member",authentication:o.authentication}).then(function(){return e}).catch(function(){return e})}):(i=Promise.resolve({notAdded:[]}),function(e){return Promise.resolve(e)}):(i=_e(((a={id:o.groupId})[r?"admins":"users"]=[t.username],a.authentication=o.authentication,a)).then(function(e){if(e.errors&&e.errors.length)throw e.errors[0];return e}).catch(function(){return{notAdded:[t.username]}}),function(e){return Ne({id:o.groupId,users:[t.username],authentication:o.authentication}).then(function(){return e})}),{promise:i.then(function(e){if(e.notAdded.length)throw new Error(n);return e}),revert:a}}function Ve(o){return We(o).then(function(e){if(!e)return Promise.resolve({itemId:o.id,shortcut:!0,notUnsharedFrom:[]});var r=o.authentication.username,n=o.owner;return Promise.all([Te(o),He({username:r,authentication:o.authentication})]).then(function(e){var t=e[0],e=e[1],e="org_admin"===e.role&&!e.roleId;if(!((n||r)===r)&&!e&&["admin","owner"].indexOf(t)<0)throw Error("This item can not be unshared from group "+o.groupId+" by "+r+" as they not the item owner, an org admin, group admin or group owner.");return function(e){var t=e.authentication.username,r=e.owner||t,n=me(e)+"/content/items/"+e.id+"/unshare";r===t&&(n=me(e)+"/content/users/"+r+"/items/"+e.id+"/unshare");return e.params={groups:e.groupId},Z(n,e)}(o)}).then(function(e){if(e.notUnsharedFrom.length)throw Error("Item "+o.id+" could not be unshared to group "+o.groupId);return e})})}function Je(e){return function(e,t){e=e||"self",e=me(t)+"/portals/"+e,t=D({httpMethod:"GET"},t);return Z(e,t)}(null,e)}function $e(e){if("string"==typeof e)return e.replace(/\/sharing\/rest\/?$/,"");if("object"==typeof e){var t=e.portalSelf||e,r=t.portalHostname,n=t.urlKey,o=t.customBaseUrl;if(r||n&&o)return t.isPortal?"https://"+t.portalHostname:"https://"+t.urlKey+"."+t.customBaseUrl}return $e(me(e))}var Qe={devext:"https://d1011m9qpnz5mw.cloudfront.net",qaext:"https://dyq9ux9ryu4qj.cloudfront.net",www:"https://d1iq7pbacwn5rb.cloudfront.net"};function Xe(e){if(e.isPortal)return $e(e)+"/apps/sites";e=e.portalHostname.split(".")[0];return(Qe[e]||Qe.www)+"/opendata-ui/assets"}function Ze(e){return $e(e)+"/sharing/rest"}function et(e){return e=(e=e.toLowerCase()).includes("//")?e.split("//")[1]:e}function tt(e){var t;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://hubqa.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://hubdev.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://hub.arcgis.com"),t}function rt(e){if(e.isPortal)throw new Error("Hub Url is not available in ArcGIS Enterprise");return tt(e.portalHostname)}function nt(e,t){return $e(t)+"/home/item.html?id="+e}function ot(e,t,r){return t=it(e,t,r),r="\\/"+e.id+"\\?f=json",r=new RegExp(r),t&&t.replace(r,"/"+e.id+"/data").replace(/\&token/,"?token")}var it=function(e,t,r){var n=e.id,e=e.access,t=Ze(t)+"/content/items/"+n,n=new URLSearchParams({f:"json"});return"public"!==e&&r&&n.append("token",r),t+"?"+n.toString()};function at(e){var t;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://hubqa.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://hubdev.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://hub.arcgis.com"),t}function st(e){var t=e;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://qaext.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://devext.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://www.arcgis.com"),t}var ut=/\/(map|feature)server/i,ct=function(e){e=e.match(ut),e=e&&e[1];return e&&t(e)+" Service"};function lt(e){var t=e&&e.hubApiUrl;return t||tt(Ze(e))}var pt="/api/v3/domains",dt="/api/v3/datasets",ft="/api/discussions/v1",ht=(Object.defineProperty(mt.prototype,"session",{get:function(){return this._authentication},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"isAuthenticated",{get:function(){return!!this._authentication},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"userRequestOptions",{get:function(){if(this.isAuthenticated)return{authentication:this._authentication,portal:this.sharingApiUrl}},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"requestOptions",{get:function(){var e={portal:this.sharingApiUrl};return e=this.isAuthenticated?{authentication:this._authentication,portal:this.sharingApiUrl}:e},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"hubRequestOptions",{get:function(){if(this.isAuthenticated)return{authentication:this.session,isPortal:this.isPortal,portalSelf:this.portal,hubApiUrl:this.hubUrl}},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"portalUrl",{get:function(){return this.isAuthenticated?this.isPortal?"https://"+this._portalSelf.portalHostname:"https://"+this._portalSelf.urlKey+"."+this._portalSelf.customBaseUrl:this._portalUrl},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"sharingApiUrl",{get:function(){return this.portalUrl+"/sharing/rest"},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"hubUrl",{get:function(){return this._hubUrl},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"isPortal",{get:function(){return this._portalSelf?this._portalSelf.isPortal:-1===this._portalUrl.indexOf("arcgis.com")},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"discussionsServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+ft},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"hubSearchServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+dt},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"domainServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+pt},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"eventsConfig",{get:function(){if(this._portalSelf)return E(this._portalSelf,"portalProperties.hub.settings.events")},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"hubEnabled",{get:function(){return v(this._portalSelf,"portalProperties.hub.enabled",!1)},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"communityOrgId",{get:function(){if(this._portalSelf)return E(this._portalSelf,"portalProperties.hub.settings.communityOrg.orgId")},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"communityOrgHostname",{get:function(){if(this._portalSelf)return E(this._portalSelf,"portalProperties.hub.settings.communityOrg.portalHostname")},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"communityOrgUrl",{get:function(){if(this.communityOrgHostname)return"https://"+this.communityOrgHostname},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"helperServices",{get:function(){if(this._portalSelf)return this._portalSelf.helperServices},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"currentUser",{get:function(){return this._currentUser},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"portal",{get:function(){return this._portalSelf},enumerable:!1,configurable:!0}),Object.defineProperty(mt.prototype,"properties",{get:function(){return this._properties},enumerable:!1,configurable:!0}),mt);function mt(e){this._portalUrl="https://www.arcgis.com",this.id=e.id,this._portalUrl=e.portalUrl,this._hubUrl=e.hubUrl,e.authentication&&(this._authentication=e.authentication),e.portalSelf&&(this._portalSelf=e.portalSelf),e.currentUser&&(this._currentUser=e.currentUser),e.properties&&(this._properties=e.properties)}var gt=(yt.create=function(r){return void 0===r&&(r={}),x(this,void 0,void 0,function(){var t;return I(this,function(e){switch(e.label){case 0:return[4,(t=new yt(r)).initialize()];case 1:return e.sent(),[2,t]}})})},yt.prototype.setAuthentication=function(t){return x(this,void 0,void 0,function(){return I(this,function(e){switch(e.label){case 0:return this._authentication=t,this._portalUrl=t.portal.replace("/sharing/rest",""),[4,this.initialize()];case 1:return e.sent(),[2]}})})},yt.prototype.setProperties=function(e){this._properties=e,this._context=new ht(this.contextOpts)},yt.prototype.clearAuthentication=function(){this._context.isPortal||(this._portalUrl=st(this._portalUrl)),this._authentication=null,this._portalSelf=null,this._currentUser=null,this._context=new ht(this.contextOpts)},Object.defineProperty(yt.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),yt.prototype.initialize=function(){return x(this,void 0,void 0,function(){var t,r,n;return I(this,function(e){switch(e.label){case 0:if(!this._authentication||this._portalSelf&&this._currentUser)return[3,4];L.debug("ArcGISContextManager-"+this.id+": Initializing"),t=this._authentication.username,t=[Je({authentication:this._authentication}),He({username:t,authentication:this._authentication})],e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.all(t)];case 2:return n=e.sent(),r=n[0],n=n[1],this._portalSelf=r,this._currentUser=n,L.debug("ArcGISContextManager-"+this.id+": received portalSelf and currentUser"),[3,4];case 3:throw r=e.sent(),n='ArcGISContextManager could not fetch portal & user for "'+this._authentication.username+'" using '+this._authentication.portal+".",L.error(n),console.error(n),r;case 4:return L.debug("ArcGISContextManager-"+this.id+": updating context"),this._context=new ht(this.contextOpts),[2]}})})},Object.defineProperty(yt.prototype,"contextOpts",{get:function(){var e={id:this.id,portalUrl:this._portalUrl,hubUrl:this._hubUrl,properties:this._properties};return this._authentication&&(e.authentication=this._authentication),this._portalSelf&&(e.portalSelf=this._portalSelf),this._currentUser&&(e.currentUser=this._currentUser),e},enumerable:!1,configurable:!0}),yt);function yt(e){this._portalUrl="https://www.arcgis.com",this._logLevel=n.Level.error,this.id=(new Date).getTime(),e.logLevel&&(this._logLevel=e.logLevel),L.setLogLevel(this._logLevel),L.debug("ArcGISContextManager:ctor: Creating "+this.id),e.properties&&(this._properties=e.properties),e.authentication?(this._authentication=e.authentication,this._portalUrl=this._authentication.portal.replace("/sharing/rest","")):e.portalUrl&&(this._portalUrl=e.portalUrl),this._hubUrl=at(this._portalUrl),e.portal&&(this._portalSelf=p(e.portal)),e.currentUser&&(this._currentUser=p(e.currentUser))}var vt=function(e){if(e){var t=e.toLocaleLowerCase();return Object.keys(bt).find(function(e){return bt[e].some(function(e){return e.toLocaleLowerCase()===t})})}},bt={app:["Application","City Engine Web Scene","CityEngine Web Scene","Dashboard","Insights Page","Insights Workbook","Operation View","Web Mapping Application","StoryMap","Web Experience","Urban Model"],dataset:["CSV Collection","CSV","Feature Collection Template","Feature Collection","Feature Layer","Feature Service","File Geodatabase","GeoJSON","GeoJson","KML Collection","KML","Microsoft Excel","Raster Layer","Shapefile","Stream Service","Table"],document:["CAD Drawing","Document Link","Hub Page","Site Page","Image","iWork Keynote","iWork Numbers","iWork Pages","Microsoft Powerpoint","Microsoft Visio","Microsoft Word","Notebook","PDF","Pro Map","Report Template"],event:["Hub Event"],feedback:["Form","Quick Capture Project"],initiative:["Hub Initiative"],template:["Hub Initiative Template"],solution:["Solution"],map:["Image Collection","Image Service","Map Service Layer","Map Service","Scene Service","Scene Layer","Vector Tile Service","Web Map Service","Web Map Tile Service","Web Map","Web Scene","WFS","WMS","WMTS"],other:["360 VR Experience","AppBuilder Widget Package","Application Configuration","ArcPad Package","Code Attachment","Code Sample","Desktop Add In","Desktop Application Template","Desktop Application","Desktop Style","Explorer Add In","Explorer Layer","Geocoding Service","Geometry Service","Geoprocessing Package","Geoprocessing Sample","Geoprocessing Service","Layer File","Layer Package","Layer Template","Layer","Layout","Locator Package","Map Area","Map Document","Map Package","Map Service Definition","Map Template","Mobile Application","Mobile Map Package","Native Application","Network Analysis Service","Operations Dashboard Add In","Project Package","Project Template","Raster Function Template","Rule Package","Scene Package","Service Definition","SQLite Geodatabase","Style","Tile Package","Vector Tile Package","Workflow Manager Package"],site:["Hub Site Application","Site Application"]},wt=bt.app,St=bt.dataset,kt=bt.document,Ct=bt.event,At=bt.feedback,Tt=bt.initiative,Pt=bt.map,xt=bt.other,It=bt.site,Et=["360 VR Experience","Application","CityEngine Web Scene","Code Sample","CSV Collection","CSV","CAD Drawing","Desktop Application","Desktop Application Template","Desktop Style","File Geodatabase","GeoJson","Geoprocessing Package","Geoprocessing Sample","Image","iWork Keynote","iWork Numbers","KML Collection","KML","Layer","Layer File","Layer Package","Layout","Locator Package","Map Package","Map Service Definition","Map Template","Microsoft Excel","Microsoft Powerpoint","Microsoft Visio","Microsoft Word","Notebook","Operations Dashboard Add In","PDF","Pro Map","Project Package","Project Template","Raster function template","Rule Package","Service Definition","Shapefile","Vector Tile Package","Workflow Manager Package"],Ot=["Data"],Dt={app:wt.concat(At),dataset:St,document:kt,event:Ct,initiative:Tt,map:Pt,other:xt,site:It,downloadableTypes:Et,downloadableTypeKeywords:Ot,apiTypes:["Feature Service","Map Service","Image Service"]};function _t(e){return-1!==Et.indexOf(e.type)||e.typeKeywords&&Ot.some(function(t){return e.typeKeywords.some(function(e){return e===t})})}function Ut(e){return[[e.xmin,e.ymin],[e.xmax,e.ymax]]}var jt={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}};function Nt(e){var t=e.portalSelf,r=t.defaultExtent,t=E(t,"helperServices.geometry.url");if(!t)return Promise.resolve(jt);if(!r)return Promise.resolve(jt);t+="/project",r={httpMethod:"POST",params:{geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[r]}),transformForward:!1,transformation:"",inSR:r.spatialReference.wkid,outSR:4326,f:"json"}};return e.authentication&&(r.authentication=e.authentication),Z(t,r).then(function(e){e=e.geometries[0];return{xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax,spatialReference:{wkid:4326}}}).catch(function(e){return jt})}var Rt=function(e){return Array.isArray(e)&&Array.isArray(e[0])&&Array.isArray(e[1])};function Mt(e){return console.warn("DEPRECATED: use isBBox() instead"),Rt(e)}function qt(e){var t=(n=e[0])[0],r=n[1],e=(n=e[1])[0],n=n[1];return{rings:[[[t,r],[e,r],[e,n],[t,n],[t,r]]],spatialReference:{wkid:4326}}}var Ft=new RegExp(/.+(?:map|feature|image)server/i);function Lt(e){var t=e.match(Ft);return t?t[0]:te(e.split("?")[0])}function Gt(e){var t,r;switch((e||"").toLowerCase()){case"image service":t="dataset";break;case"feature service":case"raster layer":t="map";break;case"microsoft excel":t="document";break;case"cad drawing":case"feature collection template":case"report template":t="content";break;default:t={other:"content",solution:"template"}[r=vt(e)]||r}return t}function Bt(e){return e&&e.isPortal}function Ht(e,t,r){var n,o=Kt(e,t,r);return o||(n="/content","feedback"===(r=Gt(e))?n="/feedback/surveys":Yt(e)?n="/pages":-1<["app","dataset","document","map","template"].indexOf(r)&&(n="/"+r+"s"),o=n+"/"+t),o}var Wt,Yt=function(e){return["Hub Page","Site Page"].includes(e)},Kt=function(e,t,r){var n;return"Solution"===e&&(0<(null==r?void 0:r.indexOf("Deployed"))&&(n="/content/"+t),n="/templates/"+t+"/about"),n};function zt(e){return{updateFrequency:"metadata.dataIdInfo.resMaint.maintFreq.MaintFreqCd.@_value",reviseDate:"metadata.dataIdInfo.idCitation.date.reviseDate",pubDate:"metadata.dataIdInfo.idCitation.date.pubDate",createDate:"metadata.dataIdInfo.idCitation.date.createDate",metadataUpdateFrequency:"metadata.mdMaint.maintFreq.MaintFreqCd.@_value",metadataUpdatedDate:"metadata.mdDateSt"}[e]}function Vt(e,t){t=zt(t);return t&&E(e,t)}(Pt=Wt=Wt||{}).Year="year",Pt.Month="month",Pt.Day="day",Pt.Time="time";var Jt=function(e,t){t=t.url&&Lt(t.url);return t&&e.linkage.includes(t)},$t=function(e,t,r){var n=e.linkage,r=E(r,"authentication.token");return r&&Jt(e,t)&&(t=new URL(e.linkage),(e=new URLSearchParams(t.search)).set("token",r),t.search=e.toString(),n=t.toString()),n},Qt=[{type:"CC0-1.0",abbr:"CC0",name:"Public Domain Dedication",url:"http://creativecommons.org/publicdomain/zero/1.0"},{type:"CC-BY-4.0",abbr:"CC BY",name:"Attribution 4.0 International",url:"http://creativecommons.org/licenses/by/4.0"},{type:"CC-BY-3.0",abbr:"CC BY 3.0",name:"Attribution 3.0 Unported",url:"http://creativecommons.org/licenses/by/3.0"},{type:"CC-BY-2.5",abbr:"CC BY 2.5",name:"Attribution 2.5 Generic",url:"http://creativecommons.org/licenses/by/2.5"},{type:"CC-BY-2.0",abbr:"CC BY 2.0",name:"Attribution 2.0 Generic",url:"http://creativecommons.org/licenses/by/2.0"},{type:"CC-BY-1.0",abbr:"CC BY 1.0",name:"Attribution 1.0 Generic",url:"http://creativecommons.org/licenses/by/1.0"},{type:"CC-BY-SA-4.0",abbr:"CC BY-SA",name:"Attribution-ShareAlike 4.0 International",url:"http://creativecommons.org/licenses/by-sa/4.0"},{type:"CC-BY-SA-3.0",abbr:"CC BY-SA 3.0",name:"Attribution-ShareAlike 3.0 Unported",url:"http://creativecommons.org/licenses/by-sa/3.0"},{type:"CC-BY-SA-2.5",abbr:"CC BY-SA 2.5",name:"Attribution-ShareAlike 2.5 Generic",url:"http://creativecommons.org/licenses/by-sa/2.5"},{type:"CC-BY-SA-2.0",abbr:"CC BY-SA 2.0",name:"Attribution-ShareAlike 2.0 Generic",url:"http://creativecommons.org/licenses/by-sa/2.0"},{type:"CC-BY-SA-1.0",abbr:"CC BY-SA 1.0",name:"Attribution-ShareAlike 1.0 Generic",url:"http://creativecommons.org/licenses/by-sa/1.0"},{type:"CC-BY-ND-4.0",abbr:"CC BY-ND",name:"Attribution-NoDerivatives 4.0 International",url:"http://creativecommons.org/licenses/by-nd/4.0"},{type:"CC-BY-ND-3.0",abbr:"CC BY-ND 3.0",name:"Attribution-NoDerivs 3.0 Unported",url:"http://creativecommons.org/licenses/by-nd/3.0"},{type:"CC-BY-ND-2.5",abbr:"CC BY-ND 2.5",name:"Attribution-NoDerivs 2.5 Generic",url:"http://creativecommons.org/licenses/by-nd/2.5"},{type:"CC-BY-ND-2.0",abbr:"CC BY-ND 2.0",name:"Attribution-NoDerivs 2.0 Generic",url:"http://creativecommons.org/licenses/by-nd/2.0"},{type:"CC-BY-ND-1.0",abbr:"CC BY-ND 1.0",name:"Attribution-NoDerivs 1.0 Generic",url:"http://creativecommons.org/licenses/by-nd/1.0"},{type:"CC-BY-NC-4.0",abbr:"CC BY-NC",name:"Attribution-NonCommercial 4.0 International",url:"https://creativecommons.org/licenses/by-nc/4.0"},{type:"CC-BY-NC-3.0",abbr:"CC BY-NC 3.0",name:"Attribution-NonCommercial 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc/3.0"},{type:"CC-BY-NC-2.5",abbr:"CC BY-NC 2.5",name:"Attribution-NonCommercial 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc/2.5"},{type:"CC-BY-NC-2.0",abbr:"CC BY-NC 2.0",name:"Attribution-NonCommercial 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc/2.0"},{type:"CC-BY-NC-1.0",abbr:"CC BY-NC 1.0",name:"Attribution-NonCommercial 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc/1.0"},{type:"CC-BY-NC-SA-4.0",abbr:"CC BY-NC-SA",name:"Attribution-NonCommercial-ShareAlike 4.0 International",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},{type:"CC-BY-NC-SA-3.0",abbr:"CC BY-NC-SA 3.0",name:"Attribution-NonCommercial-ShareAlike 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc-sa/3.0"},{type:"CC-BY-NC-SA-2.5",abbr:"CC BY-NC-SA 2.5",name:"Attribution-NonCommercial-ShareAlike 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/2.5"},{type:"CC-BY-NC-SA-2.0",abbr:"CC BY-NC-SA 2.0",name:"Attribution-NonCommercial-ShareAlike 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/2.0"},{type:"CC-BY-NC-SA-1.0",abbr:"CC BY-NC-SA 1.0",name:"Attribution-NonCommercial-ShareAlike 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/1.0"},{type:"CC-BY-NC-ND-4.0",abbr:"CC BY-NC-ND",name:"Attribution-NonCommercial-NoDerivatives 4.0 International",url:"https://creativecommons.org/licenses/by-nc-nd/4.0"},{type:"CC-BY-NC-ND-3.0",abbr:"CC BY-NC-ND 3.0",name:"Attribution-NonCommercial-NoDerivs 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc-nd/3.0"},{type:"CC-BY-NC-ND-2.5",abbr:"CC BY-NC-ND 2.5",name:"Attribution-NonCommercial-NoDerivs 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/2.5"},{type:"CC-BY-NC-ND-2.0",abbr:"CC BY-NC-ND 2.0",name:"Attribution-NonCommercial-NoDerivs 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/2.0"},{type:"CC-BY-NC-ND-1.0",abbr:"CC BY-NC-ND 1.0",name:"Attribution-NonCommercial-NoDerivs 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/1.0"},{type:"PDDL-1.0",abbr:"PDDL",name:"ODC Public Domain Dedication and License",url:"http://opendatacommons.org/licenses/pddl/summary"},{type:"ODbL-1.0",abbr:"ODbL",name:"ODC Open Database License",url:"http://opendatacommons.org/licenses/odbl/summary"},{type:"ODC-BY-1.0",abbr:"ODC BY",name:"ODC Attribution License",url:"http://opendatacommons.org/licenses/by/summary"}];function Xt(r){var e={type:(r=r||"")?"custom":"none",text:r},t=!1,n=Qt.filter(function(e){return t=e,(e=(e=r).toLowerCase()).includes(t.name.toLowerCase())||e.includes(t.url.toLowerCase())||e.includes(t.abbr.toLowerCase());var t});return n.length&&(t=!0,e=n.pop()),t||(n=void 0,!function(e){try{return!!new URL(e).protocol}catch(e){return!1}}(r)?(t=r,new RegExp(/^<a[\s]+(href\s?=\s?["'].*?["'])+([^>]?)>((?:.(?!\<\/a\>))*.)?<\/a>$|^<a[\s]+(href\s?=\s?["'].*?["'])+([^>]?)\/>/).test(t)&&(t=new RegExp(/href\s?=\s?["'](.*?)["']/),n=r.match(t)[1])):n=r,n&&(e.url=n,e.text="")),e.text||delete e.text,e}function Zt(e,t,r){if(!e||!e.thumbnail)return null;var n=r||{},o=n.token,n=n.width,r=it(e,t,o=!o&&"string"==typeof r?r:o).split("?"),o=r[0],r=r[1],r=new URLSearchParams(r);r.delete("f"),n&&r.append("w",n+"");r=r.toString(),e=o+"/info/"+e.thumbnail;return r?e+"?"+r:e}n.UpdateFrequency=void 0,(xt=n.UpdateFrequency||(n.UpdateFrequency={})).Continual="continual",xt.Daily="daily",xt.Weekly="weekly",xt.Fortnightly="fortnightly",xt.Monthly="monthly",xt.Quarterly="quarterly",xt.Biannually="biannually",xt.Annually="annually",xt.AsNeeded="as-needed",xt.Irregular="irregular",xt.NotPlanned="not-planned",xt.Unknown="unknown",xt.Semimonthly="semimonthly";function er(e,t){return{"001":n.UpdateFrequency.Continual,"002":n.UpdateFrequency.Daily,"003":n.UpdateFrequency.Weekly,"004":n.UpdateFrequency.Fortnightly,"005":n.UpdateFrequency.Monthly,"006":n.UpdateFrequency.Quarterly,"007":n.UpdateFrequency.Biannually,"008":n.UpdateFrequency.Annually,"009":n.UpdateFrequency.AsNeeded,"010":n.UpdateFrequency.Irregular,"011":n.UpdateFrequency.NotPlanned,"012":n.UpdateFrequency.Unknown,"013":n.UpdateFrequency.Semimonthly}[Vt(e,t||"updateFrequency")]}function tr(e,t){var r,n,o=(e=Vt(e,t),/^\d{4}$/.test(e=""+e)?(r=new Date(+e,0,1),o=Wt.Year):/^\d{4}-\d{1,2}$/.test(e)?(n=e.split("-"),r=new Date(+n[0],+n[1]-1,1),o=Wt.Month):/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)?(n=e.split("-"),r=new Date(+n[0],+n[1]-1,+n[2]),o=Wt.Day):Number.isNaN(Date.parse(e))||(r=new Date(e),o=e.includes("T")?Wt.Time:Wt.Day),r&&o&&{date:r,precision:o});return o&&D(D({},o),{source:"metadata."+zt(t)})}function rr(e,t){return(e=E(e,t+=".editingInfo.lastEditDate"))&&{date:new Date(e),source:t,precision:Wt.Day}}function nr(e,t){return{date:new Date(e[t]),precision:Wt.Day,source:"item."+t}}function or(e){return null!==(e={appbuilderExtension:"file",appbuilderWidgetPackage:"widgets-source",application:"web",applicationConfiguration:"app-gear",arcgisProMap:"desktop",cadDrawing:"file-cad",cityEngineWebScene:"urban-model",codeAttachment:"file-code",codeSample:"file-code",colorSet:"palette",contentCategorySet:"label",csv:"file-csv",cSV:"file-csv",cSVCollection:"file-csv",dashboard:"dashboard",desktopApplication:"desktop",documentLink:"link",excaliburImageryProject:"file",explorerMap:"file",exportPackage:"file",featureCollection:"data",featureCollectionTemplate:"file",featureLayer:"data",featureService:"collection",fileGeodatabase:"data",form:"survey",geocodingService:"file",geodataService:"file",geometryService:"file",geopackage:"file",geoprocessingService:"file",globeLayer:"layers",globeService:"file",hubInitiative:"initiative",hubInitiativeTemplate:"initiative-template",hubPage:"browser",hubSiteApplication:"web",image:"file-image",imageService:"data",insightsModel:"file",insightsPage:"graph-moving-average",insightsTheme:"palette",insightsWorkbook:"graph-moving-average",iWorkPages:"file-text",iWorkKeynote:"presentation",iWorkNumbers:"file-report",kML:"data",kMLCollection:"data",layer:"layers",layerPackage:"layers",layerTemplate:"file",locatorPackage:"file",mapArea:"file",mapDocument:"map-contents",mapImageLayer:"collection",mapPackage:"file",mapService:"collection",microsoftExcel:"file-report",microsoftPowerpoint:"presentation",microsoftWord:"file-text",mission:"file",mobileMapPackage:"map-contents",nativeApplication:"mobile",nativeApplicationInstaller:"file",nativeApplicationTemplate:"file",mobileApplication:"mobile",networkAnalysisService:"file",notebook:"code",orientedImageryCatalog:"file",orthoMappingProject:"file",orthoMappingTemplate:"file",pDF:"file-pdf",quickCaptureProject:"mobile",rasterFunctionTemplate:"file",rasterLayer:"map",realTimeAnalytic:"file",relationalDatabaseConnection:"file",reportTemplate:"file",sceneLayer:"data",sceneService:"urban-model",serviceDefinition:"file",shapefile:"data",solution:"puzzle-piece",sqliteGeodatabase:"file",statisticalDataCollection:"file",storymap:"tour",storyMap:"tour",storymapTheme:"palette",symbolSet:"file",table:"table",urbanModel:"urban-model",vectorTilePackage:"file-shape",vectorTileService:"map",visioDocument:"conditional-rules",webExperience:"apps",webMap:"map",webMappingApplication:"apps",webScene:"urban-model",wfs:"map",wFS:"map",wMS:"map",wMTS:"map",workflowManagerService:"file",workforceProject:"list-check"}[h(e||"")])&&void 0!==e?e:"file"}function ir(e,t){var r=(r=t.authentication)&&r.token;return{portalHome:nt(e.id,t),portalApi:it(e,t,r),portalData:ot(e,t,r),thumbnail:Zt(e,t,{token:r})}}function ar(e,t){var r,n;return n=e,r=!Bt(t)&&"public"===n.access&&"CSV"===n.type&&n.size<=5e6?lt(t)+"/datasets/"+e.id+"_0/FeatureServer/0":r}function sr(e){return e&&"feature service"===e.toLowerCase()}var ur=function(e){e=e&&e.match(/\/\d+$/);return e&&e[0].slice(1)};function cr(e){var t=(e=void 0===e?{}:e).type,r=e.typeKeywords||[];return("Site Application"===e.type||"Web Mapping Application"===e.type&&T(r,"hubSite"))&&(t="Hub Site Application"),("Site Page"===e.type||"Web Mapping Application"===e.type&&T(r,"hubPage"))&&(t="Hub Page"),"Hub Initiative"===e.type&&T(r,"hubInitiativeTemplate")&&(t="Hub Initiative Template"),t="Web Mapping Application"===e.type&&T(r,"hubSolutionTemplate")?"Solution":t}function lr(e){return ur(e.url)||sr(e.type)&&e.typeKeywords&&T(e.typeKeywords,"Singlelayer")&&"0"}function pr(e){if("public"===e.access){var t=e.id,e=lr(e);return e?t+"_"+e:t}}function dr(e){if(!e)return e;var t=["categories",""];return e.map(function(e){return e.split("/")}).reduce(function(e,t,r){return _(e,t)},[]).filter(function(e){return!T(t,e.toLowerCase())})}var fr=function(r,e){var t=e||{},n=t.slug,o=t.requestOptions,i=t.data,a=t.metadata,s=t.groupIds,u=t.ownerUser,c=t.org,l=t.errors,p=t.server,d=t.layers,f=t.recordCount,h=t.boundary,m=t.statistics,g=ur(r.url),y=g?parseInt(g,10):null==e?void 0:e.layerId,v=d&&(O(y)?sr(r.type)&&function(e){e=e&&1===e.length&&e[0];return e&&e.capabilities.includes("Query")&&e}(d):d.find(function(e){return e.id===y})),b=!Bt(o)&&"public"===r.access?v?r.id+"_"+v.id:pr(r):void 0,t=n||b||r.id,w=(g=d,e=r.url,v&&g&&1<g.length&&!ur(e)),S=w?v.name:r.title,k=w&&v.description,C=v?v.type:cr(r),A=D({relative:Ht(C,t,r.typeKeywords)},o&&ir(r,o)),T=ar(r,o),P=(e=r,tr((o={metadata:a,layer:v,server:p}).metadata,"reviseDate")||rr(o,"layer")||rr(o,"server")||nr(e,"modified")),x=(o=r,tr(e=a,"pubDate")||tr(e,"createDate")||nr(o,"created")),I=(o=r,tr(a,"metadataUpdatedDate")||nr(o,"modified"));return D(D({item:r},r),{slug:n,data:i,metadata:a,groupIds:s,ownerUser:u,org:c,errors:l||[],server:p,layers:d,recordCount:f,statistics:m,hubId:b,identifier:t,get isProxied(){return!!T},layer:v,name:S,get title(){return S},get description(){return k||r.description},type:C,get family(){return Gt(C)},get url(){return T||(w?Lt(r.url)+"/"+v.id:r.url)},get categories(){return dr(r.categories)},get actionLinks(){return r.properties&&r.properties.links},get hubActions(){return r.properties&&r.properties.actions},get isDownloadable(){return _t(r)},get structuredLicense(){return Xt(r.licenseInfo)},get permissions(){return{visibility:r.access,control:r.itemControl||"view"}},get boundary(){return h||function(e){var t,r=e.extent,n=Rt(r),e=(null===(e=e.properties)||void 0===e?void 0:e.boundary)||(n?"item":void 0);switch(e){case"item":t=n?qt(r):null;break;case"none":t=null}return{provenance:e,geometry:t}}(r)},get summary(){return k||r.snippet||r.description},urls:A,get portalHomeUrl(){return A.portalHome},get portalDataUrl(){return A.portalData},get portalApiUrl(){return A.portalApi},get thumbnailUrl(){return A.thumbnail},get createdDate(){return new Date(r.created)},createdDateSource:"item.created",get updatedDate(){return P.date},get updatedDateSource(){return P.source},get updatedDatePrecision(){return P.precision},get modified(){return P.date.getTime()},get publishedDate(){return x.date},get publishedDateSource(){return x.source},get publishedDatePrecision(){return x.precision},get metadataUpdatedDate(){return I.date},get metadataUpdatedDateSource(){return I.source},get metadataUpdatedDatePrecision(){return I.precision},get updateFrequency(){return er(a)},get metadataUpdateFrequency(){return er(a,"metadataUpdateFrequency")},get publisher(){return{name:r.owner,username:r.owner}},get metrics(){return r.properties&&r.properties.metrics},get spatialReference(){return function(e){var t=e.spatialReference;if(!t||"object"==typeof t)return t;e=t+"",t=parseInt(e,10);return isNaN(t)?{wkt:e}:{wkid:t}}(r)||(e=p,(null===(t=null==(t=v)?void 0:t.extent)||void 0===t?void 0:t.spatialReference)||(null==e?void 0:e.spatialReference))||null;var e,t},get orgId(){return c?c.id:r.orgId},get contentTypeIcon(){return console.warn("DEPRECATED: it is now the responsibility of the consuming package to determine the icon"),or(C)},get license(){return console.warn("DEPRECATED: use structuredLicense instead"),{name:"Custom License",description:r.accessInformation}},get hubType(){return console.warn("DEPRECATED: use family instead"),Gt(C)},get additionalResources(){return function(t,e,r){e=E(e,"metadata.distInfo.distTranOps.onLineSrc")||null;return null===e?null:(e=Array.isArray(e)?e:[e]).map(function(e){return{name:e.orName,url:$t(e,t,r),isDataSource:Jt(e,t)}})}(r,a)}})};function hr(e){void 0===e&&(e=""),console.warn("DEPRECATED: Use getCollection() instead. getCategory will be removed at v10.0.0");e=vt(e);return"feedback"===e?"app":e}function mr(t,e){if(T(["template","feedback"],t.family))return t.id;if(Yt(t.type)){var r=(E(e,"data.values.pages")||[]).find(function(e){return e.id===t.id});return r?r.slug:t.id}if(t.slug){r=E(e,"domainInfo.orgKey");return E(e,"data.values.isUmbrella")?t.slug:yr(t.slug,r)}return t.hubId||t.id}function gr(e){e=e?e.split("_"):[];return{itemId:e[0],layerId:e[1]}}function yr(e,t){return t&&e.match(t+"::")?e.split(t+"::")[1]:e}function vr(e){return fr(e)}function br(e){if(e){var t=e.id,r=e.attributes;if(r){var n=gr(t).itemId,o=r.owner,i=r.orgId,a=r.created,s=r.modified,u=r.name,c=r.title,l=r.type,p=r.typeKeywords,d=r.description,f=r.snippet,h=r.tags,m=r.thumbnail,g=r.categories,y=r.contentStatus,v=r.spatialReference,b=r.accessInformation,w=r.licenseInfo,S=r.culture,k=r.url,C=r.access,A=r.proxyFilter,T=r.properties,P=r.appCategories,x=r.industries,I=r.languages,E=r.largeThumbnail,O=r.banner,D=r.screenshots,_=r.listed,U=r.ownerFolder,j=r.size,N=r.protected,R=r.commentsEnabled,M=r.numComments,q=r.numRatings,F=r.avgRating,L=r.numViews,G=r.itemControl,B=r.scoreCompleteness,H=r.itemExtent,e=r.itemModified,t=r.modifiedProvenance,r=r.serviceSpatialReference;return{id:n,owner:o,orgId:i,created:a,modified:e||"item.modified"===t&&s,title:c||u,type:k&&ct(k)||l,typeKeywords:p,description:d,tags:h,snippet:f,thumbnail:m,extent:H||[],categories:g,contentStatus:y,spatialReference:v||r,accessInformation:b,licenseInfo:w,culture:S,url:k,access:C,size:j,protected:N,proxyFilter:A,properties:T,appCategories:P,industries:x,languages:I,largeThumbnail:E,banner:O,screenshots:D,listed:_,ownerFolder:U,commentsEnabled:R,numComments:M,numRatings:q,avgRating:F,numViews:L,itemControl:G,scoreCompleteness:B}}}}function wr(e,t){var r=mr(e,t);return{relative:r=Ar(e,r),absolute:""+E(t,"item.url").replace(/\/$/,"")+r}}var Sr=function(e,t){return t?"CSV":h(e||"")},kr=function(e,t){var r=wr(e,t),t=r.relative,r=r.absolute;return Cr(e,{relative:t,site:r})},Cr=function(e,t){t=D(D({},e.urls),t);return D(D({},e),{urls:t})},Ar=function(e,t){return Ht(e.type,t||e.identifier,e.typeKeywords)};const Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var xr={atob:function(t){if((t=(t=(t=`${t}`).replace(/[ \t\n\f\r]/g,"")).length%4==0?t.replace(/==?$/,""):t).length%4==1||/[^+/0-9A-Za-z]/.test(t))return null;let r="",n=0,o=0;for(let e=0;e<t.length;e++)n<<=6,n|=function(e){e=Tr.indexOf(e);return e<0?void 0:e}(t[e]),o+=6,24===o&&(r+=String.fromCharCode((16711680&n)>>16),r+=String.fromCharCode((65280&n)>>8),r+=String.fromCharCode(255&n),n=o=0);return 12===o?(n>>=4,r+=String.fromCharCode(n)):18===o&&(n>>=2,r+=String.fromCharCode((65280&n)>>8),r+=String.fromCharCode(255&n)),r},btoa:function(e){let t;for(e=`${e}`,t=0;t<e.length;t++)if(255<e.charCodeAt(t))return null;let r="";for(t=0;t<e.length;t+=3){const n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(t)>>2,n[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(n[1]|=e.charCodeAt(t+1)>>4,n[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(n[2]|=e.charCodeAt(t+2)>>6,n[3]=63&e.charCodeAt(t+2));for(let e=0;e<n.length;e++)void 0===n[e]?r+="=":r+=function(e){if(0<=e&&e<64)return Pr[e];return}(n[e])}return r}},Ir="4326",Er={csv:{name:"CSV",itemTypes:["CSV","CSV Collection"],supportsProjection:!0},kml:{name:"KML",itemTypes:["KML","KML Collection"],supportsProjection:!1},shapefile:{name:"Shapefile",itemTypes:["Shapefile"],supportsProjection:!0},fileGeodatabase:{name:"File Geodatabase",itemTypes:["File Geodatabase"],supportsProjection:!0},geojson:{name:"GeoJson",itemTypes:["GeoJson"],supportsProjection:!1},excel:{name:"Excel",itemTypes:["Microsoft Excel"],supportsProjection:!0},featureCollection:{name:"Feature Collection",itemTypes:["Feature Collection"],supportsProjection:!0}};function Or(e){if("object"!=typeof e)return e;var t=e.wkid,e=e.wkt;return t?t+"":xr.btoa(e)}function Dr(e){return"spatialRefId:"+Or(function(t){var r;try{r=JSON.parse(t)}catch(e){r=t}return r}(e))}function _r(e){return"exportItem:"+e}function Ur(e){return e?"exportLayer:0"+e:"exportLayer:null"}function jr(e){var t,r=e.autoAddResult,n=e.inviteResult,o=e.primaryEmailResult,e=e.secondaryEmailResult;return(o||e)&&(t={success:(e=[o,e].filter(function(e){return e})).every(function(e){return e.success})},(e=e.reduce(function(e,t){return e.concat(v(t,"errors",[]))},[])).length&&(t.errors=e)),{success:[r,n,t].filter(function(e){return e}).every(function(e){return e.success}),autoAdd:r,invite:n,email:t}}function Nr(t,e){var r;return t&&(r=!E(t,"notAdded.length")&&!t.errors,e.autoAddResult={success:r},r||(r=t.errors||[],E(t,"notAdded.length")&&r.push(new K("Users not auto-added: "+t.notAdded.join(", "))),e.autoAddResult.errors=r,r=e.usersToAutoAdd.filter(function(e){return T(t.notAdded,e.username)}),e.usersToInvite=e.usersToInvite.concat(r))),e}function Rr(e,t){return e.orgId===t.orgId}function Mr(e){return"org_admin"===e.role&&!e.roleId}function qr(e,t,r,n){var o=Promise.resolve(null);return e.length&&(e={authentication:r,message:t.body,subject:t.subject,notificationChannelType:"email",users:e.map(function(e){return e.username})},n||(e.batchSize=1),o=Ge(e)),o}function Fr(t){var r,e=Promise.resolve(t);return t.email&&t.secondaryRO&&E(t,"inviteResult.success")&&(r=v(t,"secondaryRO.portalSelf.user",{}),e=qr(t.usersToInvite.filter(function(e){return Rr(e,r)}),t.email,t.secondaryRO.authentication,Mr(r)).then(function(e){return t.secondaryEmailResult=e,t})),e}function Lr(e,t,r){var n=Promise.resolve(null);return n=t.length?_e({id:e,users:t.map(function(e){return e.username}),authentication:r}):n}function Gr(t){return Lr(E(t,"groupId"),E(t,"usersToAutoAdd"),E(t,"primaryRO.authentication")).then(function(e){return Nr(e,t)})}function Br(e,t,r,n,o){void 0===n&&(n=20160),void 0===o&&(o="group_member");var i=Promise.resolve(null);return i=t.length?Re({id:e,users:t.map(function(e){return e.username}),authentication:r,role:o,expiration:n}):i}function Hr(t){return Br(E(t,"groupId"),E(t,"usersToInvite"),E(t,"primaryRO.authentication")).then(function(e){return t.inviteResult=e,t})}function Wr(t){var e=Promise.resolve(t);return e=t.email&&E(t,"inviteResult.success")?qr(t.usersToEmail,t.email,t.primaryRO.authentication,Mr(t.requestingUser)).then(function(e){return t.primaryEmailResult=e,t}):e}function Yr(e,t){var r,n=[];return-1!==t.privileges.indexOf("portal:admin:assignToGroups")&&(r=[t.orgId,t.cOrgId].filter(function(e){return e}),n=e.filter(function(e){return-1!==r.indexOf(e.orgId)})),n}function Kr(e,t){var r=Yr(e,t);return e.filter(function(t){return!r.some(function(e){return e.username===t.username})})}function zr(e,t,r){void 0===r&&(r=!1);e=Kr(e,t).filter(function(e){return Rr(e,t)});return r&&e.push(t),e}var Vr=["ar","bs","ca","cs","da","de","en","es","et","el","fi","fr","hr","he","hu","it","id","ja","ko","lt","lv","nb","nl","pl","pt","pt-br","pt-pt","ro","ru","sl","sr","sv","th","tr","uk","vi","zh","zh-cn","zh-tw","zh-hk"];function Jr(e,t){if("object"==typeof e&&null!==e&&"string"==typeof t){for(var r=t.split("."),n=0;n<r.length-1;n++){if(!e.hasOwnProperty(r[n]))return;e=e[r[n]]}delete e[r[r.length-1]]}}function $r(e){var t=p(e.item);return t.text=JSON.stringify(e.data),t}function Qr(e,t){return Promise.all([we(e,t),ke(e,t)]).then(function(e){return{item:e[0],data:e[1]}})}function Xr(e,r){return An(e,r).then(function(e){var t=[Promise.resolve(e)];return e?t.push(ke(e.id,r)):t.push(Promise.resolve(null)),Promise.all(t)}).then(function(e){return e[0]?{item:e[0],data:e[1]}:null})}function Zr(e,t){var r=p(e),n=p(e.item);return n.data=p(e.data),be(D({item:n},t)).then(function(e){return r.item.id=e.id,r.item.created=(new Date).getTime(),r.item.modified=r.item.created,r})}function en(e,t){var r=p(e),n=p(e.item);return n.data=p(e.data),ve(D({item:n},t)).then(function(){return r.item.modified=(new Date).getTime(),r})}function tn(r,n){return x(this,void 0,void 0,function(){var t;return I(this,function(e){switch(e.label){case 0:return[4,ke(r.id,n)];case 1:return t=e.sent(),[2,{item:r,data:t}]}})})}var rn=function(e,t,r){return void 0===r&&(r=void 0),t.split(".").reduce(function(e,t){return e?e[t]:r},e)};function nn(r,n){return Object.keys(r).reduce(function(e,t){return e[t]=n(r[t],t,r),e},{})}var on=function(e){return e instanceof Date},an=function(e){return"function"==typeof e},sn=function(e){return"object"==typeof e},un=function(e){return e instanceof RegExp};var cn=function(e){return"object"==typeof e};function ln(e){return Array.isArray(e)?function(e){var t=e,e=e.reduce(function(e,t){return fn(t)&&dn(t)&&(e<(t=pn(t))&&(e=t)),e},-1);-1<e&&(t=0===e?[]:"{{delete:"+(e-1)+"}}");return t}(e.map(t).filter(function(e){return null!=e})):e&&cn(e)?function(o){var e=Object.keys(o).reduce(function(e,t){var r,n=o[t];return fn(n)&&dn(n)?(r=pn(n))>e.maxLevel&&(e.maxLevel=r):e.obj[t]=n,e},{obj:{},maxLevel:-1});e=0<e.maxLevel?1===e.maxLevel?void 0:"{{delete:"+(e.maxLevel-1)+"}}":e.obj;return e}(nn(e,t)):function(e){var t=e;"string"==typeof e&&dn(e)&&(t=function(e){var t=e,e=pn(e);t=0===e?void 0:"{{delete:"+e+"}}";return t}(e));return t}(e);function t(e,t){return ln(e)}}var pn=function(e){return parseInt(e.replace(/{|}/g,"").split(":")[1])};function dn(e){return e&&"string"==typeof e&&-1<e.indexOf("{{delete")}var fn=function(e){return"string"==typeof e};function hn(e,t,r,n){return void 0===n&&(n=0),t?t:"{{delete:"+n+"}}"}var mn=function(e){var t={};if(Array.isArray(e))t=e.map(mn);else if("object"==typeof e)for(var r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=mn(e[r]):t[r]=e[r];else t=e;return t},gn=/{{\s*?[\w].*?}}/g,yn=function(e){return"string"==typeof e};function vn(e){return e||""===e||0===e}function bn(e,a,s){if((s=mn(s=void 0===s?null:s)||{}).optional)throw new Error("Please do not pass in an `optional` transform; adlib provides that internally.");return s.optional=hn,ln(function r(e,n,o){return o=o||"",Array.isArray(e)?e.map(t):!e||!sn(e)||on(e)||un(e)||an(e)?n(e,o):Object.assign({},e,nn(e,t));function t(e,t){return r(e,n,o?o+"."+t:t)}}(e,function(t,e){if(!yn(t))return t;var r,n=t.match(gn);return n&&n.length?(n.map(function(e){var o,i=!1,t=e.replace(/{|}/g,"").trim();-1<t.indexOf("||")&&(r=t.split("||").map(function(e){return e.trim()}),o=r.length,t=r.find(function(e,t){var r,n;return(n=a,r=(r=e).split(":")[0],null!=(r=rn(n,r,null)))?e:t+1===o&&(i=!0,isNaN(e)?e:parseInt(e))}));var r={key:e,value:t};return i||(t=function(e,t,r){var n,o=e.split(":");if(1<o.length){var i,a=o[0],s=o[1];if(o[2]&&(i=o[2]),!r||!r[s]||"function"!=typeof r[s])throw new Error("Attempted to apply non-existant transform "+s+" on "+a+" with params "+e);n=rn(t,a),n=r[s](a,n,t,i)}else n=rn(t,e);return n}(t,a,s),r.value=vn(t)?t:e),r}).forEach(function(e){t===e.key?("string"==typeof e.value&&(isNaN(e.value)||""===e.value||(-1<e.value.indexOf(".")?e.value=parseFloat(e.value):e.value=parseInt(e.value))),r=e.value):t=t.replace(e.key,e.value)}),vn(r)?r:t):t}))}function wn(e,t,r){return bn(e,t,r)}function Sn(e,t,r){return Oe({q:'title:"'+e+'" AND '+Object.keys(t).map(function(e){return e+':"'+t[e]+'"'}).join(" AND "),authentication:r}).then(function(e){return 0<e.results.length}).catch(function(e){throw Error("Error in doesItemExistWithTitle "+e)})}function kn(e,t){return t.toLowerCase()+"-"+F(e)}function Cn(e,t){e=e.filter(function(e){return!e.startsWith("slug|")});return e.push("slug|"+t),e}function An(e,t){return Tn({slug:e},t).then(function(e){return e.length?e[0]:null})}function Tn(e,t){t={q:"",filter:'typekeywords:"slug|'+e.slug+'"',authentication:t.authentication};return e.exclude&&(t.q="NOT id:"+e.exclude),Oe(t).then(function(e){return e.results}).catch(function(e){throw Error("Error in getItemBySlug "+e)})}function Pn(t,r,n){var o=t.slug;return Tn({slug:o=(n=void 0===n?0:n)?t.slug+"-"+n:o,exclude:t.existingId},r).then(function(e){return e.length?Pn(t,r,++n):o}).catch(function(e){throw Error("Error in getUniqueSlug "+e)})}var xn=["id","isOrgItem","proxyFilter","ownerFolder","protected","owner","created","modified","guid","name","access","size","listed","numComments","numRatings","avgRating","numViews","scoreCompleteness","groupDesignations","listed","screenshots","banner","appCategories","industries","languages","largeThumbnail"];function In(n,o,i,a){return x(this,void 0,void 0,function(){var t,r;return I(this,function(e){switch(e.label){case 0:t=D({item:{id:n},params:{thumbnail:o},filename:i},a),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,ve(t)];case 2:if(!e.sent().success)throw new Zo("Set Project Thumbnail","Unknown error setting thumbnail.");return[3,4];case 3:throw(r=e.sent())instanceof Error?new Zo("Set Project Thumbnail",r.message,r):new Zo("Set Project Thumbnail","Unknown error setting thumbnail.");case 4:return[2]}})})}var En=(On.prototype.modelToObject=function(e,t){return r=this.mappings,Dn(e,"modelKey",t,"objectKey",r);var r},On.prototype.objectToModel=function(e,t){return r=this.mappings,Dn(e,"objectKey",t,"modelKey",r);var r},On);function On(e){this.mappings=e}function Dn(r,n,e,o,t){var i=p(e);return t.forEach(function(e){var t=E(e,n),e=E(e,o),t=E(r,t);null!=t&&y(i,e,t)}),i}var It="Hub Project",_n={name:"No title provided",tags:[],typeKeywords:["Hub Project"],status:"inactive"},Un={item:{type:It,title:"No Title Provided",description:"No Description Provided",snippet:"",tags:[],typeKeywords:["Hub Project"],properties:{slug:""}},data:{display:"about",timeline:{},status:"inactive",contacts:[],schemaVersion:1}};function jn(){var t=[];return["created","culture","description","extent","id","modified","owner","snippet","tags","typeKeywords","url","type"].forEach(function(e){t.push({objectKey:e,modelKey:"item."+e})}),["contacts","display","geometry","headerImage","layout","location","status"].forEach(function(e){t.push({objectKey:e,modelKey:"data."+e})}),t.push({objectKey:"slug",modelKey:"item.properties.slug"}),t.push({objectKey:"orgUrlKey",modelKey:"item.properties.orgUrlKey"}),t.push({objectKey:"name",modelKey:"item.title"}),t}function Nn(i,a){return x(this,void 0,void 0,function(){var t,r,n,o;return I(this,function(e){switch(e.label){case 0:return(t=D(D({},_n),i)).slug||(t.slug=kn(t.name,t.orgUrlKey)),[4,Pn({slug:(r=t).slug},a)];case 1:return r.slug=e.sent(),t.typeKeywords=Cn(t.typeKeywords,t.slug),n=new En(jn()),[4,Zr(o=n.objectToModel(t,p(Un)),a)];case 2:return o=e.sent(),[2,n.modelToObject(o,{})]}})})}function Rn(o,i){return x(this,void 0,void 0,function(){var t,r,n;return I(this,function(e){switch(e.label){case 0:return[4,Pn({slug:(t=o).slug,existingId:o.id},i)];case 1:return t.slug=e.sent(),[4,Qr(o.id,i)];case 2:return n=e.sent(),r=new En(jn()),[4,en(r.objectToModel(o,n),i)];case 3:return n=e.sent(),[2,r.modelToObject(n,o)]}})})}function Mn(e,n){e=(q(e)?Qr:Xr)(e,n);return e.then(function(e){var t,r=new En(jn()).modelToObject(e,{});return n.authentication&&(t=n.authentication.token),r.thumbnailUrl=Zt(e.item,n,t),r})}function qn(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){switch(e.label){case 0:return[4,Pe(D(D({},r),{id:t}))];case 1:return e.sent(),[2]}})})}function Fn(n,o){var i;return x(this,void 0,void 0,function(){var t,r;return I(this,function(e){return t=ho([{filterType:"content",typekeywords:{exact:["HubProject"]}},n]),t=mo(t),r=wo(t),null!==(i=o.aggregations)&&void 0!==i&&i.length&&(r.countFields=o.aggregations.join(","),r.countSize=200),["authentication","num","sortField","sortOrder","site"].forEach(function(e){o.hasOwnProperty(e)&&(r[e]=o[e])}),[2,Ln(r)]})})}function Ln(s){return x(this,void 0,void 0,function(){var t,r,n,o,i,a;return I(this,function(e){switch(e.label){case 0:return[4,Oe(s)];case 1:return t=e.sent(),r=-1<t.nextStart,i=t.results.map(function(e){return tn(e,{authentication:s.authentication})}),[4,Promise.all(i)];case 2:return a=e.sent(),n=new En(jn()),s.authentication&&(i=s.authentication,o=i.token),a=a.map(function(e){var t=n.modelToObject(e,{});return t.thumbnailUrl=Zt(e.item,{authentication:s.authentication},o),t}),[2,{total:t.total,results:a,facets:[],hasNext:r,next:uo(s,t.nextStart,t.total,Ln)}]}})})}var Gn=(Bn.init=function(e){return new Bn(e)},Object.defineProperty(Bn.prototype,"context",{get:function(){return this._contextManager?this._contextManager.context:this._context},enumerable:!1,configurable:!0}),Bn.prototype.create=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){if(r||this.context.isAuthenticated)return t.orgUrlKey||(t.orgUrlKey=this.context.portal.urlKey),[2,Nn(t,r||this.context.userRequestOptions)];throw new Zo("Create Project","Creating Hub Projects requires authentication.")})})},Bn.prototype.update=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){if(r||this.context.isAuthenticated)return[2,Rn(t,r||this.context.userRequestOptions)];throw new Zo("Update Project","Updating Hub Projects requires authentication.")})})},Bn.prototype.destroy=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){if(r||this.context.isAuthenticated)return[2,qn(t,r||this.context.userRequestOptions)];throw new Zo("Destroy Project","Destroying Hub Projects requires authentication.")})})},Bn.prototype.get=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){return console.warn("HubProjectManager.get is deprecated and will be removed. Use .fetch() instead."),[2,this.fetch(t,r)]})})},Bn.prototype.fetch=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){if(r||this.context.requestOptions)return[2,Mn(t,r||this.context.requestOptions)];throw new Zo("Fetch Project","Can not retrieve context.requestOptions from Context Manager. HubProjectManager is configured incorrectly.")})})},Bn.prototype.search=function(t,r){return x(this,void 0,void 0,function(){return I(this,function(e){return!r.authentication&&this.context.session&&(r.authentication=this.context.session),[2,Fn(t,r)]})})},Bn.prototype.updateThumbnail=function(r,n,o,i){return x(this,void 0,void 0,function(){var t;return I(this,function(e){switch(e.label){case 0:return t=i||this.context.userRequestOptions,[4,In(r.id,n,o,t)];case 1:return e.sent(),[2,this.fetch(r.id,i)]}})})},Bn);function Bn(e){e instanceof gt?this._contextManager=e:this._context=e}var Hn,Wn=(e(Yn,Hn=Error),Yn);function Yn(e,t,r){e=Hn.call(this,e)||this;return e.status=r,e.url=t,e}function Kn(e,t){var r,n,o=D({httpMethod:"GET"},t),i=o.fetch||fetch,t=D({"Content-Type":"application/json"},o.headers);"GET"===o.httpMethod?r=o.params:n=JSON.stringify(o.params);var a=he({host:lt(o),path:("/api/v3/"+e).replace(/\/\//g,"/"),query:r});return i(a,{method:o.httpMethod,headers:t,body:n}).then(function(e){if(e.ok)return e.json();throw new Wn(e.statusText,a,e.status)})}function zn(e,t){var r=e;return r=-1===e.indexOf("token")&&-1<e.indexOf(t.authentication.portal)?e+"?token="+t.authentication.token:r}function Vn(e,t){return(t=void 0===t?{}:t).credentials||(t.credentials="same-origin"),fetch(e,t).then(function(e){return e.blob()})}function Jn(r){return Vn(r.url).then(function(e){return ye(t={id:r.id,owner:r.owner,name:r.fileName,resource:e,authentication:r.authentication}).then(function(e){e=me(t)+"/content/users/"+e+"/items/"+t.id+"/addResources";return t.params=D({file:t.resource,fileName:t.name,resourcesPrefix:t.prefix,text:t.content,access:t.private?"private":"inherit"},t.params),Z(e,t)});var t})}function $n(t){return Vn(t.url).then(function(e){return ve({item:{id:t.id,owner:t.owner},params:{fileName:t.fileName,thumbnail:e},authentication:t.authentication}).catch(function(e){return Promise.resolve()})}).catch(function(e){return Promise.resolve()})}var Qn={arcgis:{label:"ArcGIS Online",url:"https://www.arcgis.com",type:"arcgis"},arcgisQA:{label:"ArcGIS Online QAEXT",url:"https://qaext.arcgis.com",type:"arcgis"},arcgisDEV:{label:"ArcGIS Online DEVEXT",url:"https://devext.arcgis.com",type:"arcgis"},hub:{label:"ArcGIS Hub",url:"https://hub.arcgis.com/api",type:"arcgis-hub"},hubDEV:{label:"ArcGIS Hub DEV",url:"https://hubdev.arcgis.com/api",type:"arcgis-hub"},hubQA:{label:"ArcGIS Hub QA",url:"https://hubqa.arcgis.com/api",type:"arcgis-hub"}};function Xn(e){return"string"==typeof e&&e in Qn?Qn[e]:e}function Zn(e,t){var r=p(e);return t.from<e.from&&(r.from=t.from),t.to>e.to&&(r.to=t.to),r}function eo(r,n){var o={};return["any","all","not","exact"].forEach(function(e){var t=e,e=_(to(r,t),to(n,t));e.length&&(o[t]=e.filter(m))}),o}function to(e,t){var r=[];return e[t]&&(t=e[t],r=Array.isArray(t)?t:[t]),r}function ro(e){var t={};return Array.isArray(e)?t={any:e}:("string"==typeof e&&(t={any:[e]}),"object"==typeof e&&(t=e)),t}function no(e){var t=new Date,r={type:"date-range",from:t.getTime(),to:t.getTime()};switch(e.unit){case"hours":case"days":case"weeks":r.from=r.to-{min:6e4,hours:36e5,days:864e5,weeks:6048e5}[e.unit]*e.num;break;case"months":t.setMonth(t.getMonth()-e.num),r.from=t.getTime();break;case"years":t.setFullYear(t.getFullYear()-e.num),r.from=t.getTime()}return r}function oo(e,t,r){var n=p(e),e=t.q,t=t.filter;return e&&(n.q=(n.q?" ("+n.q+" "+r+" "+e+")":e).trim()),t&&(n.filter=(n.filter?"("+n.filter+" "+r+" "+t+")":t).trim()),n}function io(e,t){var r={q:"",filter:""};return t.exact&&(_(["username","firstname","lastname","fullname","email"],["title","tags","typekeywords","type","name","owner"],["title","typekeywords","owner"]).includes(e)?r.filter=so("AND",e,t.exact):("string"==typeof t.exact&&(t.all||(t.all=[]),"string"==typeof t.all&&(t.all=[t.all]),t.all.push(t.exact)),Array.isArray(t.exact)&&(t.all||(t.all=[]),"string"==typeof t.all&&(t.all=[t.all]),t.all=t.all.concat(t.exact)))),t.any&&(r.q=so("OR",e,t.any)),t.all&&(r.q=(r.q?r.q+" AND ":"")+so("AND",e,t.all)),t.not&&(r.q=(r.q?r.q+" AND ":"")+so("OR","-"+e,t.not)),r}function ao(e,t){return{q:e+":["+t.from+" TO "+t.to+"]",filter:""}}function so(e,t,r){return Array.isArray(r)?"("+t+':"'+r.join('" '+e+" "+t+':"')+'")':t+':"'+r+'"'}function uo(e,t,r,n){var o=p(e);return e.authentication&&(o.authentication=ce.deserialize(e.authentication.serialize())),o.start=-1<t?t:r+1,function(e){return e&&(o.authentication=e),n(o)}}function co(e,t,r){var n=null;return t.thumbnail&&(n=e+"/community/groups/"+t.id+"/info/"+t.thumbnail,r&&"public"!==t.access&&(n=n+"?token="+r)),n}function lo(e,t,r){var n=null;return t.thumbnail&&(n=e+"/community/users/"+t.username+"/info/"+t.thumbnail,r&&"public"!==t.access&&(n=n+"?token="+r)),n}var po={$apps:[{type:{any:["Code Sample","Web Mapping Application","Mobile Application","Application","Desktop Application Template","Desktop Application","Operation View","Dashboard","Operations Dashboard Extension","Workforce Project","Insights Workbook","Insights Page","Insights Model","Hub Page","Hub Initiative","Hub Site Application","StoryMap","Web Experience","Web Experience Template","Form"],not:["Code Attachment","Featured Items","Symbol Set","Color Set","Windows Viewer Add In","Windows Viewer Configuration","Map Area","Indoors Map Configuration"]},typekeywords:{not:["MapAreaPackage","SMX"]}}],$storymap:[{type:"StoryMap"},{type:"Web Mapping Application",typekeywords:["Story Map"]}],$dashboard:[{type:"Dashboard",typekeywords:{any:["Dashboard"],not:["ArcGIS Operation View","Add In","Extension"]}}],$dataset:[],$experience:[{type:{any:["Web Experience"],not:["Web Experience Template"]}}],$site:[{type:["Hub Site Application","Site Application"]},{type:["Web Mapping Application"],typekeywords:["hubSite"]}],$initiative:[{type:{any:"Hub Initiative",not:"Hub Initiative Template"}}],$document:[{typekeywords:{any:"Document",not:["MapAreaPackage","SMX"]},type:{any:["Image","Layout","Desktop Style","Project Template","Report Template","Pro Report","Statistical Data Collection","360 VR Experience","netCDF","PDF","CSV","Administrative Report","Raster function template"],not:["Image Service","Explorer Document","Explorer Map","Globe Document","Scene Document","Code Attachment","Featured Items","Symbol Set","ColorSet","Windows Viewer Add In","Windows Viewer Configuration","Map Area","Indoors Map Configuration"]}}]};function fo(e){var t,o=[];return null!==(t=e.aggregations)&&void 0!==t&&t.counts&&e.aggregations.counts.forEach(function(r){var e={label:r.fieldName,attribute:r.fieldName,type:"multi-select"},n=[];r.fieldValues.forEach(function(e){var t={filterType:"content"};t[r.fieldName]=e.value;t={label:e.value,value:e.value,count:e.count,selected:!1,filter:t};n.push(t)}),e.options=n,o.push(e)}),o}function ho(e){var e=e.map(mo),n=["created","modified"],o=_(["filterType","subFilters","term"],n),e=e.reduce(function(r,e){return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r.hasOwnProperty(t)?o.includes(t)?n.includes(t)?r[t]=Zn(r[t],e):"term"===t?r[t]=r[t]+" "+e:"subFilters"===t&&(r[t]=_(r[t],e)):r[t]=eo(r[t],e):r[t]=p(e)}),r},{});return e.filterType="content",e}function mo(e){var t=go(e);return Array.isArray(e.subFilters)&&(t.subFilters=t.subFilters.reduce(function(e,t){return"string"==typeof t?po[t]&&(e=e.concat(po[t])):e.push(t),e},[])),bo(t)}function go(e){var r=p(e);return r.subFilters=r.subFilters||[],r.type&&(Array.isArray(r.type)?r.type=r.type.reduce(function(e,t){return yo(t)?r.subFilters=r.subFilters.concat(vo(t)):e.push(t),e},[]):yo(r.type)&&(e=r.type,r.subFilters=r.subFilters.concat(vo(e)),delete r.type)),r}function yo(e){var t=!1;return t="string"==typeof e?e in po:t}function vo(e){return po[e]}function bo(t){var r={};t.term&&(r.term=t.term);var e,n=["created","modified"],o=_(["filterType","subFilters","term"],n);return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r[t]=ro(e))}),t.subFilters&&Array.isArray(t.subFilters)&&(e=t.subFilters,r.subFilters=e.map(bo)),n.forEach(function(e){t[e]&&("relative-date"===t[e].type?r[e]=no(t[e]):r[e]=p(t[e]))}),r}function wo(e){var t,r=So(e);return e.subFilters&&(t=e.subFilters.reduce(function(e,t){return e="object"==typeof t?oo(e,So(t),"OR"):e},{q:"",filter:""}),r=oo(r,t,"AND")),e.term&&(r.q=(e.term+" "+r.q).trim()),r}function So(e){var r={q:"",filter:""},n=["created","modified"],o=_(["filterType","subFilters","term"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=oo(r,io(t,e),"AND")),n.includes(t)&&(r=oo(r,ao(t,e),"AND"))}),r}function ko(r){var n={},o=["created","modified"],i=_(["term","searchUserAccess"],o);return Object.entries(r).forEach(function(e){var t=e[0],e=e[1];i.includes(t)||S(t,ro(e),n),o.includes(t)&&(e=p(E(r,t)),"relative-date"===E(r,t+".type")?S(t,no(e),n):S(t,e,n))}),r.hasOwnProperty("searchUserAccess")&&(n.searchUserAccess=r.searchUserAccess),r.term&&(n.term=r.term),n}function Co(e){var r={q:"",filter:""},n=["created","modified"],o=_(["term","searchUserAccess","filterType"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=oo(r,io(t,e),"AND")),n.includes(t)&&(r=oo(r,ao(t,e),"AND"))}),e.hasOwnProperty("searchUserAccess")&&(r.searchUserAccess=e.searchUserAccess),e.term&&(r.q=(e.term+" "+r.q).trim()),r}function Ao(r){var n={},o=["created","modified","lastlogin"],i=_(["disabled","term"],o);return Object.entries(r).forEach(function(e){var t=e[0],e=e[1];i.includes(t)||S(t,ro(e),n),o.includes(t)&&(e=p(E(r,t)),"relative-date"===E(r,t+".type")?S(t,no(e),n):S(t,e,n))}),r.hasOwnProperty("disabled")&&(n.disabled=r.disabled),r.term&&(n.term=r.term),n}function To(e){var r={q:"",filter:""},n=["created","modified","lastlogin"],o=_(["term","filterType"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=oo(r,io(t,e),"AND")),n.includes(t)&&(r=oo(r,ao(t,e),"AND"))}),e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.term&&(r.q=("("+e.term+") "+r.q).trim()),r}function Po(o){var e,t,r=(null===(e=o.authentication)||void 0===e?void 0:e.portal)||o.portal;o.authentication&&(t=o.authentication.token);function i(e){return e.thumbnailUrl=Zt(e,r,t),e}return Oe(o).then(function(e){var t=-1<e.nextStart,r=e.results.map(vr),r=(r=o.site?r.map(function(e){return kr(e,o.site)}):r).map(i),n=fo(e);return{total:e.total,results:r,facets:n,hasNext:t,next:uo(o,e.nextStart,e.total,Po)}})}function xo(o){function i(e){return e.siteTeamUrl=o.site.item.url+"/teams/"+e.id+"/about",e}var e,t,r=(null===(e=o.authentication)||void 0===e?void 0:e.portal)||o.portal;o.authentication&&(t=o.authentication.token);function a(e){return e.thumbnailUrl=co(r,e,t),e}return Ee(o,"group").then(function(e){var t,r=-1<e.nextStart,n=e.results.map(a);return null!==(t=null===(t=o.site)||void 0===t?void 0:t.item)&&void 0!==t&&t.url&&(n=e.results.map(i)),{hasNext:r,total:e.total,results:n,next:uo(o,e.nextStart,e.total,xo)}})}function Io(o){function i(e){return e.profileUrl=o.site.item.url+"/people/"+e.username+"/profile",e}function a(e){return e.thumbnail&&(e.thumbnailUrl=lo(t,e,r)),e}var t=o.authentication.portal,r=o.authentication.token;return Ee(o,"user").then(function(e){var t,r=-1<e.nextStart,n=e.results.map(a);return null!==(t=null===(t=o.site)||void 0===t?void 0:t.item)&&void 0!==t&&t.url&&(n=e.results.map(i)),{hasNext:r,total:e.total,results:n,next:uo(o,e.nextStart,e.total,Io)}})}function Eo(t){return x(this,void 0,void 0,function(){return I(this,function(e){return 200<=t.status&&t.status<300?[2,t.json()]:[2,t.json().then(function(e){if(e.error)throw new Error(e.error.title+" :: "+e.error.detail+" :: "+t.status);throw new Error("Got "+t.status+" "+t.statusText)})]})})}function Oo(e){var t={},e=E(e,"authentication.token");return e&&(t.Authorization=e),t}function Do(e){return(e||"https://hub.arcgis.com")+"/api/v3/domains"}function _o(e,t){var r=e,n="hubsubdomain|"+(r=-1<e.indexOf("#/")?e.split("#/")[1]:r);return Oe(Object.assign({q:"typekeywords: "+n},t)).then(function(e){return e.results.filter(function(e){return T(e.typeKeywords,n)})[0]}).then(function(e){if(!e)throw new Error("site not found");return{hostname:e.url,siteId:e.id}})}function Uo(e,t){if(t.isPortal)throw new Error("domainExists is not available in ArcGIS Enterprise.");e=et(e);e=Do(t.hubApiUrl)+"/"+e,t=Oo(t);return fetch(e,{method:"GET",headers:t,mode:"cors"}).then(function(e){return 404!==e.status})}function jo(e,t){return _o(e,t).then(function(e){return!0}).catch(function(e){return!1})}function No(t,r,n,o){var i=t;return Uo((i=(o=void 0===o?0:o)?t+"-"+o:t)+"-"+r,n).then(function(e){return e?No(t,r,n,o+1):i})}function Ro(t,r,n){var o=(n=void 0===n?0:n)?t+"-"+n:t;return jo(o,r).then(function(e){return e?Ro(t,r,n+1):o})}function Mo(e,t){if(t.isPortal)return _o(e,t);e=Do(t.hubApiUrl)+"/"+e,t=Oo(t);return fetch(e,{method:"GET",headers:t,mode:"cors"}).then(Eo)}function qo(e,t){var r=p(e),e=63;return t&&(e-=t.length+1),r=r.length>e?r.slice(0,e-6)+"-"+M(5):r}function Fo(e,t){return Qr(e,t).then(Wo)}function Lo(e){if(1.4<=E(e,"item.properties.schemaVersion"))return e;var t=p(e),e=E(t,"data.values.gacode");return t.data.values.telemetry={consentNotice:{isTheme:!0,consentText:"",policyURL:""},customAnalytics:{ga:{customerTracker:{enabled:Boolean(e),id:e}}}},Jr(t,"data.values.gacode"),S("item.properties.schemaVersion",1.4,t),t}var Go=1.5;function Bo(e){if(1.5<=E(e,"item.properties.schemaVersion"))return e;var r,t=p(e),e=t.data.values.dcatConfig;return t.data.feeds={},e&&(t.data.feeds.dcatUS11=(r=JSON.stringify(e),Object.keys(Ho).forEach(function(e){var t=Ho[e];r=r.split(e).join(t)}),JSON.parse(r))),t.item.properties.schemaVersion=1.5,t}var Ho={"{{default.name}}":"{{name}}","{{default.description}}":"{{description}}","{{item.tags}}":"{{tags}}","{{item.created:toISO}}":"{{created:toISO}}","{{item.modified:toISO}}":"{{modified:toISO}}","{{default.source.source}}":"{{source}}","{{item.owner}}":"{{owner}}","{{org.portalProperties.links.contactUs.url}}":"{{orgContactEmail}}","{{org.name}}":"{{orgName}}","{{item.categories}}":"{{categories}}","{{item.licenseInfo}}":"{{licenseInfo}}","{{item.modified}}":"{{modified}}","{{enrichments.categories}}":"{{categories}}","{{default.id}}":"{{id}}","{{item.licenseInfo || No License}}":"{{licenseInfo || No License}}","{{org.portalProperties.links.contactUs.url || mailto:data@tempe.gov}}":"{{orgContactEmail || mailto:data@tempe.gov}}","{{default.description || No Description}}":"{{description || No Description}}","{{item.id}}":"{{id}}"};function Wo(e){return E(e,"item.properties.schemaVersion")===Go?e:e=Bo(e=Lo(e=function(e){if(1.3<=E(e,"item.properties.schemaVersion"))return e;var t=p(e),e=E(t,"data.catalog.groups")||[];return t.data.catalog.groups=e.filter(q),t.item.properties.schemaVersion=1.3,t}(e=function(e){if(1.2<=E(e,"item.properties.schemaVersion"))return e;var t=p(e),e=E(t,"data.catalog")||{};return E(t,"data.values.groups")&&(e.groups=p(t.data.values.groups),delete t.data.values.groups),t.data.catalog=e,t.item.properties.schemaVersion=1.2,t}(e=function(e){if(1.1<=E(e,"item.properties.schemaVersion"))return e;var t=p(e);return["subdomain","defaultHostname","internalUrl","customHostname","externalUrl"].forEach(function(e){t.data.values[e]&&"string"==typeof t.data.values[e]&&(t.data.values[e]=t.data.values[e].toLowerCase())}),t.item.properties.schemaVersion=1.1,t}(e=function(e){if(1<=E(e,"item.properties.schemaVersion"))return e;var t=p(e);return["groupId","title"].forEach(function(e){delete t.data.values[e]}),t.item.properties||(t.item.properties={}),t.item.properties.schemaVersion=1,t.data.values.groups&&Array.isArray(t.data.values.groups)&&(e=t.data.values.groups.map(function(e){return"object"==typeof e?e.id:e}).filter(function(e){return!!e}),t.data.values.groups=e),t}(e))))))}function Yo(e,t){return Ce(D({id:e,relationshipType:"Survey2Service",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function Ko(e,t){return Ce(D({id:e,relationshipType:"Service2Data",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function zo(e,t){return Ce(D({id:e,relationshipType:"Survey2Data",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function Vo(t){function e(e){return-1<t.typeKeywords.indexOf(e)}var r=e("FieldworkerView");return r=r||["Survey123","Feature Service","View Service"].every(e)&&!e("StakeholderView")}Jo.create=function(r){return x(this,void 0,void 0,function(){var t;return I(this,function(e){switch(e.label){case 0:return r.contextManager?[2,new Jo(r.contextManager)]:[3,1];case 1:return t=r.managerOptions||{},[4,gt.create(t)];case 2:return[2,new Jo(e.sent())]}})})},Object.defineProperty(Jo.prototype,"context",{get:function(){return this._contextManager.context},enumerable:!1,configurable:!0}),Object.defineProperty(Jo.prototype,"projects",{get:function(){return this._projectManager||(this._projectManager=Gn.init(this._contextManager)),this._projectManager},enumerable:!1,configurable:!0}),Pt=Jo;function Jo(e){this._contextManager=e}$o.prototype.startOperation=function(e){e=p(e);e.startedAt=(new Date).getTime(),e.state="working",this.operations.push(e)},$o.prototype.start=function(e,t){t={type:e,id:v(t,"id",r(e+"_")),inputs:v(t,"inputs",{}),cleanup:v(t,"cleanup","n/a"),startedAt:(new Date).getTime(),state:"working"};return this.operations.push(t),t.id},$o.prototype.getOperation=function(t){return this.operations.find(function(e){return e.id===t})},$o.prototype.getOperations=function(){return this.operations},$o.prototype.finish=function(e,t){var r=this.getOperation(e);if(!r)throw new Error("No operation with id "+e+" present in stack");r.duration=(new Date).getTime()-r.startedAt,r.state="completed",t&&(r.output=p(t))},$o.prototype.merge=function(e){this.operations=_(this.operations,e.operations)},$o.prototype.getCompleted=function(){return p(this.operations.filter(function(e){return"completed"===e.state}))},$o.prototype.getWorking=function(){return p(this.operations.filter(function(e){return"working"===e.state}))},$o.prototype.toString=function(){return this.operations.sort(function(e,t){return e.startedAt<t.startedAt?-1:t.startedAt<e.startedAt?1:0}).map(Qo).join("\n")},$o.prototype.serialize=function(){return{operations:p(this.getOperations())}},xt=$o;function $o(){this.operations=[]}function Qo(e){var t=e.startedAt+" : Operation "+e.id+" started with inputs "+JSON.stringify(e.inputs)+" but was not completed";return t="completed"===e.state?e.startedAt+" : Operation "+e.id+" took "+e.duration+" ms with inputs "+JSON.stringify(e.inputs)+" and output "+(e.output?JSON.stringify(e.output):"n/a"):t}var Xo,Zo=(e(ei,Xo=j),ei);function ei(e,t,r){var n=this;return t=t||"UNKNOWN_ERROR",r=v(r,"rootCause",r),(n=Xo.call(this,e,t,r)||this).name="HubError",n.stack=v(r,"stack",(new Error).stack),n}n.ArcGISContext=ht,n.ArcGISContextManager=gt,n.GLOBAL_EXTENT=jt,n.HUB_CDN_URLMAP=Qe,n.HUB_LOCALES=Vr,n.HUB_PROJECT_ITEM_TYPE=It,n.Hub=Pt,n.HubError=Zo,n.HubProjectManager=Gn,n.Logger=L,n.OperationError=j,n.OperationStack=xt,n.PORTAL_EXPORT_TYPES=Er,n.REQUIRED_PRIVS=fe,n.RemoteServerError=Wn,n.SEARCH_APIS=Qn,n.SITE_SCHEMA_VERSION=Go,n.STANDARD_LICENSES=Qt,n.WGS84_WKID=Ir,n._addTokenToResourceUrl=zn,n._canEmailUser=Rr,n._checkStatusAndParseJson=Eo,n._consolidateResults=jr,n._deepMapValues=i,n._ensureSafeDomainLength=qo,n._ensureTelemetry=Lo,n._formatAutoAddResponse=Nr,n._getAuthHeader=Oo,n._getAutoAddUsers=Yr,n._getDomainServiceUrl=Do,n._getEmailUsers=zr,n._getHttpAndHttpsUris=function(e){return e?["http://"+(e=e.replace(/^http(s?):\/\//,"")),"https://"+e]:[]},n._getInviteUsers=Kr,n._getLocation=function(){if(window)return window.location},n._isDate=s,n._isFunction=u,n._isObject=c,n._isOrgAdmin=Mr,n._isRegExp=l,n._isString=a,n._lookupPortal=_o,n._mapValues=o,n._processAutoAdd=Gr,n._processInvite=Hr,n._processPrimaryEmail=Wr,n._processSecondaryEmail=Fr,n._searchContent=function(o,i){var a;return x(this,void 0,void 0,function(){var t,r,n;return I(this,function(e){return t=mo(o),r=Xn(i.api||"arcgis"),[2,"arcgis"===r.type?(n=wo(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){i.hasOwnProperty(e)&&(n[e]=i[e])}),n.authentication||(n.portal=r.url+"/sharing/rest"),null!==(a=i.aggregations)&&void 0!==a&&a.length&&(n.countFields=i.aggregations.join(","),n.countSize=200),Po(n)):Promise.resolve({total:0,results:[],facets:[],hasNext:!1,next:function(){}})]})})},n._searchGroups=function(o,i){return x(this,void 0,void 0,function(){var t,r,n;return I(this,function(e){if(t=ko(o),"arcgis"===(r=Xn(i.api||"arcgis")).type)return n=Co(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){i.hasOwnProperty(e)&&(n[e]=i[e])}),n.authentication||(n.portal=r.url+"/sharing/rest"),[2,xo(n)];throw new Error("_searchGroups is not implemented for non-arcgis apis")})})},n._searchUsers=function(n,o){return x(this,void 0,void 0,function(){var t,r;return I(this,function(e){if(!o.authentication)throw new Error("Authentication required to search for users.");if(t=Ao(n),"arcgis"===Xn(o.api||"arcgis").type)return r=To(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){o.hasOwnProperty(e)&&(r[e]=o[e])}),[2,Io(r)];throw new Error("_searchUsers is not implemented for non-arcgis apis")})})},n._unprotectAndRemoveGroup=function(e){var t=R(qe,{success:!0}),r=R(Fe,{success:!0});return t(e).then(function(){return r(e)})},n._unprotectAndRemoveItem=function(e){var t=R(Ae,{success:!0}),r=R(Pe,{success:!0});return t(e).then(function(){return r(e)})},n.addContextToSlug=function(e,t){return/.+::.+/.test(e)?e:t+"::"+e},n.addDays=function(e,t){try{var r=new Date(e);return new Date(r.setDate(r.getDate()+t)).toISOString().split("T")[0]}catch(e){throw new Error("Invalid Date")}},n.addDomain=function(e,t){if(t.isPortal)throw new Error("addDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=Oo(t);r["Content-Type"]="application/json";var n=""+Do(t.hubApiUrl);return"number"==typeof(t=e.siteTitle)&&(e.siteTitle=t.toString()),fetch(n,{method:"POST",headers:r,mode:"cors",body:JSON.stringify(e)}).then(Eo)},n.addSolutionResourceUrlToAssets=function(e,t){var r,n,o=e.assets||e.resources||[];return e.bundleItemId&&(r=Ze(t.portalSelf)+"/content/items/"+e.bundleItemId,n=e.itemId,o=o.map(function(e){return{name:e.name,type:e.type||"resource",url:r+"/resources/"+n+"-"+e.name}})),o},n.addUsersToGroup=function(e,t,r,n,o){var i=p(v(r,"portalSelf.user",{}));return i.cOrgId=E(r,"portalSelf.portalProperties.hub.settings.communityOrg.orgId"),Gr({groupId:e,allUsers:t,primaryRO:r,email:n,secondaryRO:o,requestingUser:i,usersToAutoAdd:Yr(t,i),usersToInvite:Kr(t,i),usersToEmail:zr(t,i,E(n,"copyMe"))}).then(Hr).then(Wr).then(Fr).then(jr)},n.applyPropertiesToItems=function(e,t){return e.map(function(e){return e.properties||(e.properties={}),Object.assign(e.properties,t),e})},n.arrayToObject=function(e,r){return e.reduce(function(e,t){return e[E(t,r)]=t,e},{})},n.atob=xr.atob,n.autoAddUsers=Lr,n.bBoxToPolygon=qt,n.batch=A,n.btoa=xr.btoa,n.buildDraft=function(e,t){return w(e,{},t)},n.buildExistingExportsPortalQuery=function(e,t){var r,n,o,i,a=(c=function(e){if(e)return{onlyTypes:e.onlyTypes,layerId:e.layerId,spatialRefId:e.spatialRefId};return{}}(t)).onlyTypes,s=c.layerId,u=c.spatialRefId,t=Object.keys(Er).map(function(e){return Er[e]}),c=new Set(g(t.filter(function(e){return!e.supportsProjection}).map(function(e){return e.itemTypes}))),t=a||g(t.map(function(e){return e.itemTypes})),s=(new xe).startGroup().match(_r(e)).in("typekeywords").and().match(Ur(s)).in("typekeywords").endGroup().and().startGroup();function l(e,t){var r;t.startGroup().match(/\s/g.test(e)?e:'"'+e+'"').in("type").and().match(Dr((r=e,t=Ir,t=(e=i)&&!o.has(r)?e:t))).in("typekeywords").endGroup()}return r=s,n=(c={types:t,spatialRefId:u,noProjectionItemTypes:c}).types,o=c.noProjectionItemTypes,i=c.spatialRefId,n.forEach(function(e,t){l(e,r),t<n.length-1&&r.or()}),s.endGroup(),s.toParam()},n.buildUrl=he,n.camelize=h,n.canEditEvent=function(e,t){var r=!1;return pe(t)&&(e=E(e,"initiative.item.properties.collaborationGroupId"),t=t.groups,r=!!e&&!!d(void 0===t?[]:t,"id",e)),r},n.canEditItem=de,n.canEditSite=function(e,t){var r=!1;return r=!E(e,"properties.isDefaultHubHome")&&pe(t)?de(e,t):r},n.canEditSiteContent=function(e,t){var r,n=!1,o=E(e,"properties.isDefaultHubHome"),i=pe(t);return!o&&i?n=de(e,t):i&&(i=t.orgId,e=e.orgId,i&&i===e&&(r=t.privileges||[],n=fe.every(function(e){return T(r,e)}))),n},n.capitalize=t,n.categories=Dt,n.chunkArray=function(e,t){for(var r=[],n=0;n<e.length;)r.push(e.slice(n,n+t)),n+=t;return r},n.clearSession=function(e,t){(t=void 0===t?window:t).localStorage&&t.localStorage.removeItem("__CONTEXT_"+e)},n.cloneObject=p,n.completeOAuth2=function(t,e){var r=(e=(e=void 0===e?window:e).location.href.match(/access_token=(.+)&expires_in=.+&username=([^&]+)/))[1],n="https://www.arcgis.com/sharing/rest/community/users/"+decodeURIComponent(e[2]);return Z(n,{params:{token:r},httpMethod:"GET"}).then(function(e){return Date.now()-e.created<5e3?Z(n+"/update",{params:{token:r,tags:["hubRole:participant","org:"+e.orgId],access:"public"}}).then(function(){return ce.completeOAuth2(t)}):ce.completeOAuth2(t)})},n.compose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(r,n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(n.apply(void 0,e))}})},n.composeContent=fr,n.constructSlug=kn,n.convertContentDefinitionToFilter=bo,n.convertContentFilterToSearchOptions=So,n.convertPortalResponseToFacets=fo,n.convertSolutionTemplateResourcesToAssets=function(e,t){var r,n,o=[];return e.resources&&e.bundleItemId&&(r=Ze(t.portalSelf)+"/content/items/"+e.bundleItemId,n=e.itemId,o=e.resources.map(function(e){return{name:e,type:"resource",url:r+"/resources/"+n+"-"+e}})),o},n.convertToWellKnownLocale=function(e){var t="en";return e=(e=void 0===e?"en":e).toLowerCase(),-1<Vr.indexOf(e)?t=e:1<(e=e.split("-")).length&&-1<Vr.indexOf(e[0])&&(t=e[0]),t},n.convertUrlsToAnchorTags=function(t){var e=t.match(/((((ftp|https?):\/\/)|(w{3}\.))[-\w@:%_+.~#?,&//=]+)/g);return e&&e.forEach(function(e){t=t.replace(e,'<a target="_blank" href="'+e+'">'+e+"</a>")}),t.replace("(","<br/>(")},n.createExtent=function(e,t,r,n,o){return{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:{wkid:o=void 0===o?4326:o}}},n.createId=r,n.createModel=Zr,n.createOperationPipeline=function(e){return function(r){return e.reduce(function(e,t){return e.then(t).catch(function(e){if("OperationError"===e.name)return Promise.reject(e);e="IPipeableFn did not reject with an OperationError \n Operation Stack: \n "+r.stack.toString(),e=new j("pipeline execution error",e);return e.operationStack=r.stack.serialize(),Promise.reject(e)})},Promise.resolve(r))}},n.createProject=Nn,n.dasherize=function(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase().replace(/[ _]/g,"-")},n.datasetToContent=function(e){var t=br(e),r=e.attributes,n=r.errors,o=r.boundary,i=r.metadata,a=r.slug,s=r.groupIds,u=r.orgId,c=r.orgName,l=r.organization,p=r.orgExtent,d=r.server,f=r.layers,h=r.layer,m=r.recordCount,g=r.statistics,e=r.extent;return r.itemExtent,r=r.searchDescription,h=h&&h.id,g=fr(t,{layerId:h,slug:a,errors:n,metadata:i||null,groupIds:s,org:u&&{id:u,name:c||l,extent:p},server:d,layers:f,recordCount:m,boundary:o,statistics:g}),r&&(g.summary=r),!Rt(t.extent)&&e&&Rt(e.coordinates)&&(g.extent=e.coordinates),g},n.datasetToItem=br,n.deepFind=k,n.deepFindById=function(e,t){return k(e,function(e){return e.id===t})},n.deepSet=y,n.deepStringReplace=b,n.deleteProp=Jr,n.destroyProject=qn,n.doesItemExistWithTitle=Sn,n.domainExists=Uo,n.domainExistsPortal=jo,n.emailOrgUsers=qr,n.ensureProp=function(e,t){return y(e,t)},n.ensureUniqueDomainName=function(e,t){return(t.isPortal?Ro(e,t):No(e,t.portalSelf.urlKey+"."+et(lt(t)),t)).then(function(e){return qo(e,t.portalSelf.urlKey)})},n.ensureUniqueString=function(e,t){for(var r=!1,n=0,o=t;!r;)T(e,o)?o=t+"-"+ ++n:r=!0;return o},n.expandApi=Xn,n.expandApis=function(e){return e.map(Xn)},n.expandContentFilter=mo,n.expandGroupFilter=ko,n.expandTypeField=go,n.expandUserFilter=Ao,n.extend=function n(e,o,i){void 0===i&&(i=!0);e=p(e);return Object.keys(o).reduce(function(e,t){var r;return null!==o[t]&&void 0!==o[t]&&(r=p(o[t]),Array.isArray(r)?e[t]=r:e[t]=i&&"object"==typeof r?n(e[t]||{},r,i):r),e},e)},n.extentToBBox=Ut,n.failSafe=R,n.failSafeUpdate=function(e,t){return R(ve,{id:e.item.id,success:!0})(Object.assign({item:$r(e)},t))},n.fetchAllPages=function(n,o,r,i){var a=o.num||100,e=o.start||1;return(-1===(r=void 0===r?-1:r)?n(D(D({},o),{num:a,start:e})):Promise.resolve({nextStart:e,total:r,results:[],num:a})).then(function(t){if(-1===t.nextStart)return[t];for(var e=[],r=t.nextStart;r<=t.total;r+=a)e.push(r);return A(e,function(e){return n(D(D({},o),{start:e,num:a}))},i).then(function(e){return _([t],e)})}).then(function(e){var t=e.reduce(function(e,t){return _(e,t.results)},[]),e=-1===r?t.length:r;return t.slice(0,e)})},n.fetchAndUploadResource=Jn,n.fetchAndUploadThumbnail=$n,n.fetchHubTranslation=function(t,e,r){void 0===r&&(r="cors");var n=(Xe(e)+"/locales/"+t+".json").toLocaleLowerCase();return fetch(n,{method:"GET",credentials:"same-origin",mode:r}).then(function(e){return e.json()}).catch(function(e){throw Error("Attempt to fetch locale "+t+" from "+n+" failed: "+JSON.stringify(e))})},n.fetchImageAsBlob=Vn,n.fetchModelFromItem=tn,n.fetchProject=Mn,n.fetchSite=function(e,t){return q(e)?Fo(e,t):Mo(et(e).split("/")[0],t).then(function(e){return Fo(e.siteId,t)})},n.filterBy=function(e,t,r){return e.filter(function(e){return E(e,t)===r})},n.findBy=d,n.findItemsBySlug=Tn,n.flattenArray=g,n.generateRandomString=M,n.getCategory=hr,n.getContentIdentifier=mr,n.getContentSiteUrls=wr,n.getContentTypeIcon=or,n.getContentTypeLabel=Sr,n.getCulture=function(e){return E(e,"portalSelf.user.culture")||E(e,"portalSelf.culture")||"en-us"},n.getDomainsForSite=function(e,t){return t.isPortal?Promise.resolve([]):(e=Do(t.hubApiUrl)+"?siteId="+e,t=Oo(t),fetch(e,{method:"GET",headers:t,mode:"cors"}).then(Eo).catch(function(e){throw Error("Error in getDomainsForSite "+e)}))},n.getExportItemTypeKeyword=_r,n.getExportLayerTypeKeyword=Ur,n.getFamily=Gt,n.getGeographicOrgExtent=Nt,n.getGroupThumbnailUrl=co,n.getHubApiFromPortalUrl=at,n.getHubApiUrl=lt,n.getHubApiUrlFromPortal=function(e){return rt(e)+"/api/v3"},n.getHubLocaleAssetUrl=Xe,n.getHubProduct=function(e){var t=E(e,"portalProperties.hub.enabled")||!1?"premium":"basic";return t=e.isPortal&&"singletenant"===e.portalMode?"portal":t},n.getHubUrlFromPortal=rt,n.getInputFeatureServiceModel=Yo,n.getItemApiUrl=it,n.getItemAssets=function(e,t){var r=Ze(t.portalSelf)+"/content/items/"+e.id,n=Zt(e,t),o=[];return n&&o.push({name:e.thumbnail,url:n,type:"thumbnail"}),e=e.id,e=Se(e,t=t)+"/resources",(t=D({},t)).params=D({num:1e3},t.params),Z(e,t).then(function(e){e=e.resources.map(function(e){return{name:e.resource,type:"resource",url:r+"/resources/"+e.resource}});return o.concat(e)})},n.getItemBySlug=An,n.getItemDataUrl=ot,n.getItemHomeUrl=nt,n.getItemHubId=pr,n.getItemHubType=function(e){return console.warn("DEPRECATED: Use getFamily() instead. getItemHubType() will be removed at v10.0.0"),e=cr(e="string"==typeof e?{type:e}:e),vt(e)},n.getItemLayerId=lr,n.getItemThumbnailUrl=Zt,n.getLayerIdFromUrl=ur,n.getModel=Qr,n.getModelBySlug=Xr,n.getModelFromOptions=function(e,t){var r=e+"Model",e=e+"Id";if(t[r])return Promise.resolve(t[r]);if(t[e])return R(Qr,{item:{id:t[e]},isMissing:!0})(t[e],t);throw new Error("getModelFromOptions requires either a ."+r+" or ."+e+" property.")},n.getNextFunction=uo,n.getOrgExtentAsBBox=function(e){return Nt(e).then(Ut)},n.getPortalApiUrl=Ze,n.getPortalBaseFromOrgUrl=st,n.getPortalUrl=$e,n.getPortalUrls=ir,n.getProp=E,n.getProps=function(r,e){return e.reduce(function(e,t){t=E(r,t);return t&&e.push(t),e},[])},n.getProxyUrl=ar,n.getServiceTypeFromUrl=ct,n.getSession=function(e,t){var r=null;return!(t=void 0===t?window:t).localStorage||(e=t.localStorage.getItem("__CONTEXT_"+e))&&(r=ce.deserialize(e)),r},n.getSiteById=Fo,n.getSourceFeatureServiceModelFromFieldworker=Ko,n.getSpatialRefTypeKeyword=Dr,n.getStakeholderModel=zo,n.getStructuredLicense=Xt,n.getSubscriptionType=function(e){return v(e,"subscriptionInfo.type","Enterprise")},n.getSurveyModels=function(e,r){var n,o;return("string"==typeof e?we(e,r):Promise.resolve(e)).then(function(t){var e=[Yo(t.id,r),zo(t.id,r)];return Promise.all(e).then(function(e){var t=e[0],e=e[1];return o=e,t&&Vo(t.item)?Ko((n=t).item.id,r):t}).then(function(e){return{form:{item:t},featureService:e,fieldworker:n,stakeholder:o}})})},n.getTypeCategories=function(e){if(e=hr(cr(e=void 0===e?{}:e))){e=Array.from(e);return e[0]=e[0].toUpperCase(),[e.join("")]}return["Other"]},n.getTypes=function(e){return Dt[(e=void 0===e?"":e).toLowerCase()]},n.getUniqueDomainName=No,n.getUniqueDomainNamePortal=Ro,n.getUniqueItemTitle=function t(r,n,o,i){var a=(i=void 0===i?0:i)?r+" "+i:r;return Sn(a,n,o).then(function(e){return e?t(r,n,o,++i):a}).catch(function(e){throw Error("Error in getUniqueItemTitle "+e)})},n.getUniqueSlug=Pn,n.getUserThumbnailUrl=lo,n.getWithDefault=v,n.hasBasePriv=pe,n.hubApiRequest=Kn,n.hubApiSearch=function(e){var t=(t=e.authentication)&&t.serialize&&{authentication:t.serialize()};return Kn("/search",D(D({},{headers:t,httpMethod:"POST"}),e))},n.includes=T,n.incrementString=function(e){var t=e.match(/-\s(\d+$)/);return t?(t=parseInt(t[1],10),e=e.replace("- "+t,"- "+(t+1))):e+=" - 1",e},n.interpolate=wn,n.interpolateItemId=function(e){return wn(e,{item:{id:e.item.id},appid:e.item.id},{toISO:function(e,t){return t}})},n.inviteUsers=Br,n.isBBox=Rt,n.isDomainForLegacySite=function(e){return!q(e.siteId)},n.isDomainUsedElsewhere=function(e,t,r){return Mo(e,r).then(function(e){return e.siteId!==t}).catch(function(){return!1})},n.isDownloadable=_t,n.isExtentCoordinateArray=Mt,n.isFeatureService=sr,n.isFieldworkerView=Vo,n.isGuid=q,n.isMapOrFeatureServerUrl=function(e){return ut.test(e)},n.isNil=O,n.isSlug=function(e){return!(!(e=gr(e).itemId)||q(e))},n.isUpdateGroup=B,n.isValidDomain=function(t,e){if(e.isPortal)throw new Error("isValidDomain is not available in ArcGIS Enterprise.");var r=Do(e.hubApiUrl)+"/validate?hostname="+t,e=Oo(e);return fetch(r,{method:"GET",headers:e,mode:"cors"}).then(function(e){return e.json()}).catch(function(e){return{success:!1,input:t,error:{code:400,detail:e,message:"lookupFailed"}}})},n.isValidExtent=function(t){return!!t&&[Mt,function(t){return["xmin","ymin","xmax","ymax"].every(function(e){return"number"==typeof t[e]})}].some(function(e){return e(t)})},n.itemPropsNotInTemplates=xn,n.itemToContent=vr,n.last=function(e){return e[e.length-1]},n.lookupDomain=Mo,n.mapBy=function(t,e){return(e=void 0===e?[]:e).map(function(e){return e[t]})},n.maybeAdd=function(e,t,r){return null!=t&&((r=p(r))[e]=t),r},n.maybePush=f,n.mergeContentFilter=ho,n.mergeDateRange=Zn,n.mergeGroupFilters=function(e){var e=e.map(ko),o=["created","modified"],i=_(["filterType","term"],o);return e.reduce(function(n,e){return Object.entries(e).forEach(function(e){var t=e[0],r=e[1];n.hasOwnProperty(t)?(e=E(n,t),i.includes(t)?o.includes(t)?S(t,Zn(e,r),n):"term"===t&&(n[t]=n[t]+" "+r):S(t,eo(e,r),n)):S(t,p(r),n)}),n},{filterType:"group"})},n.mergeMatchOptions=eo,n.mergeObjects=w,n.mergeSearchOptions=oo,n.mergeUserFilters=function(e){var e=e.map(Ao),o=["created","modified","lastlogin"],i=_(["disabled","term","filterType"],o);return e.reduce(function(n,e){return Object.entries(e).forEach(function(e){var t=e[0],r=e[1];n.hasOwnProperty(t)?(e=E(n,t),i.includes(t)?o.includes(t)?S(t,Zn(e,r),n):"term"===t&&(n[t]=n[t]+" "+r):S(t,eo(e,r),n)):S(t,p(r),n)}),n},{filterType:"user"})},n.normalizeItemType=cr,n.normalizeSolutionTemplateItem=function(e){var t=p(e);return xn.forEach(function(e){delete t[e]}),t.extent="{{organization.defaultExtentBBox}}",t},n.objectToArray=function(r,n){return void 0===n&&(n="id"),Object.keys(r).reduce(function(e,t){return r[t][n]=t,e.push(p(r[t])),e},[])},n.objectToJsonBlob=function(e){if("undefined"!=typeof Blob)return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")},n.parseDatasetId=gr,n.parseItemCategories=dr,n.processRevertableTasks=function(e){return Promise.all(e).then(function(e){function t(e){return"fullfilled"===e.status}var r=e.filter(t),n=e.filter(function(e){return!t(e)});if(n.length){e=r.map(function(e){return e.revert()});throw Promise.all(e).catch(function(){}),n[0].error}return r.map(function(e){return e.results})})},n.propifyString=function(e){return h(e.replace(/^[0-9]*/g,"").replace(/[^\w\s]/g,""))},n.relativeDateToDateRange=no,n.removeContextFromSlug=yr,n.removeDomain=function(e,t){if(t.isPortal)throw new Error("removeDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=Oo(t);return r["Content-Type"]="application/json",e=Do(t.hubApiUrl)+"/"+e,fetch(e,{method:"DELETE",headers:r,mode:"cors"}).then(Eo)},n.removeDomainsBySiteId=function(e,t){if(t.isPortal)throw new Error("removeDomainsBySiteId is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=Oo(t);return r["Content-Type"]="application/json",e=Do(t.hubApiUrl)+"/?siteId="+e,fetch(e,{method:"DELETE",headers:r,mode:"cors"}).then(Eo)},n.removeEmptyProps=function t(r){return Object.keys(r).forEach(function(e){r[e]&&"object"==typeof r[e]?t(r[e]):null==r[e]&&delete r[e]}),r},n.replaceItemId=function(e,t,r){return void 0===r&&(r="{{appid}}"),b(p(e),new RegExp(t,"g"),r)},n.runRevertableTask=function(e,t){return e().then(function(e){return{status:"fullfilled",results:e,revert:t}}).catch(function(e){return{status:"rejected",error:e}})},n.saveSession=function(e,t,r){(r=void 0===r?window:r).localStorage&&r.localStorage.setItem("__CONTEXT_"+e,t.serialize())},n.searchProjects=Fn,n.serializeContentFilterForPortal=wo,n.serializeDateRange=ao,n.serializeGroupFilterForPortal=Co,n.serializeMatchOptions=io,n.serializeModel=$r,n.serializeSpatialReference=Or,n.serializeStringOrArray=so,n.serializeUserFilterForPortal=To,n.setContentHubId=function(e,t){var r=e.id,r=e.slug||t||r,r=D(D({},e),{hubId:t,identifier:r});return Cr(r,{relative:Ar(r)})},n.setContentSiteUrls=kr,n.setContentType=function(e,t){var r=cr(D(D({},e.item),{type:t})),n=Gt(r),o=or(r),t=Sr(r,e.isProxied),t=D(D({},e),{type:r,family:n,normalizedType:r,contentTypeIcon:o,contentTypeLabel:t});return Cr(t,{relative:Ar(t)})},n.setItemThumbnail=In,n.setProp=S,n.setSlugKeyword=Cn,n.shareItemToGroups=function(t,e,r,n){return Promise.all(e.map(function(e){e=Object.assign({},{id:t,groupId:e},r);return n&&(e.owner=n),Ye(e)}))},n.slugify=F,n.stringToBlob=function(e,t){if(void 0===t&&(t="application/octet-stream"),"undefined"==typeof Blob)throw new Error("stringToBlob is not currently supported on Node");for(var r=[],n=0;n<e.length;n++)r[n]=e.charCodeAt(n);var o=new Uint8Array(r);return new Blob([o],{type:t})},n.stripProtocol=et,n.unique=m,n.uniqueBy=function(e,r){return e.reduce(function(e,t){return f(e.find(function(e){return E(e,r)===E(t,r)})?null:t,e)},[])},n.unprotectModel=function(e,t){return e.item.protected?Ae(Object.assign({id:e.item.id},t)):Promise.resolve({success:!0})},n.unshareItemFromGroups=function(t,e,r,n){return Promise.all(e.map(function(e){e=Object.assign({},{id:t,groupId:e},r);return n&&(e.owner=n),Ve(e)}))},n.updateDomain=function(e,t){if(t.isPortal)throw new Error("updateDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=Oo(t);r["Content-Type"]="application/json";var n=Do(t.hubApiUrl)+"/"+e.id;return"number"==typeof(t=e.siteTitle)&&(e.siteTitle=t.toString()),fetch(n,{method:"PUT",headers:r,mode:"cors",body:JSON.stringify(e)}).then(Eo)},n.updateModel=en,n.updateProject=Rn,n.upgradeProtocol=function(e){return-1===e.indexOf("http")?"https://"+e:-1!==e.indexOf("http://")?e.replace(/^http:/i,"https:"):e},n.upgradeSiteSchema=Wo,n.uploadResourcesFromUrl=function(n,e,o){if(Array.isArray(e)){e=e.reduce(function(e,t){var r;return t.url&&(r={id:n.item.id,owner:n.item.owner,fileName:t.name,url:zn(t.url,o),authentication:o.authentication},"thumbnail"===t.type?e.push($n(r)):e.push(Jn(r))),e},[]);return Promise.all(e)}return Promise.resolve([])},n.valueToMatchOptions=ro,n.without=function(e,t){return e.filter(function(e){return e!==t})},n.withoutByProp=function(t,r,e){return e.filter(function(e){return e[t]!==r})},Object.defineProperty(n,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisHub=e.arcgisHub||{})}(this,function(n){"use strict";function o(r,n){return Object.keys(r).reduce(function(e,t){return e[t]=n(r[t],t,r),e},{})}function i(e,r,n){return n=n||"",Array.isArray(e)?e.map(t):!e||!c(e)||s(e)||l(e)||u(e)?r(e,n):Object.assign({},e,o(e,t));function t(e,t){return i(e,r,""+(n?n+"."+t:t))}}function a(e){return"string"==typeof e||e instanceof String}function s(e){return e instanceof Date}function u(e){return"function"==typeof e}function c(e){return"object"==typeof e}function l(e){return e instanceof RegExp}function O(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:void 0},e)}function p(e){var t,r={};if(Array.isArray(e))r=e.map(p);else if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(null!=(t=e[n])&&"object"==typeof t?t instanceof Date?r[n]=new Date(t.getTime()):r[n]=p(t):r[n]=t);else r=e;return r}function d(e,r,n){return e?e.reduce(function(e,t){return e=O(t,r)===n?t:e},null):null}function r(e){return""+(e=void 0===e?"i":e)+Math.random().toString(36).substr(2,8)}function f(e,t){return null!=e&&(t=p(t)).push(e),t}function h(e){return(e=(e=e.toLowerCase()).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi," ")).replace(/(\-|\_|\.|\s)+(.)?/g,function(e,t,r){return r?r.toUpperCase():""}).replace(/(^|\/)([A-Z])/g,function(e,t,r){return e.toLowerCase()})}function m(e,t,r){return r.indexOf(e)===t}function P(e){return null==e}function t(e){return(e=Array.from(e))[0]=e[0].toUpperCase(),e.join("")}function g(e){return e.reduce(function(e,t){return e.concat(t)},[])}function b(e,t,r){void 0===r&&(r={});var t=t.split("."),n=e,o=t.length-1;t.forEach(function(e,t){n.hasOwnProperty(e)&&null!=n[e]?t===o&&("object"!=typeof n[e]||Array.isArray(n[e])?n[e]=r:n[e]=Object.assign(n[e],p(r))):n[e]=t===o?r:{},n=n[e]})}function y(e,t,r){t=O(e,t);return void 0!==t?t:r}function v(e,r,n){return i(e,function(e){if(!a(e))return e;var t=l(r)?r:new RegExp(r,"g");return e.replace(t,n)})}function w(t,r,e){return Array.isArray(e)&&e.length?(e.forEach(function(e){void 0!==O(t,e)&&b(r,e,O(t,e))}),r):t}function A(e,t,r){b(r,e=Array.isArray(e)?e.join("."):e,t)}function D(r,n){return Array.isArray(r)?r.reduce(function(e,t){return n(t)?e=t:!S(t)||(t=D(t,n))&&(e=t),e},void 0):S(r)?n(r)?r:Object.keys(r).reduce(function(e,t){return!S(r[t])||(t=D(r[t],n))&&(e=t),e},void 0):void 0}function S(e){var t=!1;return t=e&&c(e)&&!s(e)&&!l(e)&&!u(e)?!0:t}function x(e,n,o){void 0===o&&(o=5);return e.reduce(function(e,t){var r=e[e.length-1];return r&&r.length!==o||e.push(r=[]),r.push(t),e},[]).reduce(function(e,r){return e.then(function(t){var e=r.map(function(e){return n(e)});return Promise.all(e).then(function(e){return t.concat(e)})})},Promise.resolve([]))}function E(e,t){return-1!==e.indexOf(t)}var k=function(e,t){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function e(e,t){function r(){this.constructor=e}k(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var U=function(){return(U=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function C(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function T(e,a,s,u){return new(s=s||Promise)(function(r,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function o(e){try{i(u.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(n,o)}i((u=u.apply(e,a||[])).next())})}function q(r,n){var o,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(r,s)}catch(e){t=[6,e],i=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function I(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}var N,R=(e(F,N=Error),F);function F(e,t,r){var n=this;return t=t||"UNKNOWN_ERROR",r=y(r,"rootCause",r),(n=N.call(this,t)||this).operation=e,n.name="OperationError",n.rootCause=r,Object.setPrototypeOf(n,F.prototype),n.stack=y(r,"stack",(new Error).stack),n}function L(e){return function(r){return e.reduce(function(e,t){return e.then(t).catch(function(e){if("OperationError"===e.name)return Promise.reject(e);e="IPipeableFn did not reject with an OperationError \n Operation Stack: \n "+r.stack.toString(),e=new R("pipeline execution error",e);return e.operationStack=r.stack.serialize(),Promise.reject(e)})},Promise.resolve(r))}}function _(r,n){return void 0===n&&(n={}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.apply(void 0,e).catch(function(e){return n})}}function j(e){var r=(new Date).getTime();return Array(e).fill(0).reduce(function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),e=""+e+t.toString(16)},"")}function B(e){"{"===e[0]&&(e=e.substring(1,e.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{4}[-]?[0-9a-fA-F]{12}(\}){0,1}$/gi.test(e)}function M(e){return"string"==typeof e?e.trim().toLowerCase().replace(/ +/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-"):e}n.Level=void 0,(Ut=n.Level||(n.Level={}))[Ut.all=0]="all",Ut[Ut.debug=1]="debug",Ut[Ut.info=2]="info",Ut[Ut.warn=3]="warn",Ut[Ut.error=4]="error",Ut[Ut.off=5]="off";var G=(V.setLogLevel=function(e){this.logLevel=e},V.log=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.debug)&&console.log.apply(console,I([e],t))},V.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.debug)&&console.debug.apply(console,I([e],t))},V.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.info)&&console.info.apply(console,I([e],t))},V.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.warn)&&console.warn.apply(console,I([e],t))},V.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLevelPermitted(n.Level.error)&&console.error.apply(console,I([e],t))},V.isLevelPermitted=function(e){return this.logLevel<=e},V.logLevel=n.Level.off,V);function V(){}function H(e){return e.capabilities.includes("updateitemcontrol")}function z(t){return Object.keys(t).some(function(e){e=t[e];if(!e)return!1;switch((e=e&&e.toParam?e.toParam():e).constructor.name){case"Array":case"Object":case"Date":case"Function":case"Boolean":case"String":case"Number":return!1;default:return!0}})}function Y(o){var i={};return Object.keys(o).forEach(function(e){var t=o[e];if((t=t&&t.toParam?t.toParam():t)||0===t||"boolean"==typeof t||"string"==typeof t){switch(t.constructor.name){case"Array":var r=null===(r=null===(r=t[0])||void 0===r?void 0:r.constructor)||void 0===r?void 0:r.name,n="Array"===r?t:"Object"===r?JSON.stringify(t):t.join(",");break;case"Object":n=JSON.stringify(t);break;case"Date":n=t.valueOf();break;case"Function":n=null;break;case"Boolean":n=t+"";break;default:n=t}(n||0===n||"string"==typeof n||Array.isArray(n))&&(i[e]=n)}}),i}function W(e){var t=Y(e);return Object.keys(t).map(function(e){return function t(r,e){return Array.isArray(e)&&e[0]&&Array.isArray(e[0])?e.map(function(e){return t(r,e)}).join("&"):encodeURIComponent(r)+"="+encodeURIComponent(e)}(e,t[e])}).join("&")}var K=function(e,t,r,n,o){e=e||"UNKNOWN_ERROR",t=t||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message="UNKNOWN_ERROR_CODE"===t?e:t+": "+e,this.originalMessage=e,this.code=t,this.response=r,this.url=n,this.options=o};function J(e){console&&console.warn&&console.warn.apply(console,[e])}K.prototype=Object.create(Error.prototype),K.prototype.constructor=K;var Z,Q="@esri/arcgis-rest-js",$={httpMethod:"POST",params:{f:"json"}},X=(e(ee,Z=K),ee.prototype.retry=function(e,n){var o=this;void 0===n&&(n=3);var i=0,a=function(t,r){e(o.url,o.options).then(function(e){e=U(U({},o.options),{authentication:e});return i+=1,te(o.url,e)}).then(function(e){t(e)}).catch(function(e){"ArcGISAuthError"===e.name&&i<n?a(t,r):"ArcGISAuthError"===e.name&&n<=i?r(o):r(e)})};return new Promise(function(e,t){a(e,t)})},ee);function ee(e,t,r,n,o){o=Z.call(this,e=void 0===e?"AUTHENTICATION_ERROR":e,t=void 0===t?"AUTHENTICATION_ERROR_CODE":t,r,n,o)||this;return o.name="ArcGISAuthError",o.message="AUTHENTICATION_ERROR_CODE"===t?e:t+": "+e,o}function te(n,e){void 0===e&&(e={params:{f:"json"}});var o=U(U(U({httpMethod:"POST"},$),e),{params:U(U({},$.params),e.params),headers:U(U({},$.headers),e.headers)}),t=[],e=[];if(o.fetch||"undefined"==typeof fetch?(t.push("`fetch`"),e.push("`node-fetch`")):o.fetch=fetch.bind(Function("return this")()),"undefined"==typeof Promise&&(t.push("`Promise`"),e.push("`es6-promise`")),"undefined"==typeof FormData&&(t.push("`FormData`"),e.push("`isomorphic-form-data`")),!o.fetch||"undefined"==typeof Promise||"undefined"==typeof FormData)throw new Error("`arcgis-rest-request` requires a `fetch` implementation and global variables for `Promise` and `FormData` to be present in the global scope. You are missing "+t.join(", ")+". We recommend installing the "+e.join(", ")+" modules at the root of your application to add these to the global scope. See https://bit.ly/2KNwWaJ for more info.");var e=o.httpMethod,i=o.authentication,a=o.rawResponse,s=U({f:"json"},o.params),r=null,u={method:e,credentials:o.credentials||"same-origin"};return o.headers&&o.headers["X-Esri-Auth-Client-Id"]&&-1<n.indexOf("/oauth2/platformSelf")&&(u.credentials="include"),(i?i.getToken(n,{fetch:o.fetch}).catch(function(e){return e.url=n,e.options=o,r=e,Promise.resolve("")}):Promise.resolve("")).then(function(e){e.length&&(s.token=e),i&&i.getDomainCredentials&&(u.credentials=i.getDomainCredentials(n));var t={};"GET"===u.method&&(s.token&&o.hideToken&&"undefined"==typeof window&&(t["X-Esri-Authorization"]="Bearer "+s.token,delete s.token),r=""===W(s)?n:n+"?"+W(s),o.maxUrlLength&&r.length>o.maxUrlLength||s.token&&o.hideToken?(u.method="POST",e.length&&o.hideToken&&(s.token=e,delete t["X-Esri-Authorization"])):n=r);var r=new RegExp("/items/.+/updateResources").test(n);return"POST"===u.method&&(u.body=function(e,t){var t=z(e)||t,r=Y(e);if(t){var n=new FormData;return Object.keys(r).forEach(function(e){var t;"undefined"!=typeof Blob&&r[e]instanceof Blob?(t=r.fileName||r[e].name||e,n.append(e,r[e],t)):n.append(e,r[e])}),n}return W(e)}(s,r)),u.headers=U(U({},t),o.headers),"undefined"!=typeof window||u.headers.referer||(u.headers.referer=Q),z(s)||r||(u.headers["Content-Type"]="application/x-www-form-urlencoded"),o.fetch(n,u)}).then(function(e){if(!e.ok){var t=e.status,r=e.statusText;throw new K(r,"HTTP "+t,e,n,o)}if(a)return e;switch(s.f){case"json":case"geojson":return e.json();case"html":case"text":return e.text();default:return e.blob()}}).then(function(e){if("json"!==s.f&&"geojson"!==s.f||a)return e;var t=function(t,e,r,n){if(400<=t.code){var o=t.message,i=t.code;throw new K(o,i,t,e,r)}if(t.error){var a=t.error,o=a.message,i=a.code,s=a.messageCode,a=s||i||"UNKNOWN_ERROR_CODE";if(498===i||499===i||"GWM_0003"===s||400===i&&"Unable to generate token."===o)throw n||new X(o,a,t,e,r);throw new K(o,a,t,e,r)}if("failed"!==t.status&&"failure"!==t.status)return t;o=void 0,i="UNKNOWN_ERROR_CODE";try{o=JSON.parse(t.statusMessage).message,i=JSON.parse(t.statusMessage).code}catch(e){o=t.statusMessage||t.message}throw new K(o,i,t,e,r)}(e,n,o,r);return r&&(e=n.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0],o.authentication.federatedServers[e]={token:[],expires:new Date(Date.now()+864e5)},r=null),t})}function re(r,e,t){var n=U(U({params:{}},t),r);return n.params=e.reduce(function(e,t){return!r[t]&&"boolean"!=typeof r[t]||(e[t]=r[t]),e},n.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce(function(e,t){return n[t]&&(e[t]=n[t]),e},{})}function ne(e){return"string"==typeof e&&"/"===(e=e.trim())[e.length-1]?e.slice(0,-1):e}function oe(e){return e.replace(/^#/,"").split("&").reduce(function(e,t){var r,t=(r=t,r=(t=t.split("="))[0],t=t[1],{key:decodeURIComponent(r),value:decodeURIComponent(t)});return e[t.key]=t.value,e},{})}function ie(e,t){return t.rawResponse=!1,te(e,t).then(function(e){var t={token:e.access_token,username:e.username,expires:new Date(Date.now()+(1e3*e.expires_in-1e3)),ssl:!0===e.ssl};return e.refresh_token&&(t.refreshToken=e.refresh_token),t})}function ae(e,t){return"undefined"!=typeof window&&window.location&&window.location.host?t.params.referer=window.location.host:t.params.referer=Q,te(e,t)}var se=/^https?:\/\/(\S+)\.arcgis\.com.+/;function ue(e){return se.test(e)}function ce(e){if(!se.test(e))return null;e=e.match(se)[1].split(".").pop();return e.includes("dev")?"dev":e.includes("qa")?"qa":"production"}function le(e,t){t=ne(function(e){if(!se.test(e))return e;switch(ce(e)){case"dev":return"https://devext.arcgis.com/sharing/rest";case"qa":return"https://qaext.arcgis.com/sharing/rest";default:return"https://www.arcgis.com/sharing/rest"}}(t)).replace(/https?:\/\//,""),e=ne(e).replace(/https?:\/\//,"");return new RegExp(e,"i").test(t)}var pe=(Object.defineProperty(de.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"tokenExpires",{get:function(){return this._tokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"refreshToken",{get:function(){return this._refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"refreshTokenExpires",{get:function(){return this._refreshTokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"trustedServers",{get:function(){return console.log("DEPRECATED: use federatedServers instead"),this.federatedServers},enumerable:!1,configurable:!0}),de.beginOAuth2=function(e,t){void 0===t&&(t=window),e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var r=U({portal:"https://www.arcgis.com/sharing/rest",provider:"arcgis",expiration:20160,popup:!0,popupWindowFeatures:"height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes",state:e.clientId,locale:""},e),n=r.portal,o=r.provider,i=r.clientId,a=r.expiration,s=r.redirectUri,u=r.popup,c=r.popupWindowFeatures,l=r.state,p=r.locale,r=r.params,p="arcgis"===o?n+"/oauth2/authorize?client_id="+i+"&response_type=token&expiration="+(e.duration||a)+"&redirect_uri="+encodeURIComponent(s)+"&state="+l+"&locale="+p:n+"/oauth2/social/authorize?client_id="+i+"&socialLoginProviderName="+o+"&autoAccountCreateForSocial=true&response_type=token&expiration="+(e.duration||a)+"&redirect_uri="+encodeURIComponent(s)+"&state="+l+"&locale="+p;if(r&&(p=p+"&"+W(r)),u){var d,f=((d={promise:null,resolve:null,reject:null}).promise=new Promise(function(e,t){d.resolve=e,d.reject=t}),d);return t["__ESRI_REST_AUTH_HANDLER_"+i]=function(e,t){e?(e=JSON.parse(e),f.reject(new X(e.errorMessage,e.error))):t&&(t=JSON.parse(t),f.resolve(new de({clientId:i,portal:n,ssl:t.ssl,token:t.token,tokenExpires:new Date(t.expires),username:t.username})))},t.open(p,"oauth-window",c),f.promise}t.location.href=p},de.completeOAuth2=function(e,o){void 0===o&&(o=window);var t=U({portal:"https://www.arcgis.com/sharing/rest",popup:!0},e),i=t.portal,a=t.clientId,s=t.popup;function r(e,t){try{var r=void 0,n="__ESRI_REST_AUTH_HANDLER_"+a;if(s&&(o.opener?o.opener.parent&&o.opener.parent[n]?r=o.opener.parent[n]:o.opener&&o.opener[n]&&(r=o.opener[n]):o!==o.parent&&o.parent&&o.parent[n]&&(r=o.parent[n]),r))return r(e?JSON.stringify(e):void 0,JSON.stringify(t)),void o.close()}catch(e){throw new X('Unable to complete authentication. It\'s possible you specified popup based oAuth2 but no handler from "beginOAuth2()" present. This generally happens because the "popup" option differs between "beginOAuth2()" and "completeOAuth2()".')}if(e)throw new X(e.errorMessage,e.error);return new de({clientId:a,portal:i,ssl:t.ssl,token:t.token,tokenExpires:t.expires,username:t.username})}e=oe(o.location.hash);if(!e.access_token){var n=void 0,u="Unknown error";return e.error&&(n=e.error,u=e.error_description),r({error:n,errorMessage:u})}t=e.access_token,n=new Date(Date.now()+1e3*parseInt(e.expires_in,10)-6e4),u=e.username;return r(void 0,{token:t,expires:n,ssl:"true"===e.ssl,username:u})},de.fromParent=function(e,n){var o;return!n&&window&&(n=window),new Promise(function(t,r){o=function(e){if(e.source===n.parent&&e.data)try{return t(de.parentMessageHandler(e))}catch(e){return r(e)}},n.addEventListener("message",o,!1),n.parent.postMessage({type:"arcgis:auth:requestCredential"},e)}).then(function(e){return n.removeEventListener("message",o,!1),e})},de.authorize=function(e,t){e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var r=U({portal:"https://arcgis.com/sharing/rest",expiration:20160},e),n=r.portal,o=r.clientId,i=r.expiration,r=r.redirectUri;t.writeHead(301,{Location:n+"/oauth2/authorize?client_id="+o+"&expiration="+(e.duration||i)+"&response_type=code&redirect_uri="+encodeURIComponent(r)}),t.end()},de.exchangeAuthorizationCode=function(e,t){var e=U({portal:"https://www.arcgis.com/sharing/rest",refreshTokenTTL:20160},e),r=e.portal,n=e.clientId,o=e.redirectUri,i=e.refreshTokenTTL;return ie(r+"/oauth2/token",{params:{grant_type:"authorization_code",client_id:n,redirect_uri:o,code:t}}).then(function(e){return new de({clientId:n,portal:r,ssl:e.ssl,redirectUri:o,refreshToken:e.refreshToken,refreshTokenTTL:i,refreshTokenExpires:new Date(Date.now()+60*(i-1)*1e3),token:e.token,tokenExpires:e.expires,username:e.username})})},de.deserialize=function(e){e=JSON.parse(e);return new de({clientId:e.clientId,refreshToken:e.refreshToken,refreshTokenExpires:new Date(e.refreshTokenExpires),username:e.username,password:e.password,token:e.token,tokenExpires:new Date(e.tokenExpires),portal:e.portal,ssl:e.ssl,tokenDuration:e.tokenDuration,redirectUri:e.redirectUri,refreshTokenTTL:e.refreshTokenTTL})},de.fromCredential=function(e){var t=void 0===e.ssl||e.ssl,r=e.expires||Date.now()+72e5;return new de({portal:e.server.includes("sharing/rest")?e.server:e.server+"/sharing/rest",ssl:t,token:e.token,username:e.userId,tokenExpires:new Date(r)})},de.parentMessageHandler=function(e){if("arcgis:auth:credential"===e.data.type)return de.fromCredential(e.data.credential);if("arcgis:auth:error"!==e.data.type)throw new Error("Unknown message type.");var t=new Error(e.data.error.message);throw t.name=e.data.error.name,t},de.prototype.toCredential=function(){return{expires:this.tokenExpires.getTime(),server:this.portal,ssl:this.ssl,token:this.token,userId:this.username}},de.prototype.getUser=function(e){var t=this;if(this._pendingUserRequest)return this._pendingUserRequest;if(this._user)return Promise.resolve(this._user);var r=this.portal+"/community/self",e=U(U({httpMethod:"GET",authentication:this},e),{rawResponse:!1});return this._pendingUserRequest=te(r,e).then(function(e){return t._user=e,t._pendingUserRequest=null,e}),this._pendingUserRequest},de.prototype.getPortal=function(e){var t=this;if(this._pendingPortalRequest)return this._pendingPortalRequest;if(this._portalInfo)return Promise.resolve(this._portalInfo);var r=this.portal+"/portals/self",e=U(U({httpMethod:"GET",authentication:this},e),{rawResponse:!1});return this._pendingPortalRequest=te(r,e).then(function(e){return t._portalInfo=e,t._pendingPortalRequest=null,e}),this._pendingPortalRequest},de.prototype.getUsername=function(){return this.username?Promise.resolve(this.username):this._user?Promise.resolve(this._user.username):this.getUser().then(function(e){return e.username})},de.prototype.getToken=function(e,t){return r=this.portal,n=e,o=ue(r),i=ue(n),r=ce(r),n=ce(n),o&&i&&r===n||new RegExp(this.portal,"i").test(e)?this.getFreshToken(t):this.getTokenForServer(e,t);var r,n,o,i},de.prototype.validateAppAccess=function(r){return this.getToken(this.portal).then(function(e){return te((t=void 0===t?"https://www.arcgis.com/sharing/rest":t)+"/oauth2/validateAppAccess",{method:"POST",params:{f:"json",client_id:r,token:e}});var t})},de.prototype.toJSON=function(){return{clientId:this.clientId,refreshToken:this.refreshToken,refreshTokenExpires:this.refreshTokenExpires,username:this.username,password:this.password,token:this.token,tokenExpires:this.tokenExpires,portal:this.portal,ssl:this.ssl,tokenDuration:this.tokenDuration,redirectUri:this.redirectUri,refreshTokenTTL:this.refreshTokenTTL}},de.prototype.serialize=function(){return JSON.stringify(this)},de.prototype.enablePostMessageAuth=function(e,t){!t&&window&&(t=window),this._hostHandler=this.createPostMessageHandler(e),t.addEventListener("message",this._hostHandler,!1)},de.prototype.disablePostMessageAuth=function(e){(e=!e&&window?window:e).removeEventListener("message",this._hostHandler,!1)},de.prototype.refreshSession=function(e){return this._user=null,this.username&&this.password?this.refreshWithUsernameAndPassword(e):this.clientId&&this.refreshToken?this.refreshWithRefreshToken():Promise.reject(new X("Unable to refresh token."))},de.prototype.getServerRootUrl=function(e){var t=ne(e).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/)[0].match(/(https?:\/\/)(.+)/);t[0];var r=t[1],e=t[2].split("/"),t=e[0],e=e.slice(1);return""+r+t.toLowerCase()+"/"+e.join("/")},de.prototype.getDomainCredentials=function(t){return this.trustedDomains&&this.trustedDomains.length&&this.trustedDomains.some(function(e){return t.startsWith(e)})?"include":"same-origin"},de.prototype.createPostMessageHandler=function(o){var i=this;return function(e){var t=-1<o.indexOf(e.origin),r="arcgis:auth:requestCredential"===e.data.type,n=i.tokenExpires.getTime()>Date.now();t&&r&&(r={},r=n?((n=i.toCredential()).server=n.server.replace("/sharing/rest",""),{type:"arcgis:auth:credential",credential:n}):{type:"arcgis:auth:error",error:{name:"tokenExpiredError",message:"Session token was expired, and not returned to the child application"}},e.source.postMessage(r,e.origin))}},de.prototype.getTokenForServer=function(t,r){var n=this,o=this.getServerRootUrl(t),e=this.federatedServers[o];return e&&e.expires&&e.expires.getTime()>Date.now()?Promise.resolve(e.token):this._pendingTokenRequests[o]||(this._pendingTokenRequests[o]=this.fetchAuthorizedDomains().then(function(){return te(o+"/rest/info",{credentials:n.getDomainCredentials(t)}).then(function(e){if(e.owningSystemUrl){if(le(e.owningSystemUrl,n.portal))return te(e.owningSystemUrl+"/sharing/rest/info",r);throw new X(t+" is not federated with "+n.portal+".","NOT_FEDERATED")}if(e.authInfo&&void 0!==n.federatedServers[o])return Promise.resolve({authInfo:e.authInfo});throw new X(t+" is not federated with any portal and is not explicitly trusted.","NOT_FEDERATED")}).then(function(e){return e.authInfo.tokenServicesUrl}).then(function(e){return n.token&&n.tokenExpires.getTime()>Date.now()?ae(e,{params:{token:n.token,serverUrl:t,expiration:n.tokenDuration,client:"referer"}}):ae(e,{params:{username:n.username,password:n.password,expiration:n.tokenDuration,client:"referer"}}).then(function(e){return n._token=e.token,n._tokenExpires=new Date(e.expires),e})}).then(function(e){return n.federatedServers[o]={expires:new Date(e.expires),token:e.token},delete n._pendingTokenRequests[o],e.token})}),this._pendingTokenRequests[o])},de.prototype.getFreshToken=function(e){var t=this;return this.token&&!this.tokenExpires||this.token&&this.tokenExpires&&this.tokenExpires.getTime()>Date.now()?Promise.resolve(this.token):(this._pendingTokenRequests[this.portal]||(this._pendingTokenRequests[this.portal]=this.refreshSession(e).then(function(e){return t._pendingTokenRequests[t.portal]=null,e.token})),this._pendingTokenRequests[this.portal])},de.prototype.refreshWithUsernameAndPassword=function(e){var t=this,e=U({params:{username:this.username,password:this.password,expiration:this.tokenDuration}},e);return ae(this.portal+"/generateToken",e).then(function(e){return t._token=e.token,t._tokenExpires=new Date(e.expires),t})},de.prototype.refreshWithRefreshToken=function(e){var t=this;if(this.refreshToken&&this.refreshTokenExpires&&this.refreshTokenExpires.getTime()<Date.now())return this.refreshRefreshToken(e);e=U({params:{client_id:this.clientId,refresh_token:this.refreshToken,grant_type:"refresh_token"}},e);return ie(this.portal+"/oauth2/token",e).then(function(e){return t._token=e.token,t._tokenExpires=e.expires,t})},de.prototype.refreshRefreshToken=function(e){var t=this,e=U({params:{client_id:this.clientId,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,grant_type:"exchange_refresh_token"}},e);return ie(this.portal+"/oauth2/token",e).then(function(e){return t._token=e.token,t._tokenExpires=e.expires,t._refreshToken=e.refreshToken,t._refreshTokenExpires=new Date(Date.now()+60*(t.refreshTokenTTL-1)*1e3),t})},de.prototype.fetchAuthorizedDomains=function(){var t=this;return this.server||!this.portal?Promise.resolve(this):this.getPortal().then(function(e){return e.authorizedCrossOriginDomains&&e.authorizedCrossOriginDomains.length&&(t.trustedDomains=e.authorizedCrossOriginDomains.filter(function(e){return!e.startsWith("http://")}).map(function(e){return e.startsWith("https://")?e:"https://"+e})),t})},de);function de(e){var t;this.clientId=e.clientId,this._refreshToken=e.refreshToken,this._refreshTokenExpires=e.refreshTokenExpires,this.username=e.username,this.password=e.password,this._token=e.token,this._tokenExpires=e.tokenExpires,this.portal=e.portal?ne(e.portal):"https://www.arcgis.com/sharing/rest",this.ssl=e.ssl,this.provider=e.provider||"arcgis",this.tokenDuration=e.tokenDuration||20160,this.redirectUri=e.redirectUri,this.refreshTokenTTL=e.refreshTokenTTL||20160,this.server=e.server,this.federatedServers={},this.trustedDomains=[],e.server&&(t=this.getServerRootUrl(e.server),this.federatedServers[t]={token:e.token,expires:e.tokenExpires}),this._pendingTokenRequests={}}function fe(e){e=e.privileges;return E(void 0===e?[]:e,"portal:user:createItem")}function he(e,t){var r,n=!1,o=e.itemControl,i=e.owner,a=e.orgId,s=t.roleId,u=t.role,c=t.username,l=t.groups,p=t.orgId,u=E(["admin","update"],o)||!!i&&i===c||!!(!!a&&a===p)&&!s&&"org_admin"===u,t=fe(t);return t&&u?n=!0:t&&(r=I(O(e,"groupIds")||[],[O(e,"properties.collaborationGroupId")]),n=l.some(function(e){return H(e)&&E(r,e.id)})),n}var me=["portal:user:createGroup","portal:user:createItem","portal:user:shareToGroup","portal:user:viewOrgGroups","portal:user:viewOrgItems"];function ge(e){var t=e.host,r=e.path,e=e.query,t=t.endsWith("/")?t:t+"/",t=new URL(r,t);return t.search=function(r){void 0===r&&(r={});var e=Object.keys(r).filter(function(e){return void 0!==r[e]}).reduce(function(e,t){return e[t]=r[t],e},{});return new URLSearchParams(e).toString()}(e),t.toString()}function be(e){return(e=void 0===e?{}:e).portal?ne(e.portal):e.authentication?e.authentication.portal:"https://www.arcgis.com/sharing/rest"}function ye(e){var t=JSON.parse(JSON.stringify(e));return t.data&&("undefined"!=typeof Blob&&e.data instanceof Blob||"ReadStream"===e.data.constructor.name?t.file=e.data:t.text=e.data,delete t.data),t}function ve(e){return e.owner?Promise.resolve(e.owner):e.item&&e.item.owner?Promise.resolve(e.item.owner):e.authentication&&e.authentication.getUsername?e.authentication.getUsername():Promise.reject(new Error("Could not determine the owner of this item. Pass the `owner`, `item.owner`, or `authentication` option."))}function we(t){return ve(t).then(function(e){e=t.folderId?be(t)+"/content/users/"+e+"/"+t.folderId+"/items/"+t.item.id+"/update":be(t)+"/content/users/"+e+"/items/"+t.item.id+"/update";return t.params=U(U({},t.params),ye(t.item)),te(e,t)})}function Ae(e){var r,e=U({folderId:null},e);return(r=e).multipart&&!r.filename?Promise.reject(new Error("The filename is required for a multipart request.")):ve(r).then(function(e){var t=be(r)+"/content/users/"+e,e=t+"/addItem";return r.folderId&&(e=t+"/"+r.folderId+"/addItem"),r.params=U(U({},r.params),ye(r.item)),te(e,re(r,["owner","folderId","file","dataUrl","text","async","multipart","filename","overwrite"],{params:U({},r.params)}))})}var De=/[\x00-\x1F\x7F-\x9F\xA0]/g;function Se(e,t){return te(xe(e,t),U({httpMethod:"GET"},t))}var xe=function(e,t){return("string"==typeof t?t:be(t))+"/content/items/"+e};function Ee(e,t){e=xe(e,t)+"/data",t=U({httpMethod:"GET",params:{}},t);return t.file&&(t.params.f=null),te(e,t).catch(function(e){var t=RegExp(/The string did not match the expected pattern|(Unexpected end of (JSON input|data at line 1 column 1))/i);if(!t.test(e.message))throw e})}function ke(e){var t=xe(e.id,e)+"/relatedItems",r=U({httpMethod:"GET",params:{direction:e.direction}},e);return"string"==typeof e.relationshipType?r.params.relationshipType=e.relationshipType:r.params.relationshipTypes=e.relationshipType,delete r.direction,delete r.relationshipType,te(t,r)}function Ce(e,t){var r,n,o=t||{},i=o.fileName,i=void 0===i?"iteminfo.xml":i,o=o.readAs,o=void 0===o?"text":o,t=U({httpMethod:"GET"},t);return i="/info/"+i,r=o,i=""+xe(e,t=t)+i,t=U({params:{}},t),n=t.rawResponse,t.rawResponse=!0,t.params.f=null,te(i,t).then(function(e){return n?e:"json"!==r?e[r]():e.text().then(function(e){return JSON.parse(e.replace(De,""))})})}function Te(t){return ve(t).then(function(e){return te(be(t)+"/content/users/"+e+"/items/"+t.id+"/unprotect",t)})}function qe(e){return t=e.groupId,te(be(e=e)+"/community/groups/"+t,U({httpMethod:"GET"},e)).then(function(e){return e.userMembership.memberType}).catch(function(){return"none"});var t}function Ie(t){return ve(t).then(function(e){return te(be(t)+"/content/users/"+e+"/items/"+t.id+"/delete",t)})}var Oe=(Pe.prototype.match=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.termStack=this.termStack.concat(e),this},Pe.prototype.in=function(e){return this.hasRange||this.hasTerms?(e&&"*"!==e&&(this.q+=e+":"),this.commit()):(J("`in("+(e?'"'+e+'"':"")+")`"+" was called with no call to `match(...)` or `from(...)`/`to(...)`. Your query was not modified."),this)},Pe.prototype.startGroup=function(){return this.commit(),0<this.openGroups&&(this.q+=" "),this.openGroups++,this.q+="(",this},Pe.prototype.endGroup=function(){return this.openGroups<=0?J("`endGroup(...)` was called without calling `startGroup(...)` first. Your query was not modified."):(this.commit(),this.openGroups--,this.q+=")"),this},Pe.prototype.and=function(){return this.addModifier("and")},Pe.prototype.or=function(){return this.addModifier("or")},Pe.prototype.not=function(){return this.addModifier("not")},Pe.prototype.from=function(e){return this.hasTerms?J('`from(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'):this.rangeStack[0]=e,this},Pe.prototype.to=function(e){return this.hasTerms?J('`to(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'):this.rangeStack[1]=e,this},Pe.prototype.boost=function(e){return this.commit(),this.q+="^"+e,this},Pe.prototype.toParam=function(){return this.commit(),this.cleanup(),this.q},Pe.prototype.clone=function(){return this.commit(),this.cleanup(),new Pe(this.q+"")},Pe.prototype.addModifier=function(e){return this.currentModifer?(J("You have called `"+this.currentModifer+"()` after `"+e+"()`. Your current query was not modified."),this):(this.commit(),""===this.q&&"not"!==e?J("You have called `"+e+"()` without calling another method to modify your query first. Try calling `match()` first."):(this.currentModifer=e,this.q+=""===this.q?"":" ",this.q+=e.toUpperCase()+" "),this)},Pe.prototype.needsQuotes=function(e){return/\s|:/g.test(e)},Pe.prototype.formatTerm=function(e){return e instanceof Date?e.getTime():"string"==typeof e&&this.needsQuotes(e)?'"'+e+'"':e},Pe.prototype.commit=function(){var t=this;return this.currentModifer=void 0,this.hasRange&&(this.q+="["+this.formatTerm(this.rangeStack[0])+" TO "+this.formatTerm(this.rangeStack[1])+"]",this.rangeStack=[void 0,void 0]),this.hasTerms&&(this.q+=this.termStack.map(function(e){return t.formatTerm(e)}).join(" "),this.termStack=[]),this},Object.defineProperty(Pe.prototype,"hasTerms",{get:function(){return 0<this.termStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"hasRange",{get:function(){return this.rangeStack.length&&this.rangeStack[0]&&this.rangeStack[1]},enumerable:!1,configurable:!0}),Pe.prototype.cleanup=function(){if(0<this.openGroups)for(J("Automatically closing "+this.openGroups+" group(s). You can use `endGroup(...)` to remove this warning.");0<this.openGroups;)this.q+=")",this.openGroups--;var e=this.q;this.q=e.replace(/( AND ?| NOT ?| OR ?)*$/,""),e!==this.q&&J("`startGroup(...)` was called without calling `endGroup(...)` first. Your query was not modified."),this.q=this.q.replace(/(\(\))*/,"")},Pe);function Pe(e){void 0===e&&(e=""),this.termStack=[],this.rangeStack=[],this.openGroups=0,this.q=e}function Ue(r,n){var e,t="string"==typeof r||r instanceof Oe?{httpMethod:"GET",params:{q:r}}:re(r,["q","num","start","sortField","sortOrder","searchUserAccess","searchUserName","filter","countFields","countSize","categories","categoryFilters"],{httpMethod:"GET"});switch(n){case"item":e="/search";break;case"group":e="/community/groups";break;case"groupContent":if("string"==typeof r||r instanceof Oe||!r.groupId)return Promise.reject(new Error("you must pass a `groupId` option to `searchGroupContent`"));e="/content/groups/"+r.groupId+"/search";break;default:e="/portals/self/users/search"}return te(be(t)+e,t).then(function(t){return t.nextStart&&-1!==t.nextStart&&(t.nextPage=function(){var e;return"string"==typeof r||r instanceof Oe?e={q:r,start:t.nextStart}:(e=r).start=t.nextStart,Ue(e,n)}),t})}function Ne(e){return Ue(e,"item")}function Re(e,t){if(0===e.length)return[];for(var r=[],n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Fe(e){var t=e.id,r=be(e)+"/community/groups/"+t+"/addUsers",t=Object.assign({},e,{admins:void 0,users:void 0}),t=I(Le("users",e.users,t),Le("admins",e.admins,t)).map(function(e){return te(r,e).catch(function(e){return{errors:[e]}})});return Promise.all(t).then(_e)}function Le(o,e,i){return!e||e.length<1?[]:Re(e,25).map(function(e){return t=o,r=e,n=i,Object.assign({},n,((e={})[t]=r,e.params=U(U({},n.params),((n={})[t]=r,n)),e));var t,r,n})}function _e(e){var t=e.filter(function(e){return e.notAdded}).reduce(function(e,t){return e.concat(t.notAdded)},[]),e=e.filter(function(e){return e.errors}).reduce(function(e,t){return e.concat(t.errors)},[]),t={notAdded:t};return 0<e.length&&(t.errors=e),t}function je(t){var e=t.id,r=t.users,n=be(t)+"/community/groups/"+e+"/removeUsers",r=Re(r,25).map(function(e){e=U(U({},t),{users:e,params:{users:e}});return te(n,e).catch(function(e){return{errors:[e]}})});return Promise.all(r).then(function(e){var t=function(r){return e.filter(function(e){return e[r]}).reduce(function(e,t){return e.concat(t[r])},[])},r=t("errors"),t={notRemoved:t("notRemoved")};return r.length?U(U({},t),{errors:r}):t})}function Be(e){var t,r=e.id,n=be(e)+"/community/groups/"+r+"/invite",e=Re((t=e).users,25).map(function(e){return function(e,t){t=Object.assign({},t);return t.params=U(U({},t.params),{users:e,role:t.role,expiration:t.expiration}),t}(e,t)}).map(function(e){return te(n,e).catch(function(e){return{errors:[e]}})});return Promise.all(e).then(Me)}function Me(e){var t=e.every(function(e){return e.success}),e=e.reduce(function(e,t){return e.concat(t.errors||[])},[]),t={success:t};return 0<e.length&&(t.errors=e),t}function Ge(e){return te(be(e)+"/community/groups/"+e.id+"/unprotect",e)}function Ve(e){return te(be(e)+"/community/groups/"+e.id+"/delete",U({},e))}function He(e){var t=be(e)+"/community/groups/"+e.id+"/updateUsers",r={authentication:e.authentication,params:{}};return"admin"===e.newMemberType?r.params.admins=e.users:r.params.users=e.users,te(t,r)}function ze(e){var n,t=be(e)+"/portals/self/createNotification",e=Re((n=e).users,n.batchSize||25).map(function(e){return t=e,r=n,(e=Object.assign({},r)).params=U(U({},e.params),{users:t,subject:r.subject,message:r.message,notificationChannelType:e.notificationChannelType}),e;var t,r}).map(function(e){return te(t,e).catch(function(e){return{errors:[e]}})});return Promise.all(e).then(Ye)}function Ye(e){var t=e.every(function(e){return e.success}),e=e.reduce(function(e,t){return e.concat(t.errors||[])},[]),t={success:t};return 0<e.length&&(t.errors=e),t}function We(e){var t,r,n={httpMethod:"GET"};return"string"==typeof e?r="https://www.arcgis.com/sharing/rest/community/users/"+e:(t=e.username||e.authentication.username,r=be(e)+"/community/users/"+encodeURIComponent(t),n=U(U({},e),n)),te(r,n)}function Ke(t){return Ne({q:"id: "+t.id+" AND group: "+t.groupId,start:1,num:10,sortField:"title",authentication:t.authentication,httpMethod:"POST"}).then(function(e){if(0<e.total)return e.results.some(function(e){return e.id===t.id})})}function Je(a){return Ke(a).then(function(e){if(e)return{itemId:a.id,shortcut:!0,notSharedWith:[]};var t=a.authentication.username,e=a.owner,n=a.confirmItemControl,e=e||t;if(e===t)return Ze(a);var o=!1,i=!1;return Promise.all([We({username:t,authentication:a.authentication}),We({username:e,authentication:a.authentication}),qe(a)]).then(function(e){var t=e[0],r=e[1],e=e[2];return o="org_admin"===t.role&&!t.roleId,i=t.orgId!==r.orgId,function(e,t,r,n,o,i){var a=[];if(i.groupId!==e.favGroupId)if(t){if(!n)throw Error("This item can not be shared to shared editing group "+i.groupId+" by "+e.username+" as they not the item owner or org admin.");a.push(Qe(e,e,!1,"Error adding "+e.username+" as member to edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i),Qe(e,o,!0,"none"===r?"Error adding user "+o.username+" to edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.":"Error promoting user "+o.username+" to admin in edit group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i))}else if(n)a.push(Qe(e,e,!1,"Error adding "+e.username+" as member to view group "+i.groupId+". Consequently item "+i.id+" was not shared to the group.",i));else if("none"===r)throw new Error("This item can not be shared by "+e.username+" as they are not a member of the specified group "+i.groupId+".");return a}(t,!!n,e,o,r,a)}).then(function(e){var t=e[0],r=(void 0===t?{promise:Promise.resolve({notAdded:[]}),revert:function(e){return Promise.resolve(e)}}:t).revert;return Promise.all(e.map(function(e){return e.promise})).then(function(){return Ze(a,o,i)}).then(function(e){return r(e)})})}).then(function(e){if(e.notSharedWith.length)throw Error("Item "+a.id+" could not be shared to group "+a.groupId+".");return e})}function Ze(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.authentication.username,o=e.owner||n,i=be(e)+"/content/items/"+e.id+"/share";return(o===n||t&&!r)&&(i=be(e)+"/content/users/"+o+"/items/"+e.id+"/share"),e.params={groups:e.groupId,confirmItemControl:e.confirmItemControl},te(i,e)}function Qe(e,t,r,n,o){var i,a,s=t.groups||[],u=s.find(function(e){return e.id===o.groupId});if(e.orgId!==t.orgId)throw Error("User "+t.username+" is not a member of the same org as "+e.username+". Consequently they can not be added added to group "+o.groupId+" nor can item "+o.id+" be shared to the group.");if(!u&&511<s.length)throw Error("User "+t.username+" already has 512 groups, and can not be added to group "+o.groupId+". Consequently item "+o.id+" can not be shared to the group.");return a=u?r&&"member"===u.userMembership.memberType?(i=He({id:o.groupId,users:[t.username],newMemberType:"admin",authentication:o.authentication}).then(function(e){e=e.results.reduce(function(e,t){return t.success||e.push(t.username),e},[]);return Promise.resolve({notAdded:e})}).catch(function(){return{notAdded:[t.username]}}),function(e){return He({id:o.groupId,users:[t.username],newMemberType:"member",authentication:o.authentication}).then(function(){return e}).catch(function(){return e})}):(i=Promise.resolve({notAdded:[]}),function(e){return Promise.resolve(e)}):(i=Fe(((a={id:o.groupId})[r?"admins":"users"]=[t.username],a.authentication=o.authentication,a)).then(function(e){if(e.errors&&e.errors.length)throw e.errors[0];return e}).catch(function(){return{notAdded:[t.username]}}),function(e){return je({id:o.groupId,users:[t.username],authentication:o.authentication}).then(function(){return e})}),{promise:i.then(function(e){if(e.notAdded.length)throw new Error(n);return e}),revert:a}}function $e(o){return Ke(o).then(function(e){if(!e)return Promise.resolve({itemId:o.id,shortcut:!0,notUnsharedFrom:[]});var r=o.authentication.username,n=o.owner;return Promise.all([qe(o),We({username:r,authentication:o.authentication})]).then(function(e){var t=e[0],e=e[1],e="org_admin"===e.role&&!e.roleId;if(!((n||r)===r)&&!e&&["admin","owner"].indexOf(t)<0)throw Error("This item can not be unshared from group "+o.groupId+" by "+r+" as they not the item owner, an org admin, group admin or group owner.");return function(e){var t=e.authentication.username,r=e.owner||t,n=be(e)+"/content/items/"+e.id+"/unshare";r===t&&(n=be(e)+"/content/users/"+r+"/items/"+e.id+"/unshare");return e.params={groups:e.groupId},te(n,e)}(o)}).then(function(e){if(e.notUnsharedFrom.length)throw Error("Item "+o.id+" could not be unshared to group "+o.groupId);return e})})}function Xe(e){return function(e,t){e=e||"self",e=be(t)+"/portals/"+e,t=U({httpMethod:"GET"},t);return te(e,t)}(null,e)}function et(e){if("string"==typeof e)return e.replace(/\/sharing\/rest\/?$/,"");if("object"==typeof e){var t=e.portalSelf||e,r=t.portalHostname,n=t.urlKey,o=t.customBaseUrl;if(r||n&&o)return t.isPortal?"https://"+t.portalHostname:"https://"+t.urlKey+"."+t.customBaseUrl}return et(be(e))}var tt={devext:"https://d1011m9qpnz5mw.cloudfront.net",qaext:"https://dyq9ux9ryu4qj.cloudfront.net",www:"https://d1iq7pbacwn5rb.cloudfront.net"};function rt(e){if(e.isPortal)return et(e)+"/apps/sites";e=e.portalHostname.split(".")[0];return(tt[e]||tt.www)+"/opendata-ui/assets"}function nt(e){return et(e)+"/sharing/rest"}function ot(e){return e=(e=e.toLowerCase()).includes("//")?e.split("//")[1]:e}function it(e){var t;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://hubqa.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://hubdev.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://hub.arcgis.com"),t}function at(e){if(e.isPortal)throw new Error("Hub Url is not available in ArcGIS Enterprise");return it(e.portalHostname)}function st(e,t){return et(t)+"/home/item.html?id="+e}function ut(e,t,r){return t=ct(e,t,r),r="\\/"+e.id+"\\?f=json",r=new RegExp(r),t&&t.replace(r,"/"+e.id+"/data").replace(/\&token/,"?token")}var ct=function(e,t,r){var n=e.id,e=e.access,t=nt(t)+"/content/items/"+n,n=new URLSearchParams({f:"json"});return"public"!==e&&r&&n.append("token",r),t+"?"+n.toString()};function lt(e){var t;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://hubqa.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://hubdev.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://hub.arcgis.com"),t}function pt(e){var t=e;return e.match(/(qaext|\.mapsqa)\.arcgis.com/)?t="https://qaext.arcgis.com":e.match(/(devext|\.mapsdevext)\.arcgis.com/)?t="https://devext.arcgis.com":e.match(/(www|\.maps)\.arcgis.com/)&&(t="https://www.arcgis.com"),t}function dt(e){return ft.test(e)}var ft=/\/(map|feature)server/i,ht=function(e){e=e.match(ft),e=e&&e[1];return e&&t(e)+" Service"};function mt(e){var t=e&&e.hubApiUrl;return t||it(nt(e))}var gt="/api/v3/domains",bt="/api/v3/datasets",yt="/api/discussions/v1",vt=(Object.defineProperty(wt.prototype,"session",{get:function(){return this._authentication},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"isAuthenticated",{get:function(){return!!this._authentication},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"userRequestOptions",{get:function(){if(this.isAuthenticated)return{authentication:this._authentication,portal:this.sharingApiUrl}},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"requestOptions",{get:function(){var e={portal:this.sharingApiUrl};return e=this.isAuthenticated?{authentication:this._authentication,portal:this.sharingApiUrl}:e},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"hubRequestOptions",{get:function(){if(this.isAuthenticated)return{authentication:this.session,isPortal:this.isPortal,portalSelf:this.portal,hubApiUrl:this.hubUrl}},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"portalUrl",{get:function(){return this.isAuthenticated?this.isPortal?"https://"+this._portalSelf.portalHostname:"https://"+this._portalSelf.urlKey+"."+this._portalSelf.customBaseUrl:this._portalUrl},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"sharingApiUrl",{get:function(){return this.portalUrl+"/sharing/rest"},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"hubUrl",{get:function(){return this._hubUrl},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"isPortal",{get:function(){return this._portalSelf?this._portalSelf.isPortal:-1===this._portalUrl.indexOf("arcgis.com")},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"discussionsServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+yt},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"hubSearchServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+bt},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"domainServiceUrl",{get:function(){if(this._hubUrl)return""+this._hubUrl+gt},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"eventsConfig",{get:function(){if(this._portalSelf)return O(this._portalSelf,"portalProperties.hub.settings.events")},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"hubEnabled",{get:function(){return y(this._portalSelf,"portalProperties.hub.enabled",!1)},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"communityOrgId",{get:function(){if(this._portalSelf)return O(this._portalSelf,"portalProperties.hub.settings.communityOrg.orgId")},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"communityOrgHostname",{get:function(){if(this._portalSelf)return O(this._portalSelf,"portalProperties.hub.settings.communityOrg.portalHostname")},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"communityOrgUrl",{get:function(){if(this.communityOrgHostname)return"https://"+this.communityOrgHostname},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"helperServices",{get:function(){if(this._portalSelf)return this._portalSelf.helperServices},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"currentUser",{get:function(){return this._currentUser},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"portal",{get:function(){return this._portalSelf},enumerable:!1,configurable:!0}),Object.defineProperty(wt.prototype,"properties",{get:function(){return this._properties},enumerable:!1,configurable:!0}),wt);function wt(e){this._portalUrl="https://www.arcgis.com",this.id=e.id,this._portalUrl=e.portalUrl,this._hubUrl=e.hubUrl,e.authentication&&(this._authentication=e.authentication),e.portalSelf&&(this._portalSelf=e.portalSelf),e.currentUser&&(this._currentUser=e.currentUser),e.properties&&(this._properties=e.properties)}var At=(Dt.create=function(r){return void 0===r&&(r={}),T(this,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return[4,(t=new Dt(r)).initialize()];case 1:return e.sent(),[2,t]}})})},Dt.prototype.setAuthentication=function(t){return T(this,void 0,void 0,function(){return q(this,function(e){switch(e.label){case 0:return this._authentication=t,this._portalUrl=t.portal.replace("/sharing/rest",""),[4,this.initialize()];case 1:return e.sent(),[2]}})})},Dt.prototype.setProperties=function(e){this._properties=e,this._context=new vt(this.contextOpts)},Dt.prototype.clearAuthentication=function(){this._context.isPortal||(this._portalUrl=pt(this._portalUrl)),this._authentication=null,this._portalSelf=null,this._currentUser=null,this._context=new vt(this.contextOpts)},Object.defineProperty(Dt.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Dt.prototype.initialize=function(){return T(this,void 0,void 0,function(){var t,r,n;return q(this,function(e){switch(e.label){case 0:if(!this._authentication||this._portalSelf&&this._currentUser)return[3,4];G.debug("ArcGISContextManager-"+this.id+": Initializing"),t=this._authentication.username,t=[Xe({authentication:this._authentication}),We({username:t,authentication:this._authentication})],e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.all(t)];case 2:return n=e.sent(),r=n[0],n=n[1],this._portalSelf=r,this._currentUser=n,G.debug("ArcGISContextManager-"+this.id+": received portalSelf and currentUser"),[3,4];case 3:throw r=e.sent(),n='ArcGISContextManager could not fetch portal & user for "'+this._authentication.username+'" using '+this._authentication.portal+".",G.error(n),console.error(n),r;case 4:return G.debug("ArcGISContextManager-"+this.id+": updating context"),this._context=new vt(this.contextOpts),[2]}})})},Object.defineProperty(Dt.prototype,"contextOpts",{get:function(){var e={id:this.id,portalUrl:this._portalUrl,hubUrl:this._hubUrl,properties:this._properties};return this._authentication&&(e.authentication=this._authentication),this._portalSelf&&(e.portalSelf=this._portalSelf),this._currentUser&&(e.currentUser=this._currentUser),e},enumerable:!1,configurable:!0}),Dt);function Dt(e){this._portalUrl="https://www.arcgis.com",this._logLevel=n.Level.error,this.id=(new Date).getTime(),e.logLevel&&(this._logLevel=e.logLevel),G.setLogLevel(this._logLevel),G.debug("ArcGISContextManager:ctor: Creating "+this.id),e.properties&&(this._properties=e.properties),e.authentication?(this._authentication=e.authentication,this._portalUrl=this._authentication.portal.replace("/sharing/rest","")):e.portalUrl&&(this._portalUrl=e.portalUrl),this._hubUrl=lt(this._portalUrl),e.portal&&(this._portalSelf=p(e.portal)),e.currentUser&&(this._currentUser=p(e.currentUser))}var St=function(e){if(e){var t=e.toLocaleLowerCase();return Object.keys(xt).find(function(e){return xt[e].some(function(e){return e.toLocaleLowerCase()===t})})}},xt={app:["Application","City Engine Web Scene","CityEngine Web Scene","Dashboard","Insights Page","Insights Workbook","Operation View","Web Mapping Application","StoryMap","Web Experience","Urban Model"],dataset:["CSV Collection","CSV","Feature Collection Template","Feature Collection","Feature Layer","Feature Service","File Geodatabase","GeoJSON","GeoJson","KML Collection","KML","Microsoft Excel","Raster Layer","Shapefile","Stream Service","Table"],document:["CAD Drawing","Document Link","Hub Page","Site Page","Image","iWork Keynote","iWork Numbers","iWork Pages","Microsoft Powerpoint","Microsoft Visio","Microsoft Word","Notebook","PDF","Pro Map","Report Template"],event:["Hub Event"],feedback:["Form","Quick Capture Project"],initiative:["Hub Initiative"],template:["Hub Initiative Template"],solution:["Solution"],map:["Image Collection","Image Service","Map Service Layer","Map Service","Scene Service","Scene Layer","Vector Tile Service","Web Map Service","Web Map Tile Service","Web Map","Web Scene","WFS","WMS","WMTS"],other:["360 VR Experience","AppBuilder Widget Package","Application Configuration","ArcPad Package","Code Attachment","Code Sample","Desktop Add In","Desktop Application Template","Desktop Application","Desktop Style","Explorer Add In","Explorer Layer","Geocoding Service","Geometry Service","Geoprocessing Package","Geoprocessing Sample","Geoprocessing Service","Layer File","Layer Package","Layer Template","Layer","Layout","Locator Package","Map Area","Map Document","Map Package","Map Service Definition","Map Template","Mobile Application","Mobile Map Package","Native Application","Network Analysis Service","Operations Dashboard Add In","Project Package","Project Template","Raster Function Template","Rule Package","Scene Package","Service Definition","SQLite Geodatabase","Style","Tile Package","Vector Tile Package","Workflow Manager Package"],site:["Hub Site Application","Site Application"]},Et=xt.app,kt=xt.dataset,Ct=xt.document,Tt=xt.event,qt=xt.feedback,It=xt.initiative,Ot=xt.map,Pt=xt.other,Ut=xt.site,Nt=["360 VR Experience","Application","CityEngine Web Scene","Code Sample","CSV Collection","CSV","CAD Drawing","Desktop Application","Desktop Application Template","Desktop Style","File Geodatabase","GeoJson","Geoprocessing Package","Geoprocessing Sample","Image","iWork Keynote","iWork Numbers","KML Collection","KML","Layer","Layer File","Layer Package","Layout","Locator Package","Map Package","Map Service Definition","Map Template","Microsoft Excel","Microsoft Powerpoint","Microsoft Visio","Microsoft Word","Notebook","Operations Dashboard Add In","PDF","Pro Map","Project Package","Project Template","Raster function template","Rule Package","Service Definition","Shapefile","Vector Tile Package","Workflow Manager Package"],Rt=["Data"],Ft={app:Et.concat(qt),dataset:kt,document:Ct,event:Tt,initiative:It,map:Ot,other:Pt,site:Ut,downloadableTypes:Nt,downloadableTypeKeywords:Rt,apiTypes:["Feature Service","Map Service","Image Service"]};function Lt(e){return-1!==Nt.indexOf(e.type)||e.typeKeywords&&Rt.some(function(t){return e.typeKeywords.some(function(e){return e===t})})}var _t=new RegExp(/.+(?:map|feature|image)server/i);function jt(e){var t=e.match(_t);return t?t[0]:ne(e.split("?")[0])}function Bt(e){return[[e.xmin,e.ymin],[e.xmax,e.ymax]]}var Mt={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}};function Gt(e){var t=e.portalSelf,r=t.defaultExtent,t=O(t,"helperServices.geometry.url");if(!t)return Promise.resolve(Mt);if(!r)return Promise.resolve(Mt);t+="/project",r={httpMethod:"POST",params:{geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[r]}),transformForward:!1,transformation:"",inSR:r.spatialReference.wkid,outSR:4326,f:"json"}};return e.authentication&&(r.authentication=e.authentication),te(t,r).then(function(e){e=e.geometries[0];return{xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax,spatialReference:{wkid:4326}}}).catch(function(e){return Mt})}var Vt=function(e){return Array.isArray(e)&&Array.isArray(e[0])&&Array.isArray(e[1])};function Ht(e){return console.warn("DEPRECATED: use isBBox() instead"),Vt(e)}function zt(e){var t=(n=e[0])[0],r=n[1],e=(n=e[1])[0],n=n[1];return{rings:[[[t,r],[e,r],[e,n],[t,n],[t,r]]],spatialReference:{wkid:4326}}}function Yt(e){var t,r;switch((e||"").toLowerCase()){case"image service":t="dataset";break;case"feature service":case"raster layer":t="map";break;case"microsoft excel":t="document";break;case"cad drawing":case"feature collection template":case"report template":t="content";break;default:t={other:"content",solution:"template"}[r=St(e)]||r}return t}function Wt(e){return e&&e.isPortal}function Kt(e,t){return!!e&&"public"===e.access&&!Wt(t)}function Jt(e,t,r){var n,o=$t(e,t,r);return o||(n="/content","feedback"===(r=Yt(e))?n="/feedback/surveys":Qt(e)?n="/pages":-1<["app","dataset","document","map","template"].indexOf(r)&&(n="/"+r+"s"),o=n+"/"+t),o}var Zt,Qt=function(e){return["Hub Page","Site Page"].includes(e)},$t=function(e,t,r){var n;return"Solution"===e&&(0<(null==r?void 0:r.indexOf("Deployed"))&&(n="/content/"+t),n="/templates/"+t+"/about"),n};function Xt(e){return{updateFrequency:"metadata.dataIdInfo.resMaint.maintFreq.MaintFreqCd.@_value",reviseDate:"metadata.dataIdInfo.idCitation.date.reviseDate",pubDate:"metadata.dataIdInfo.idCitation.date.pubDate",createDate:"metadata.dataIdInfo.idCitation.date.createDate",metadataUpdateFrequency:"metadata.mdMaint.maintFreq.MaintFreqCd.@_value",metadataUpdatedDate:"metadata.mdDateSt"}[e]}function er(e,t){t=Xt(t);return t&&O(e,t)}(Pt=Zt=Zt||{}).Year="year",Pt.Month="month",Pt.Day="day",Pt.Time="time";var tr=function(e,t){t=t.url&&jt(t.url);return t&&e.linkage.includes(t)},rr=function(e,t,r){var n=e.linkage,r=O(r,"authentication.token");return r&&tr(e,t)&&(t=new URL(e.linkage),(e=new URLSearchParams(t.search)).set("token",r),t.search=e.toString(),n=t.toString()),n},nr=[{type:"CC0-1.0",abbr:"CC0",name:"Public Domain Dedication",url:"http://creativecommons.org/publicdomain/zero/1.0"},{type:"CC-BY-4.0",abbr:"CC BY",name:"Attribution 4.0 International",url:"http://creativecommons.org/licenses/by/4.0"},{type:"CC-BY-3.0",abbr:"CC BY 3.0",name:"Attribution 3.0 Unported",url:"http://creativecommons.org/licenses/by/3.0"},{type:"CC-BY-2.5",abbr:"CC BY 2.5",name:"Attribution 2.5 Generic",url:"http://creativecommons.org/licenses/by/2.5"},{type:"CC-BY-2.0",abbr:"CC BY 2.0",name:"Attribution 2.0 Generic",url:"http://creativecommons.org/licenses/by/2.0"},{type:"CC-BY-1.0",abbr:"CC BY 1.0",name:"Attribution 1.0 Generic",url:"http://creativecommons.org/licenses/by/1.0"},{type:"CC-BY-SA-4.0",abbr:"CC BY-SA",name:"Attribution-ShareAlike 4.0 International",url:"http://creativecommons.org/licenses/by-sa/4.0"},{type:"CC-BY-SA-3.0",abbr:"CC BY-SA 3.0",name:"Attribution-ShareAlike 3.0 Unported",url:"http://creativecommons.org/licenses/by-sa/3.0"},{type:"CC-BY-SA-2.5",abbr:"CC BY-SA 2.5",name:"Attribution-ShareAlike 2.5 Generic",url:"http://creativecommons.org/licenses/by-sa/2.5"},{type:"CC-BY-SA-2.0",abbr:"CC BY-SA 2.0",name:"Attribution-ShareAlike 2.0 Generic",url:"http://creativecommons.org/licenses/by-sa/2.0"},{type:"CC-BY-SA-1.0",abbr:"CC BY-SA 1.0",name:"Attribution-ShareAlike 1.0 Generic",url:"http://creativecommons.org/licenses/by-sa/1.0"},{type:"CC-BY-ND-4.0",abbr:"CC BY-ND",name:"Attribution-NoDerivatives 4.0 International",url:"http://creativecommons.org/licenses/by-nd/4.0"},{type:"CC-BY-ND-3.0",abbr:"CC BY-ND 3.0",name:"Attribution-NoDerivs 3.0 Unported",url:"http://creativecommons.org/licenses/by-nd/3.0"},{type:"CC-BY-ND-2.5",abbr:"CC BY-ND 2.5",name:"Attribution-NoDerivs 2.5 Generic",url:"http://creativecommons.org/licenses/by-nd/2.5"},{type:"CC-BY-ND-2.0",abbr:"CC BY-ND 2.0",name:"Attribution-NoDerivs 2.0 Generic",url:"http://creativecommons.org/licenses/by-nd/2.0"},{type:"CC-BY-ND-1.0",abbr:"CC BY-ND 1.0",name:"Attribution-NoDerivs 1.0 Generic",url:"http://creativecommons.org/licenses/by-nd/1.0"},{type:"CC-BY-NC-4.0",abbr:"CC BY-NC",name:"Attribution-NonCommercial 4.0 International",url:"https://creativecommons.org/licenses/by-nc/4.0"},{type:"CC-BY-NC-3.0",abbr:"CC BY-NC 3.0",name:"Attribution-NonCommercial 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc/3.0"},{type:"CC-BY-NC-2.5",abbr:"CC BY-NC 2.5",name:"Attribution-NonCommercial 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc/2.5"},{type:"CC-BY-NC-2.0",abbr:"CC BY-NC 2.0",name:"Attribution-NonCommercial 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc/2.0"},{type:"CC-BY-NC-1.0",abbr:"CC BY-NC 1.0",name:"Attribution-NonCommercial 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc/1.0"},{type:"CC-BY-NC-SA-4.0",abbr:"CC BY-NC-SA",name:"Attribution-NonCommercial-ShareAlike 4.0 International",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},{type:"CC-BY-NC-SA-3.0",abbr:"CC BY-NC-SA 3.0",name:"Attribution-NonCommercial-ShareAlike 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc-sa/3.0"},{type:"CC-BY-NC-SA-2.5",abbr:"CC BY-NC-SA 2.5",name:"Attribution-NonCommercial-ShareAlike 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/2.5"},{type:"CC-BY-NC-SA-2.0",abbr:"CC BY-NC-SA 2.0",name:"Attribution-NonCommercial-ShareAlike 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/2.0"},{type:"CC-BY-NC-SA-1.0",abbr:"CC BY-NC-SA 1.0",name:"Attribution-NonCommercial-ShareAlike 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc-sa/1.0"},{type:"CC-BY-NC-ND-4.0",abbr:"CC BY-NC-ND",name:"Attribution-NonCommercial-NoDerivatives 4.0 International",url:"https://creativecommons.org/licenses/by-nc-nd/4.0"},{type:"CC-BY-NC-ND-3.0",abbr:"CC BY-NC-ND 3.0",name:"Attribution-NonCommercial-NoDerivs 3.0 Unported",url:"https://creativecommons.org/licenses/by-nc-nd/3.0"},{type:"CC-BY-NC-ND-2.5",abbr:"CC BY-NC-ND 2.5",name:"Attribution-NonCommercial-NoDerivs 2.5 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/2.5"},{type:"CC-BY-NC-ND-2.0",abbr:"CC BY-NC-ND 2.0",name:"Attribution-NonCommercial-NoDerivs 2.0 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/2.0"},{type:"CC-BY-NC-ND-1.0",abbr:"CC BY-NC-ND 1.0",name:"Attribution-NonCommercial-NoDerivs 1.0 Generic",url:"https://creativecommons.org/licenses/by-nc-nd/1.0"},{type:"PDDL-1.0",abbr:"PDDL",name:"ODC Public Domain Dedication and License",url:"http://opendatacommons.org/licenses/pddl/summary"},{type:"ODbL-1.0",abbr:"ODbL",name:"ODC Open Database License",url:"http://opendatacommons.org/licenses/odbl/summary"},{type:"ODC-BY-1.0",abbr:"ODC BY",name:"ODC Attribution License",url:"http://opendatacommons.org/licenses/by/summary"}];function or(r){var e={type:(r=r||"")?"custom":"none",text:r},t=!1,n=nr.filter(function(e){return t=e,(e=(e=r).toLowerCase()).includes(t.name.toLowerCase())||e.includes(t.url.toLowerCase())||e.includes(t.abbr.toLowerCase());var t});return n.length&&(t=!0,e=n.pop()),t||(n=void 0,!function(e){try{return!!new URL(e).protocol}catch(e){return!1}}(r)?(t=r,new RegExp(/^<a[\s]+(href\s?=\s?["'].*?["'])+([^>]?)>((?:.(?!\<\/a\>))*.)?<\/a>$|^<a[\s]+(href\s?=\s?["'].*?["'])+([^>]?)\/>/).test(t)&&(t=new RegExp(/href\s?=\s?["'](.*?)["']/),n=r.match(t)[1])):n=r,n&&(e.url=n,e.text="")),e.text||delete e.text,e}function ir(e,t,r){if(!e||!e.thumbnail)return null;var n=r||{},o=n.token,n=n.width,r=ct(e,t,o=!o&&"string"==typeof r?r:o).split("?"),o=r[0],r=r[1],r=new URLSearchParams(r);r.delete("f"),n&&r.append("w",n+"");r=r.toString(),e=o+"/info/"+e.thumbnail;return r?e+"?"+r:e}n.UpdateFrequency=void 0,(Ut=n.UpdateFrequency||(n.UpdateFrequency={})).Continual="continual",Ut.Daily="daily",Ut.Weekly="weekly",Ut.Fortnightly="fortnightly",Ut.Monthly="monthly",Ut.Quarterly="quarterly",Ut.Biannually="biannually",Ut.Annually="annually",Ut.AsNeeded="as-needed",Ut.Irregular="irregular",Ut.NotPlanned="not-planned",Ut.Unknown="unknown",Ut.Semimonthly="semimonthly";function ar(e,t){return{"001":n.UpdateFrequency.Continual,"002":n.UpdateFrequency.Daily,"003":n.UpdateFrequency.Weekly,"004":n.UpdateFrequency.Fortnightly,"005":n.UpdateFrequency.Monthly,"006":n.UpdateFrequency.Quarterly,"007":n.UpdateFrequency.Biannually,"008":n.UpdateFrequency.Annually,"009":n.UpdateFrequency.AsNeeded,"010":n.UpdateFrequency.Irregular,"011":n.UpdateFrequency.NotPlanned,"012":n.UpdateFrequency.Unknown,"013":n.UpdateFrequency.Semimonthly}[er(e,t||"updateFrequency")]}function sr(e,t){var r,n,o=(e=er(e,t),/^\d{4}$/.test(e=""+e)?(r=new Date(+e,0,1),o=Zt.Year):/^\d{4}-\d{1,2}$/.test(e)?(n=e.split("-"),r=new Date(+n[0],+n[1]-1,1),o=Zt.Month):/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)?(n=e.split("-"),r=new Date(+n[0],+n[1]-1,+n[2]),o=Zt.Day):Number.isNaN(Date.parse(e))||(r=new Date(e),o=e.includes("T")?Zt.Time:Zt.Day),r&&o&&{date:r,precision:o});return o&&U(U({},o),{source:"metadata."+Xt(t)})}function ur(e,t){return(e=O(e,t+=".editingInfo.lastEditDate"))&&{date:new Date(e),source:t,precision:Zt.Day}}function cr(e,t){return{date:new Date(e[t]),precision:Zt.Day,source:"item."+t}}function lr(e){return null!==(e={appbuilderExtension:"file",appbuilderWidgetPackage:"widgets-source",application:"web",applicationConfiguration:"app-gear",arcgisProMap:"desktop",cadDrawing:"file-cad",cityEngineWebScene:"urban-model",codeAttachment:"file-code",codeSample:"file-code",colorSet:"palette",contentCategorySet:"label",csv:"file-csv",cSV:"file-csv",cSVCollection:"file-csv",dashboard:"dashboard",desktopApplication:"desktop",documentLink:"link",excaliburImageryProject:"file",explorerMap:"file",exportPackage:"file",featureCollection:"data",featureCollectionTemplate:"file",featureLayer:"data",featureService:"collection",fileGeodatabase:"data",form:"survey",geocodingService:"file",geodataService:"file",geometryService:"file",geopackage:"file",geoprocessingService:"file",globeLayer:"layers",globeService:"file",hubInitiative:"initiative",hubInitiativeTemplate:"initiative-template",hubPage:"browser",hubSiteApplication:"web",image:"file-image",imageService:"data",insightsModel:"file",insightsPage:"graph-moving-average",insightsTheme:"palette",insightsWorkbook:"graph-moving-average",iWorkPages:"file-text",iWorkKeynote:"presentation",iWorkNumbers:"file-report",kML:"data",kMLCollection:"data",layer:"layers",layerPackage:"layers",layerTemplate:"file",locatorPackage:"file",mapArea:"file",mapDocument:"map-contents",mapImageLayer:"collection",mapPackage:"file",mapService:"collection",microsoftExcel:"file-report",microsoftPowerpoint:"presentation",microsoftWord:"file-text",mission:"file",mobileMapPackage:"map-contents",nativeApplication:"mobile",nativeApplicationInstaller:"file",nativeApplicationTemplate:"file",mobileApplication:"mobile",networkAnalysisService:"file",notebook:"code",orientedImageryCatalog:"file",orthoMappingProject:"file",orthoMappingTemplate:"file",pDF:"file-pdf",quickCaptureProject:"mobile",rasterFunctionTemplate:"file",rasterLayer:"map",realTimeAnalytic:"file",relationalDatabaseConnection:"file",reportTemplate:"file",sceneLayer:"data",sceneService:"urban-model",serviceDefinition:"file",shapefile:"data",solution:"puzzle-piece",sqliteGeodatabase:"file",statisticalDataCollection:"file",storymap:"tour",storyMap:"tour",storymapTheme:"palette",symbolSet:"file",table:"table",urbanModel:"urban-model",vectorTilePackage:"file-shape",vectorTileService:"map",visioDocument:"conditional-rules",webExperience:"apps",webMap:"map",webMappingApplication:"apps",webScene:"urban-model",wfs:"map",wFS:"map",wMS:"map",wMTS:"map",workflowManagerService:"file",workforceProject:"list-check"}[h(e||"")])&&void 0!==e?e:"file"}function pr(e,t){var r=(r=t.authentication)&&r.token;return{portalHome:st(e.id,t),portalApi:ct(e,t,r),portalData:ut(e,t,r),thumbnail:ir(e,t,{token:r})}}function dr(e,t){var r,n;return n=e,r=!Wt(t)&&"public"===n.access&&"CSV"===n.type&&n.size<=5e6?mt(t)+"/datasets/"+e.id+"_0/FeatureServer/0":r}function fr(e){return e&&"feature service"===e.toLowerCase()}var hr=function(e){e=e&&e.match(/\/\d+$/);return e&&e[0].slice(1)};function mr(e){var t=(e=void 0===e?{}:e).type,r=e.typeKeywords||[];return("Site Application"===e.type||"Web Mapping Application"===e.type&&E(r,"hubSite"))&&(t="Hub Site Application"),("Site Page"===e.type||"Web Mapping Application"===e.type&&E(r,"hubPage"))&&(t="Hub Page"),"Hub Initiative"===e.type&&E(r,"hubInitiativeTemplate")&&(t="Hub Initiative Template"),t="Web Mapping Application"===e.type&&E(r,"hubSolutionTemplate")?"Solution":t}function gr(e){return hr(e.url)||fr(e.type)&&e.typeKeywords&&E(e.typeKeywords,"Singlelayer")&&"0"}function br(e){if("public"===e.access){var t=e.id,e=gr(e);return e?t+"_"+e:t}}function yr(e){if(!e)return e;var t=["categories",""];return e.map(function(e){return e.split("/")}).reduce(function(e,t,r){return I(e,t)},[]).filter(function(e){return!E(t,e.toLowerCase())})}var vr=function(r,e){var t=e||{},n=t.slug,o=t.requestOptions,i=t.data,a=t.metadata,s=t.groupIds,u=t.ownerUser,c=t.org,l=t.errors,p=t.server,d=t.layers,f=t.recordCount,h=t.boundary,m=t.extent,g=t.searchDescription,b=t.statistics,y=hr(r.url),v=y?parseInt(y,10):null==e?void 0:e.layerId,w=d&&(P(v)?fr(r.type)&&function(e){e=e&&1===e.length&&e[0];return e&&e.capabilities.includes("Query")&&e}(d):d.find(function(e){return e.id===v})),A=Kt(r,o)?w?r.id+"_"+w.id:br(r):void 0,t=n||A||r.id,D=(y=d,e=r.url,w&&y&&1<y.length&&!hr(e)),S=D?w.name:r.title,x=D&&w.description,E=w?w.type:mr(r),k=U({relative:Jt(E,t,r.typeKeywords)},o&&pr(r,o)),C=dr(r,o),T=(e=r,sr((o={metadata:a,layer:w,server:p}).metadata,"reviseDate")||ur(o,"layer")||ur(o,"server")||cr(e,"modified")),q=(o=r,sr(e=a,"pubDate")||sr(e,"createDate")||cr(o,"created")),I=(o=r,sr(a,"metadataUpdatedDate")||cr(o,"modified"));return U(U({item:r},r),{slug:n,data:i,metadata:a,groupIds:s,ownerUser:u,org:c,errors:l||[],server:p,layers:d,recordCount:f,statistics:b,hubId:A,identifier:t,get isProxied(){return!!C},layer:w,name:S,get title(){return S},get description(){return g||x||r.description},type:E,get family(){return Yt(E)},get url(){return C||(D?jt(r.url)+"/"+w.id:r.url)},get categories(){return yr(r.categories)},get actionLinks(){return r.properties&&r.properties.links},get hubActions(){return r.properties&&r.properties.actions},get isDownloadable(){return Lt(r)},get structuredLicense(){return or(r.licenseInfo)},get permissions(){return{visibility:r.access,control:r.itemControl||"view"}},get extent(){return!Vt(r.extent)&&m&&Vt(m.coordinates)?m.coordinates:r.extent},get boundary(){return h||function(e){var t,r=e.extent,n=Vt(r),e=(null===(e=e.properties)||void 0===e?void 0:e.boundary)||(n?"item":void 0);switch(e){case"item":t=n?zt(r):null;break;case"none":t=null}return{provenance:e,geometry:t}}(r)},get summary(){return x||r.snippet||r.description},urls:k,get portalHomeUrl(){return k.portalHome},get portalDataUrl(){return k.portalData},get portalApiUrl(){return k.portalApi},get thumbnailUrl(){return k.thumbnail},get createdDate(){return new Date(r.created)},createdDateSource:"item.created",get updatedDate(){return T.date},get updatedDateSource(){return T.source},get updatedDatePrecision(){return T.precision},get modified(){return T.date.getTime()},get publishedDate(){return q.date},get publishedDateSource(){return q.source},get publishedDatePrecision(){return q.precision},get metadataUpdatedDate(){return I.date},get metadataUpdatedDateSource(){return I.source},get metadataUpdatedDatePrecision(){return I.precision},get updateFrequency(){return ar(a)},get metadataUpdateFrequency(){return ar(a,"metadataUpdateFrequency")},get publisher(){return{name:r.owner,username:r.owner}},get metrics(){return r.properties&&r.properties.metrics},get spatialReference(){return function(e){var t=e.spatialReference;if(!t||"object"==typeof t)return t;e=t+"",t=parseInt(e,10);return isNaN(t)?{wkt:e}:{wkid:t}}(r)||(e=p,(null===(t=null==(t=w)?void 0:t.extent)||void 0===t?void 0:t.spatialReference)||(null==e?void 0:e.spatialReference))||null;var e,t},get orgId(){return c?c.id:r.orgId||(null==u?void 0:u.orgId)},get contentTypeIcon(){return console.warn("DEPRECATED: it is now the responsibility of the consuming package to determine the icon"),lr(E)},get license(){return console.warn("DEPRECATED: use structuredLicense instead"),{name:"Custom License",description:r.accessInformation}},get hubType(){return console.warn("DEPRECATED: use family instead"),Yt(E)},get additionalResources(){return function(t,e,r){e=O(e,"metadata.distInfo.distTranOps.onLineSrc")||null;return null===e?null:(e=Array.isArray(e)?e:[e]).map(function(e){return{name:e.orName,url:rr(e,t,r),isDataSource:tr(e,t)}})}(r,a)}})};function wr(e){e=e?e.split("_"):[];return{itemId:e[0],layerId:e[1]}}function Ar(e){e=wr(e).itemId;return!(!e||B(e))}function Dr(e,t){return/.+::.+/.test(e)?e:t+"::"+e}function Sr(e,t){return t&&e.match(t+"::")?e.split(t+"::")[1]:e}var xr=(Er.prototype.startOperation=function(e){e=p(e);e.startedAt=(new Date).getTime(),e.state="working",this.operations.push(e)},Er.prototype.start=function(e,t){t={type:e,id:y(t,"id",r(e+"_")),inputs:y(t,"inputs",{}),cleanup:y(t,"cleanup","n/a"),startedAt:(new Date).getTime(),state:"working"};return this.operations.push(t),t.id},Er.prototype.getOperation=function(t){return this.operations.find(function(e){return e.id===t})},Er.prototype.getOperations=function(){return this.operations},Er.prototype.finish=function(e,t){var r=this.getOperation(e);if(!r)throw new Error("No operation with id "+e+" present in stack");r.duration=(new Date).getTime()-r.startedAt,r.state="completed",t&&(r.output=p(t))},Er.prototype.merge=function(e){this.operations=I(this.operations,e.operations)},Er.prototype.getCompleted=function(){return p(this.operations.filter(function(e){return"completed"===e.state}))},Er.prototype.getWorking=function(){return p(this.operations.filter(function(e){return"working"===e.state}))},Er.prototype.toString=function(){return this.operations.sort(function(e,t){return e.startedAt<t.startedAt?-1:t.startedAt<e.startedAt?1:0}).map(kr).join("\n")},Er.prototype.serialize=function(){return{operations:p(this.getOperations())}},Er);function Er(){this.operations=[]}function kr(e){var t=e.startedAt+" : Operation "+e.id+" started with inputs "+JSON.stringify(e.inputs)+" but was not completed";return t="completed"===e.state?e.startedAt+" : Operation "+e.id+" took "+e.duration+" ms with inputs "+JSON.stringify(e.inputs)+" and output "+(e.output?JSON.stringify(e.output):"n/a"):t}var Cr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tr(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}function qr(e,t,r){this.tagname=e,this.parent=t,this.child=[],this.attrsMap,this.val=r,this.addChild=function(e){this.child.push(e)}}function Ir(e,t){t=Object.assign({},Nr,t),e=e.replace(/<!--[\s\S]*?-->/g,"");for(var r=new qr("!xml"),n=r,o=new RegExp("<((!\\[CDATA\\[([\\s\\S]*?)(\\]\\]>))|(([\\w:\\-\\._]*:)?([\\w:\\-\\._]+))([^>]*)>|((\\/)(([\\w:\\-\\._]*:)?([\\w:\\-\\._]+))>))([^<]*)","g"),i=o.exec(e),a=o.exec(e);i;){var s,u="]]>"===(u=i)[4]?Ur.CDATA:"/"===u[10]?Ur.CLOSING:void 0!==u[8]&&"/"===u[8].substr(u[8].length-1)?Ur.SELF:Ur.OPENING;u===Ur.CLOSING?(n.parent&&i[14]&&(n.parent.val=Or.getValue(n.parent.val)+""+Rr(i[14],t)),n=n.parent):u===Ur.CDATA?t.cdataTagName?((s=new qr(t.cdataTagName,n,i[3])).attrsMap=_r(i[8],t),n.addChild(s),n.val=Or.getValue(n.val)+t.cdataPositionChar,i[14]&&(n.val+=Rr(i[14],t))):n.val=(n.val||"")+(i[3]||"")+Rr(i[14],t):u===Ur.SELF?(s=new qr(t.ignoreNameSpace?i[7]:i[5],n,""),i[8]&&1<i[8].length&&(i[8]=i[8].substr(0,i[8].length-1)),s.attrsMap=_r(i[8],t),n.addChild(s)):((s=new qr(t.ignoreNameSpace?i[7]:i[5],n,Rr(i[14],t))).attrsMap=_r(i[8],t),n.addChild(s),n=s),i=a,a=o.exec(e)}return r}var Or=Tr(function(e,t){function r(e,t){return null!=(e=t.exec(e))}t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t){if(t)for(var r=Object.keys(t),n=r.length,o=0;o<n;o++)e[r[o]]=t[r[o]]},t.getValue=function(e){return t.isExist(e)?e:""},t.doesMatch=r,t.doesNotMatch=function(e,t){return!r(e,t)},t.getAllMatches=function(e,t){for(var r=[],n=t.exec(e);n;){for(var o=[],i=n.length,a=0;a<i;a++)o.push(n[a]);r.push(o),n=t.exec(e)}return r}}),Pr=Tr(function(I,O){!function(e){var t=O,r=I&&I.exports==t&&I,n="object"==typeof Cr&&Cr;n.global!==n&&n.window!==n||(e=n);function f(e,t){return x.call(e,t)}function s(e,t){if(!e)return t;var r,n={};for(r in t)n[r]=(f(e,r)?e:t)[r];return n}function h(e,t){var r="";return 55296<=e&&e<=57343||1114111<e?(t&&E("character reference outside the permissible Unicode range"),"�"):f(A,e)?(t&&E("disallowed character reference"),A[e]):(t&&function(e,t){for(var r=-1,n=e.length;++r<n;)if(e[r]==t)return!0;return!1}(D,e)&&E("disallowed character reference"),65535<e&&(r+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),r+=S(e))}function u(e){return"&#x"+e.toString(16).toUpperCase()+";"}function c(e){return"&#"+e+";"}var l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=/[\x01-\x7F]/g,d=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,m=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,g={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"},b=/["&'<>`]/g,o={'"':"&quot;","&":"&amp;","'":"&#x27;","<":"&lt;",">":"&gt;","`":"&#x60;"},i=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,y=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g,v={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},w={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},A={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},D=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],S=String.fromCharCode,x={}.hasOwnProperty,E=function(e){throw Error("Parse error: "+e)},k=function(e,t){(t=s(t,k.options)).strict&&y.test(e)&&E("forbidden code point");function r(e){return a(e.charCodeAt(0))}var n=t.encodeEverything,o=t.useNamedReferences,i=t.allowUnsafeSymbols,a=t.decimal?c:u;return n?(e=e.replace(p,function(e){return o&&f(g,e)?"&"+g[e]+";":r(e)}),o&&(e=e.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),o&&(e=e.replace(m,function(e){return"&"+g[e]+";"}))):o?e=(e=(e=!i?e.replace(b,function(e){return"&"+g[e]+";"}):e).replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;")).replace(m,function(e){return"&"+g[e]+";"}):i||(e=e.replace(b,r)),e.replace(l,function(e){var t=e.charCodeAt(0),e=e.charCodeAt(1);return a(1024*(t-55296)+e-56320+65536)}).replace(d,r)};k.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var C=function(e,p){var d=(p=s(p,C.options)).strict;return d&&i.test(e)&&E("malformed character reference"),e.replace(a,function(e,t,r,n,o,i,a,s){var u,c,l;return t?(c=t,u=r,d&&!u&&E("character reference was not terminated by a semicolon"),c=parseInt(c,10),h(c,d)):n?(n=n,u=o,d&&!u&&E("character reference was not terminated by a semicolon"),c=parseInt(n,16),h(c,d)):i?f(v,l=i)?v[l]:(d&&E("named character reference was not terminated by a semicolon"),e):(l=a,(s=s)&&p.isAttributeValue?(d&&"="==s&&E("`&` did not start a character reference"),e):(d&&E("named character reference was not terminated by a semicolon"),w[l]+(s||"")))})};C.options={isAttributeValue:!1,strict:!1};var T={version:"1.1.1",encode:k,decode:C,escape:function(e){return e.replace(b,function(e){return o[e]})},unescape:C};if(t&&!t.nodeType)if(r)r.exports=T;else for(var q in T)f(T,q)&&(t[q]=T[q]);else e.he=T}(Cr)}),Ur={OPENING:1,CLOSING:2,SELF:3,CDATA:4},Nr={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,decodeHTMLchar:!1,cdataTagName:!1,cdataPositionChar:"\\c"};function Rr(e,t){return e&&(t.trimValues&&(e=e.trim()),e=Fr(e=t.decodeHTMLchar?Pr.decode(e):e,t.parseNodeValue)),e}function Fr(e,t){return t&&"string"==typeof e?e=""===e.trim()||isNaN(e)?"true"===e||"false"!==e&&e:-1!==e.indexOf(".")?Number.parseFloat(e):Number.parseInt(e,10):Or.isExist(e)?e:""}var Lr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function _r(e,t){if(!t.ignoreAttributes&&"string"==typeof e){e=e.replace(/\r?\n/g," ");for(var r=Or.getAllMatches(e,Lr),n=r.length,o={},i=0;i<n;i++){var a=function(e,t){if(t.ignoreNameSpace){var r=e.split(":"),t="/"===e.charAt(0)?"/":"";if("xmlns"===r[0])return"";2===r.length&&(e=t+r[1])}return e}(r[i][1],t);a.length&&(void 0!==r[i][4]?(t.trimValues&&(r[i][4]=r[i][4].trim()),t.decodeHTMLchar&&(r[i][4]=Pr.decode(r[i][4],{isAttributeValue:!0})),o[t.attributeNamePrefix+a]=Fr(r[i][4],t.parseAttributeValue)):t.allowBooleanAttributes&&(o[t.attributeNamePrefix+a]=!0))}if(Object.keys(o).length){if(t.attrNodeName){e={};return e[t.attrNodeName]=o,e}return o}}}var jr=function(e,t){for(var r={},n=0;n<e.child.length;n++){var o,i=e.child[n].tagname,a=jr(e.child[n],t);void 0!==r[i]?(Array.isArray(r[i])||(o=r[i],r[i]=[],r[i].push(o)),r[i].push(a)):r[i]=t.arrayMode?[a]:a}return Or.merge(r,e.attrsMap),Or.isEmptyObject(r)?Or.isExist(e.val)?e.val:"":(Or.isExist(e.val)&&("string"!=typeof e.val||""!==e.val&&e.val!==t.cdataPositionChar)&&(r[t.textNodeName]=e.val),r)},Br={parse:function(e,t){return t=Object.assign({},Nr,t),jr(Ir(e,t),t)},getTraversalObj:Ir,convertToJson:jr}.parse;function Mr(e,t){return Ce(e,U(U({},t),{fileName:"metadata/metadata.xml"})).then(function(e){return Br(e,{ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#value"})}).catch(function(){return null})}var Gr,Vr=function(e,t,r){var n=t.data,o=t.stack,t=t.requestOptions;o.finish(r,{error:e});r="string"==typeof e?e:e.message,e=n.errors||[];return e.push({type:"Other",message:r}),{data:U(U({},n),{errors:e}),stack:o,requestOptions:t}},Hr={groupIds:function(t){var e,r=t.data,n=t.stack,o=t.requestOptions,i=n.start("enrichGroupIds");return e=r.item.id,te(xe(e,e=o)+"/groups",e).then(function(e){e=I(e.admin,e.member,e.other).map(function(e){return e.id});return n.finish(i),{data:U(U({},r),{groupIds:e}),stack:n,requestOptions:o}}).catch(function(e){return Vr(e,t,i)})},metadata:function(e){var t=e.data,r=e.stack,n=e.requestOptions,o=r.start("enrichMetadata");return Mr(t.item.id,n).then(function(e){return r.finish(o),{data:U(U({},t),{metadata:e}),stack:r,requestOptions:n}})},ownerUser:function(t){var r=t.data,n=t.stack,o=t.requestOptions,i=n.start("enrichOwner");return We(U({username:r.item.owner},o)).then(function(e){return n.finish(i),{data:U(U({},r),{ownerUser:e}),stack:n,requestOptions:o}}).catch(function(e){return Vr(e,t,i)})},data:function(t){var r=t.data,n=t.stack,o=t.requestOptions,i=n.start("enrichData");return Ee(r.item.id,o).then(function(e){return n.finish(i),{data:U(U({},r),{data:e}),stack:n,requestOptions:o}}).catch(function(e){return Vr(e,t,i)})},server:function(t){var r=t.data,n=t.stack,o=t.requestOptions,i=n.start("enrichServer"),e=r.item.url,e=U(U({},o),{url:e});return te(ne((e=e).url),e).then(function(e){return n.finish(i),{data:U(U({},r),{server:e}),stack:n,requestOptions:o}}).catch(function(e){return Vr(e,t,i)})},layers:function(t){var e,r=t.data,n=t.stack,o=t.requestOptions,i=n.start("enrichLayers"),a=r.item.url,s=U(U({},o),{url:a});return e=s,a=s.url,e=C(s,["url"]),te(jt(a)+"/layers",e).then(function(e){return I(e.layers,e.tables).filter(function(e){return"Group Layer"!==e.type})}).then(function(e){return n.finish(i),{data:U(U({},r),{layers:e}),stack:n,requestOptions:o}}).catch(function(e){return Vr(e,t,i)})}},zr=(e(Yr,Gr=Error),Yr);function Yr(e,t,r){e=Gr.call(this,e)||this;return e.status=r,e.url=t,e}function Wr(e,t){var r,n,o=U({httpMethod:"GET"},t),i=o.fetch||fetch,t=U({"Content-Type":"application/json"},o.headers);"GET"===o.httpMethod?r=o.params:n=JSON.stringify(o.params);var a=ge({host:mt(o),path:("/api/v3/"+e).replace(/\/\//g,"/"),query:r});return i(a,{method:o.httpMethod,headers:t,body:n}).then(function(e){if(e.ok)return e.json();throw new zr(e.statusText,a,e.status)})}function Kr(e){var t=["groupIds","metadata","ownerUser","org"];return function(e){e=mr(e);return E(["template","solution"],Yt(e))||E(["Web Map","Web Scene"],e)}(e)&&t.push("data"),dt(e.url)?t.concat("server","layers"):t}function Jr(e,t){return(e=p(e)).params=U(U({},e.params),{"fields[datasets]":"slug,boundary,extent,searchDescription,statistics"}),t&&(e.params["filter[slug]"]=t),e}function Zr(e){var t=(r=wr(e.id)).itemId,r=(r=r.layerId)&&parseInt(r,10),e=e.attributes;return{itemId:t,layerId:r,slug:e.slug,boundary:e.boundary,extent:e.extent,searchDescription:e.searchDescription,statistics:e.statistics}}function Qr(r,n){return T(void 0,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return[4,Wr("/datasets/"+r,Jr(n))];case 1:return t=e.sent(),[2,Zr(t.data)]}})})}function $r(n,o){return T(void 0,void 0,void 0,function(){var t,r;return q(this,function(e){switch(e.label){case 0:return[4,Se(n,o)];case 1:return t=e.sent(),r=(null==o?void 0:o.enrichments)||Kr(t),[4,function(e,t,r){t=t.reduce(function(e,t){t=Hr[t];return t&&e.push(t),e},[]);return L(t)({data:{item:e},stack:new xr,requestOptions:r}).then(function(e){return e.data})}(t,r,o)];case 2:return r=e.sent(),[2,U(U({},r),{item:t})]}})})}function Xr(f,h){return T(void 0,void 0,void 0,function(){var t,o,i,a,s,u,c,l,p,d;return q(this,function(e){switch(e.label){case 0:return[4,(r=f,n=h,T(void 0,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return[4,Wr("/datasets",Jr(n,r))];case 1:return t=e.sent(),[2,Zr(t.data[0])]}})}))];case 1:return t=e.sent(),o=t.itemId,i=t.layerId,[4,$r(o,h)];case 2:return(p=e.sent(),a=p.item,s=C(p,["item"]),(d=h&&!P(h.layerId)&&h.layerId)&&d!==i)?[4,Qr(o+"_"+(i=d),h)]:[3,4];case 3:t=e.sent(),e.label=4;case 4:return u=t.slug,c=t.boundary,l=t.extent,p=t.searchDescription,d=t.statistics,[2,vr(a,U(U({requestOptions:h},s),{layerId:i,slug:u,boundary:c,extent:l,searchDescription:p,statistics:d}))]}var r,n})})}function en(e){void 0===e&&(e=""),console.warn("DEPRECATED: Use getCollection() instead. getCategory will be removed at v10.0.0");e=St(e);return"feedback"===e?"app":e}function tn(t,e){if(E(["template","feedback"],t.family))return t.id;if(Qt(t.type)){var r=(O(e,"data.values.pages")||[]).find(function(e){return e.id===t.id});return r?r.slug:t.id}if(t.slug){r=O(e,"domainInfo.orgKey");return O(e,"data.values.isUmbrella")?t.slug:Sr(t.slug,r)}return t.hubId||t.id}function rn(e){return vr(e)}function nn(e){if(e){var t=e.id,r=e.attributes;if(r){var n=wr(t).itemId,o=r.owner,i=r.orgId,a=r.created,s=r.modified,u=r.name,c=r.title,l=r.type,p=r.typeKeywords,d=r.description,f=r.snippet,h=r.tags,m=r.thumbnail,g=r.categories,b=r.contentStatus,y=r.spatialReference,v=r.accessInformation,w=r.licenseInfo,A=r.culture,D=r.url,S=r.access,x=r.proxyFilter,E=r.properties,k=r.appCategories,C=r.industries,T=r.languages,q=r.largeThumbnail,I=r.banner,O=r.screenshots,P=r.listed,U=r.ownerFolder,N=r.size,R=r.protected,F=r.commentsEnabled,L=r.numComments,_=r.numRatings,j=r.avgRating,B=r.numViews,M=r.itemControl,G=r.scoreCompleteness,V=r.itemExtent,e=r.itemModified,t=r.modifiedProvenance,r=r.serviceSpatialReference;return{id:n,owner:o,orgId:i,created:a,modified:e||"item.modified"===t&&s,title:c||u,type:D&&ht(D)||l,typeKeywords:p,description:d,tags:h,snippet:f,thumbnail:m,extent:V||[],categories:g,contentStatus:b,spatialReference:y||r,accessInformation:v,licenseInfo:w,culture:A,url:D,access:S,size:N,protected:R,proxyFilter:x,properties:E,appCategories:k,industries:C,languages:T,largeThumbnail:q,banner:I,screenshots:O,listed:P,ownerFolder:U,commentsEnabled:F,numComments:L,numRatings:_,avgRating:j,numViews:B,itemControl:M,scoreCompleteness:G}}}}function on(e,t){var r=tn(e,t);return{relative:r=cn(e,r),absolute:""+O(t,"item.url").replace(/\/$/,"")+r}}var an=function(e,t){return t?"CSV":h(e||"")},sn=function(e,t){var r=on(e,t),t=r.relative,r=r.absolute;return un(e,{relative:t,site:r})},un=function(e,t){t=U(U({},e.urls),t);return U(U({},e),{urls:t})},cn=function(e,t){return Jt(e.type,t||e.identifier,e.typeKeywords)};const ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const pn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var dn={atob:function(t){if((t=(t=(t=`${t}`).replace(/[ \t\n\f\r]/g,"")).length%4==0?t.replace(/==?$/,""):t).length%4==1||/[^+/0-9A-Za-z]/.test(t))return null;let r="",n=0,o=0;for(let e=0;e<t.length;e++)n<<=6,n|=function(e){e=ln.indexOf(e);return e<0?void 0:e}(t[e]),o+=6,24===o&&(r+=String.fromCharCode((16711680&n)>>16),r+=String.fromCharCode((65280&n)>>8),r+=String.fromCharCode(255&n),n=o=0);return 12===o?(n>>=4,r+=String.fromCharCode(n)):18===o&&(n>>=2,r+=String.fromCharCode((65280&n)>>8),r+=String.fromCharCode(255&n)),r},btoa:function(e){let t;for(e=`${e}`,t=0;t<e.length;t++)if(255<e.charCodeAt(t))return null;let r="";for(t=0;t<e.length;t+=3){const n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(t)>>2,n[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(n[1]|=e.charCodeAt(t+1)>>4,n[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(n[2]|=e.charCodeAt(t+2)>>6,n[3]=63&e.charCodeAt(t+2));for(let e=0;e<n.length;e++)void 0===n[e]?r+="=":r+=function(e){if(0<=e&&e<64)return pn[e];return}(n[e])}return r}},fn="4326",hn={csv:{name:"CSV",itemTypes:["CSV","CSV Collection"],supportsProjection:!0},kml:{name:"KML",itemTypes:["KML","KML Collection"],supportsProjection:!1},shapefile:{name:"Shapefile",itemTypes:["Shapefile"],supportsProjection:!0},fileGeodatabase:{name:"File Geodatabase",itemTypes:["File Geodatabase"],supportsProjection:!0},geojson:{name:"GeoJson",itemTypes:["GeoJson"],supportsProjection:!1},excel:{name:"Excel",itemTypes:["Microsoft Excel"],supportsProjection:!0},featureCollection:{name:"Feature Collection",itemTypes:["Feature Collection"],supportsProjection:!0}};function mn(e){if("object"!=typeof e)return e;var t=e.wkid,e=e.wkt;return t?t+"":dn.btoa(e)}function gn(e){return"spatialRefId:"+mn(function(t){var r;try{r=JSON.parse(t)}catch(e){r=t}return r}(e))}function bn(e){return"exportItem:"+e}function yn(e){return e?"exportLayer:0"+e:"exportLayer:null"}function vn(e){var t,r=e.autoAddResult,n=e.inviteResult,o=e.primaryEmailResult,e=e.secondaryEmailResult;return(o||e)&&(t={success:(e=[o,e].filter(function(e){return e})).every(function(e){return e.success})},(e=e.reduce(function(e,t){return e.concat(y(t,"errors",[]))},[])).length&&(t.errors=e)),{success:[r,n,t].filter(function(e){return e}).every(function(e){return e.success}),autoAdd:r,invite:n,email:t}}function wn(t,e){var r;return t&&(r=!O(t,"notAdded.length")&&!t.errors,e.autoAddResult={success:r},r||(r=t.errors||[],O(t,"notAdded.length")&&r.push(new K("Users not auto-added: "+t.notAdded.join(", "))),e.autoAddResult.errors=r,r=e.usersToAutoAdd.filter(function(e){return E(t.notAdded,e.username)}),e.usersToInvite=e.usersToInvite.concat(r))),e}function An(e,t){return e.orgId===t.orgId}function Dn(e){return"org_admin"===e.role&&!e.roleId}function Sn(e,t,r,n){var o=Promise.resolve(null);return e.length&&(e={authentication:r,message:t.body,subject:t.subject,notificationChannelType:"email",users:e.map(function(e){return e.username})},n||(e.batchSize=1),o=ze(e)),o}function xn(t){var r,e=Promise.resolve(t);return t.email&&t.secondaryRO&&O(t,"inviteResult.success")&&(r=y(t,"secondaryRO.portalSelf.user",{}),e=Sn(t.usersToInvite.filter(function(e){return An(e,r)}),t.email,t.secondaryRO.authentication,Dn(r)).then(function(e){return t.secondaryEmailResult=e,t})),e}function En(e,t,r){var n=Promise.resolve(null);return n=t.length?Fe({id:e,users:t.map(function(e){return e.username}),authentication:r}):n}function kn(t){return En(O(t,"groupId"),O(t,"usersToAutoAdd"),O(t,"primaryRO.authentication")).then(function(e){return wn(e,t)})}function Cn(e,t,r,n,o){void 0===n&&(n=20160),void 0===o&&(o="group_member");var i=Promise.resolve(null);return i=t.length?Be({id:e,users:t.map(function(e){return e.username}),authentication:r,role:o,expiration:n}):i}function Tn(t){return Cn(O(t,"groupId"),O(t,"usersToInvite"),O(t,"primaryRO.authentication")).then(function(e){return t.inviteResult=e,t})}function qn(t){var e=Promise.resolve(t);return e=t.email&&O(t,"inviteResult.success")?Sn(t.usersToEmail,t.email,t.primaryRO.authentication,Dn(t.requestingUser)).then(function(e){return t.primaryEmailResult=e,t}):e}function In(e,t){var r,n=[];return-1!==t.privileges.indexOf("portal:admin:assignToGroups")&&(r=[t.orgId,t.cOrgId].filter(function(e){return e}),n=e.filter(function(e){return-1!==r.indexOf(e.orgId)})),n}function On(e,t){var r=In(e,t);return e.filter(function(t){return!r.some(function(e){return e.username===t.username})})}function Pn(e,t,r){void 0===r&&(r=!1);e=On(e,t).filter(function(e){return An(e,t)});return r&&e.push(t),e}var Un=["ar","bs","ca","cs","da","de","en","es","et","el","fi","fr","hr","he","hu","it","id","ja","ko","lt","lv","nb","nl","pl","pt","pt-br","pt-pt","ro","ru","sl","sr","sv","th","tr","uk","vi","zh","zh-cn","zh-tw","zh-hk"];function Nn(e,t){if("object"==typeof e&&null!==e&&"string"==typeof t){for(var r=t.split("."),n=0;n<r.length-1;n++){if(!e.hasOwnProperty(r[n]))return;e=e[r[n]]}delete e[r[r.length-1]]}}function Rn(e){var t=p(e.item);return t.text=JSON.stringify(e.data),t}function Fn(e,t){return Promise.all([Se(e,t),Ee(e,t)]).then(function(e){return{item:e[0],data:e[1]}})}function Ln(e,r){return uo(e,r).then(function(e){var t=[Promise.resolve(e)];return e?t.push(Ee(e.id,r)):t.push(Promise.resolve(null)),Promise.all(t)}).then(function(e){return e[0]?{item:e[0],data:e[1]}:null})}function _n(e,t){var r=p(e),n=p(e.item);return n.data=p(e.data),Ae(U({item:n},t)).then(function(e){return r.item.id=e.id,r.item.created=(new Date).getTime(),r.item.modified=r.item.created,r})}function jn(e,t){var r=p(e),n=p(e.item);return n.data=p(e.data),we(U({item:n},t)).then(function(){return r.item.modified=(new Date).getTime(),r})}function Bn(r,n){return T(this,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return[4,Ee(r.id,n)];case 1:return t=e.sent(),[2,{item:r,data:t}]}})})}var Mn=function(e,t,r){return void 0===r&&(r=void 0),t.split(".").reduce(function(e,t){return e?e[t]:r},e)};function Gn(r,n){return Object.keys(r).reduce(function(e,t){return e[t]=n(r[t],t,r),e},{})}var Vn=function(e){return e instanceof Date},Hn=function(e){return"function"==typeof e},zn=function(e){return"object"==typeof e},Yn=function(e){return e instanceof RegExp};var Wn=function(e){return"object"==typeof e};function Kn(e){return Array.isArray(e)?function(e){var t=e,e=e.reduce(function(e,t){return Qn(t)&&Zn(t)&&(e<(t=Jn(t))&&(e=t)),e},-1);-1<e&&(t=0===e?[]:"{{delete:"+(e-1)+"}}");return t}(e.map(t).filter(function(e){return null!=e})):e&&Wn(e)?function(o){var e=Object.keys(o).reduce(function(e,t){var r,n=o[t];return Qn(n)&&Zn(n)?(r=Jn(n))>e.maxLevel&&(e.maxLevel=r):e.obj[t]=n,e},{obj:{},maxLevel:-1});e=0<e.maxLevel?1===e.maxLevel?void 0:"{{delete:"+(e.maxLevel-1)+"}}":e.obj;return e}(Gn(e,t)):function(e){var t=e;"string"==typeof e&&Zn(e)&&(t=function(e){var t=e,e=Jn(e);t=0===e?void 0:"{{delete:"+e+"}}";return t}(e));return t}(e);function t(e,t){return Kn(e)}}var Jn=function(e){return parseInt(e.replace(/{|}/g,"").split(":")[1])};function Zn(e){return e&&"string"==typeof e&&-1<e.indexOf("{{delete")}var Qn=function(e){return"string"==typeof e};function $n(e,t,r,n){return void 0===n&&(n=0),t?t:"{{delete:"+n+"}}"}var Xn=function(e){var t={};if(Array.isArray(e))t=e.map(Xn);else if("object"==typeof e)for(var r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=Xn(e[r]):t[r]=e[r];else t=e;return t},eo=/{{\s*?[\w].*?}}/g,to=function(e){return"string"==typeof e};function ro(e){return e||""===e||0===e}function no(e,a,s){if((s=Xn(s=void 0===s?null:s)||{}).optional)throw new Error("Please do not pass in an `optional` transform; adlib provides that internally.");return s.optional=$n,Kn(function r(e,n,o){return o=o||"",Array.isArray(e)?e.map(t):!e||!zn(e)||Vn(e)||Yn(e)||Hn(e)?n(e,o):Object.assign({},e,Gn(e,t));function t(e,t){return r(e,n,o?o+"."+t:t)}}(e,function(t,e){if(!to(t))return t;var r,n=t.match(eo);return n&&n.length?(n.map(function(e){var o,i=!1,t=e.replace(/{|}/g,"").trim();-1<t.indexOf("||")&&(r=t.split("||").map(function(e){return e.trim()}),o=r.length,t=r.find(function(e,t){var r,n;return(n=a,r=(r=e).split(":")[0],null!=(r=Mn(n,r,null)))?e:t+1===o&&(i=!0,isNaN(e)?e:parseInt(e))}));var r={key:e,value:t};return i||(t=function(e,t,r){var n,o=e.split(":");if(1<o.length){var i,a=o[0],s=o[1];if(o[2]&&(i=o[2]),!r||!r[s]||"function"!=typeof r[s])throw new Error("Attempted to apply non-existant transform "+s+" on "+a+" with params "+e);n=Mn(t,a),n=r[s](a,n,t,i)}else n=Mn(t,e);return n}(t,a,s),r.value=ro(t)?t:e),r}).forEach(function(e){t===e.key?("string"==typeof e.value&&(isNaN(e.value)||""===e.value||(-1<e.value.indexOf(".")?e.value=parseFloat(e.value):e.value=parseInt(e.value))),r=e.value):t=t.replace(e.key,e.value)}),ro(r)?r:t):t}))}function oo(e,t,r){return no(e,t,r)}function io(e,t,r){return Ne({q:'title:"'+e+'" AND '+Object.keys(t).map(function(e){return e+':"'+t[e]+'"'}).join(" AND "),authentication:r}).then(function(e){return 0<e.results.length}).catch(function(e){throw Error("Error in doesItemExistWithTitle "+e)})}function ao(e,t){return t.toLowerCase()+"-"+M(e)}function so(e,t){e=e.filter(function(e){return!e.startsWith("slug|")});return e.push("slug|"+t),e}function uo(e,t){return co({slug:e},t).then(function(e){return e.length?e[0]:null})}function co(e,t){t={q:"",filter:'typekeywords:"slug|'+e.slug+'"',authentication:t.authentication};return e.exclude&&(t.q="NOT id:"+e.exclude),Ne(t).then(function(e){return e.results}).catch(function(e){throw Error("Error in getItemBySlug "+e)})}function lo(t,r,n){var o=t.slug;return co({slug:o=(n=void 0===n?0:n)?t.slug+"-"+n:o,exclude:t.existingId},r).then(function(e){return e.length?lo(t,r,++n):o}).catch(function(e){throw Error("Error in getUniqueSlug "+e)})}var po=["id","isOrgItem","proxyFilter","ownerFolder","protected","owner","created","modified","guid","name","access","size","listed","numComments","numRatings","avgRating","numViews","scoreCompleteness","groupDesignations","listed","screenshots","banner","appCategories","industries","languages","largeThumbnail"];function fo(n,o,i,a){return T(this,void 0,void 0,function(){var t,r;return q(this,function(e){switch(e.label){case 0:t=U({item:{id:n},params:{thumbnail:o},filename:i},a),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,we(t)];case 2:if(!e.sent().success)throw new Oi("Set Project Thumbnail","Unknown error setting thumbnail.");return[3,4];case 3:throw(r=e.sent())instanceof Error?new Oi("Set Project Thumbnail",r.message,r):new Oi("Set Project Thumbnail","Unknown error setting thumbnail.");case 4:return[2]}})})}var ho=(mo.prototype.modelToObject=function(e,t){return r=this.mappings,go(e,"modelKey",t,"objectKey",r);var r},mo.prototype.objectToModel=function(e,t){return r=this.mappings,go(e,"objectKey",t,"modelKey",r);var r},mo);function mo(e){this.mappings=e}function go(r,n,e,o,t){var i=p(e);return t.forEach(function(e){var t=O(e,n),e=O(e,o),t=O(r,t);null!=t&&b(i,e,t)}),i}var Pt="Hub Project",bo={name:"No title provided",tags:[],typeKeywords:["Hub Project"],status:"inactive"},yo={item:{type:Pt,title:"No Title Provided",description:"No Description Provided",snippet:"",tags:[],typeKeywords:["Hub Project"],properties:{slug:""}},data:{display:"about",timeline:{},status:"inactive",contacts:[],schemaVersion:1}};function vo(){var t=[];return["created","culture","description","extent","id","modified","owner","snippet","tags","typeKeywords","url","type"].forEach(function(e){t.push({objectKey:e,modelKey:"item."+e})}),["contacts","display","geometry","headerImage","layout","location","status"].forEach(function(e){t.push({objectKey:e,modelKey:"data."+e})}),t.push({objectKey:"slug",modelKey:"item.properties.slug"}),t.push({objectKey:"orgUrlKey",modelKey:"item.properties.orgUrlKey"}),t.push({objectKey:"name",modelKey:"item.title"}),t}function wo(i,a){return T(this,void 0,void 0,function(){var t,r,n,o;return q(this,function(e){switch(e.label){case 0:return(t=U(U({},bo),i)).slug||(t.slug=ao(t.name,t.orgUrlKey)),[4,lo({slug:(r=t).slug},a)];case 1:return r.slug=e.sent(),t.typeKeywords=so(t.typeKeywords,t.slug),n=new ho(vo()),[4,_n(o=n.objectToModel(t,p(yo)),a)];case 2:return o=e.sent(),[2,n.modelToObject(o,{})]}})})}function Ao(o,i){return T(this,void 0,void 0,function(){var t,r,n;return q(this,function(e){switch(e.label){case 0:return[4,lo({slug:(t=o).slug,existingId:o.id},i)];case 1:return t.slug=e.sent(),[4,Fn(o.id,i)];case 2:return n=e.sent(),r=new ho(vo()),[4,jn(r.objectToModel(o,n),i)];case 3:return n=e.sent(),[2,r.modelToObject(n,o)]}})})}function Do(e,n){e=(B(e)?Fn:Ln)(e,n);return e.then(function(e){var t,r=new ho(vo()).modelToObject(e,{});return n.authentication&&(t=n.authentication.token),r.thumbnailUrl=ir(e.item,n,t),r})}function So(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){switch(e.label){case 0:return[4,Ie(U(U({},r),{id:t}))];case 1:return e.sent(),[2]}})})}function xo(n,o){var i;return T(this,void 0,void 0,function(){var t,r;return q(this,function(e){return t=Ko([{filterType:"content",typekeywords:{exact:["HubProject"]}},n]),t=Jo(t),r=ei(t),null!==(i=o.aggregations)&&void 0!==i&&i.length&&(r.countFields=o.aggregations.join(","),r.countSize=200),["authentication","num","sortField","sortOrder","site"].forEach(function(e){o.hasOwnProperty(e)&&(r[e]=o[e])}),[2,Eo(r)]})})}function Eo(s){return T(this,void 0,void 0,function(){var t,r,n,o,i,a;return q(this,function(e){switch(e.label){case 0:return[4,Ne(s)];case 1:return t=e.sent(),r=-1<t.nextStart,i=t.results.map(function(e){return Bn(e,{authentication:s.authentication})}),[4,Promise.all(i)];case 2:return a=e.sent(),n=new ho(vo()),s.authentication&&(i=s.authentication,o=i.token),a=a.map(function(e){var t=n.modelToObject(e,{});return t.thumbnailUrl=ir(e.item,{authentication:s.authentication},o),t}),[2,{total:t.total,results:a,facets:[],hasNext:r,next:Vo(s,t.nextStart,t.total,Eo)}]}})})}var ko=(Co.init=function(e){return new Co(e)},Object.defineProperty(Co.prototype,"context",{get:function(){return this._contextManager?this._contextManager.context:this._context},enumerable:!1,configurable:!0}),Co.prototype.create=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){if(r||this.context.isAuthenticated)return t.orgUrlKey||(t.orgUrlKey=this.context.portal.urlKey),[2,wo(t,r||this.context.userRequestOptions)];throw new Oi("Create Project","Creating Hub Projects requires authentication.")})})},Co.prototype.update=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){if(r||this.context.isAuthenticated)return[2,Ao(t,r||this.context.userRequestOptions)];throw new Oi("Update Project","Updating Hub Projects requires authentication.")})})},Co.prototype.destroy=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){if(r||this.context.isAuthenticated)return[2,So(t,r||this.context.userRequestOptions)];throw new Oi("Destroy Project","Destroying Hub Projects requires authentication.")})})},Co.prototype.get=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){return console.warn("HubProjectManager.get is deprecated and will be removed. Use .fetch() instead."),[2,this.fetch(t,r)]})})},Co.prototype.fetch=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){if(r||this.context.requestOptions)return[2,Do(t,r||this.context.requestOptions)];throw new Oi("Fetch Project","Can not retrieve context.requestOptions from Context Manager. HubProjectManager is configured incorrectly.")})})},Co.prototype.search=function(t,r){return T(this,void 0,void 0,function(){return q(this,function(e){return!r.authentication&&this.context.session&&(r.authentication=this.context.session),[2,xo(t,r)]})})},Co.prototype.updateThumbnail=function(r,n,o,i){return T(this,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return t=i||this.context.userRequestOptions,[4,fo(r.id,n,o,t)];case 1:return e.sent(),[2,this.fetch(r.id,i)]}})})},Co);function Co(e){e instanceof At?this._contextManager=e:this._context=e}function To(e,t){var r=e;return r=-1===e.indexOf("token")&&-1<e.indexOf(t.authentication.portal)?e+"?token="+t.authentication.token:r}function qo(e,t){return(t=void 0===t?{}:t).credentials||(t.credentials="same-origin"),fetch(e,t).then(function(e){return e.blob()})}function Io(r){return qo(r.url).then(function(e){return ve(t={id:r.id,owner:r.owner,name:r.fileName,resource:e,authentication:r.authentication}).then(function(e){e=be(t)+"/content/users/"+e+"/items/"+t.id+"/addResources";return t.params=U({file:t.resource,fileName:t.name,resourcesPrefix:t.prefix,text:t.content,access:t.private?"private":"inherit"},t.params),te(e,t)});var t})}function Oo(t){return qo(t.url).then(function(e){return we({item:{id:t.id,owner:t.owner},params:{fileName:t.fileName,thumbnail:e},authentication:t.authentication}).catch(function(e){return Promise.resolve()})}).catch(function(e){return Promise.resolve()})}var Po={arcgis:{label:"ArcGIS Online",url:"https://www.arcgis.com",type:"arcgis"},arcgisQA:{label:"ArcGIS Online QAEXT",url:"https://qaext.arcgis.com",type:"arcgis"},arcgisDEV:{label:"ArcGIS Online DEVEXT",url:"https://devext.arcgis.com",type:"arcgis"},hub:{label:"ArcGIS Hub",url:"https://hub.arcgis.com/api",type:"arcgis-hub"},hubDEV:{label:"ArcGIS Hub DEV",url:"https://hubdev.arcgis.com/api",type:"arcgis-hub"},hubQA:{label:"ArcGIS Hub QA",url:"https://hubqa.arcgis.com/api",type:"arcgis-hub"}};function Uo(e){return"string"==typeof e&&e in Po?Po[e]:e}function No(e,t){var r=p(e);return t.from<e.from&&(r.from=t.from),t.to>e.to&&(r.to=t.to),r}function Ro(r,n){var o={};return["any","all","not","exact"].forEach(function(e){var t=e,e=I(Fo(r,t),Fo(n,t));e.length&&(o[t]=e.filter(m))}),o}function Fo(e,t){var r=[];return e[t]&&(t=e[t],r=Array.isArray(t)?t:[t]),r}function Lo(e){var t={};return Array.isArray(e)?t={any:e}:("string"==typeof e&&(t={any:[e]}),"object"==typeof e&&(t=e)),t}function _o(e){var t=new Date,r={type:"date-range",from:t.getTime(),to:t.getTime()};switch(e.unit){case"hours":case"days":case"weeks":r.from=r.to-{min:6e4,hours:36e5,days:864e5,weeks:6048e5}[e.unit]*e.num;break;case"months":t.setMonth(t.getMonth()-e.num),r.from=t.getTime();break;case"years":t.setFullYear(t.getFullYear()-e.num),r.from=t.getTime()}return r}function jo(e,t,r){var n=p(e),e=t.q,t=t.filter;return e&&(n.q=(n.q?" ("+n.q+" "+r+" "+e+")":e).trim()),t&&(n.filter=(n.filter?"("+n.filter+" "+r+" "+t+")":t).trim()),n}function Bo(e,t){var r={q:"",filter:""};return t.exact&&(I(["username","firstname","lastname","fullname","email"],["title","tags","typekeywords","type","name","owner"],["title","typekeywords","owner"]).includes(e)?r.filter=Go("AND",e,t.exact):("string"==typeof t.exact&&(t.all||(t.all=[]),"string"==typeof t.all&&(t.all=[t.all]),t.all.push(t.exact)),Array.isArray(t.exact)&&(t.all||(t.all=[]),"string"==typeof t.all&&(t.all=[t.all]),t.all=t.all.concat(t.exact)))),t.any&&(r.q=Go("OR",e,t.any)),t.all&&(r.q=(r.q?r.q+" AND ":"")+Go("AND",e,t.all)),t.not&&(r.q=(r.q?r.q+" AND ":"")+Go("OR","-"+e,t.not)),r}function Mo(e,t){return{q:e+":["+t.from+" TO "+t.to+"]",filter:""}}function Go(e,t,r){return Array.isArray(r)?"("+t+':"'+r.join('" '+e+" "+t+':"')+'")':t+':"'+r+'"'}function Vo(e,t,r,n){var o=p(e);return e.authentication&&(o.authentication=pe.deserialize(e.authentication.serialize())),o.start=-1<t?t:r+1,function(e){return e&&(o.authentication=e),n(o)}}function Ho(e,t,r){var n=null;return t.thumbnail&&(n=e+"/community/groups/"+t.id+"/info/"+t.thumbnail,r&&"public"!==t.access&&(n=n+"?token="+r)),n}function zo(e,t,r){var n=null;return t.thumbnail&&(n=e+"/community/users/"+t.username+"/info/"+t.thumbnail,r&&"public"!==t.access&&(n=n+"?token="+r)),n}var Yo={$apps:[{type:{any:["Code Sample","Web Mapping Application","Mobile Application","Application","Desktop Application Template","Desktop Application","Operation View","Dashboard","Operations Dashboard Extension","Workforce Project","Insights Workbook","Insights Page","Insights Model","Hub Page","Hub Initiative","Hub Site Application","StoryMap","Web Experience","Web Experience Template","Form"],not:["Code Attachment","Featured Items","Symbol Set","Color Set","Windows Viewer Add In","Windows Viewer Configuration","Map Area","Indoors Map Configuration"]},typekeywords:{not:["MapAreaPackage","SMX"]}}],$storymap:[{type:"StoryMap"},{type:"Web Mapping Application",typekeywords:["Story Map"]}],$dashboard:[{type:"Dashboard",typekeywords:{any:["Dashboard"],not:["ArcGIS Operation View","Add In","Extension"]}}],$dataset:[],$experience:[{type:{any:["Web Experience"],not:["Web Experience Template"]}}],$site:[{type:["Hub Site Application","Site Application"]},{type:["Web Mapping Application"],typekeywords:["hubSite"]}],$initiative:[{type:{any:"Hub Initiative",not:"Hub Initiative Template"}}],$document:[{typekeywords:{any:"Document",not:["MapAreaPackage","SMX"]},type:{any:["Image","Layout","Desktop Style","Project Template","Report Template","Pro Report","Statistical Data Collection","360 VR Experience","netCDF","PDF","CSV","Administrative Report","Raster function template"],not:["Image Service","Explorer Document","Explorer Map","Globe Document","Scene Document","Code Attachment","Featured Items","Symbol Set","ColorSet","Windows Viewer Add In","Windows Viewer Configuration","Map Area","Indoors Map Configuration"]}}]};function Wo(e){var t,o=[];return null!==(t=e.aggregations)&&void 0!==t&&t.counts&&e.aggregations.counts.forEach(function(r){var e={label:r.fieldName,attribute:r.fieldName,type:"multi-select"},n=[];r.fieldValues.forEach(function(e){var t={filterType:"content"};t[r.fieldName]=e.value;t={label:e.value,value:e.value,count:e.count,selected:!1,filter:t};n.push(t)}),e.options=n,o.push(e)}),o}function Ko(e){var e=e.map(Jo),n=["created","modified"],o=I(["filterType","subFilters","term"],n),e=e.reduce(function(r,e){return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r.hasOwnProperty(t)?o.includes(t)?n.includes(t)?r[t]=No(r[t],e):"term"===t?r[t]=r[t]+" "+e:"subFilters"===t&&(r[t]=I(r[t],e)):r[t]=Ro(r[t],e):r[t]=p(e)}),r},{});return e.filterType="content",e}function Jo(e){var t=Zo(e);return Array.isArray(e.subFilters)&&(t.subFilters=t.subFilters.reduce(function(e,t){return"string"==typeof t?Yo[t]&&(e=e.concat(Yo[t])):e.push(t),e},[])),Xo(t)}function Zo(e){var r=p(e);return r.subFilters=r.subFilters||[],r.type&&(Array.isArray(r.type)?r.type=r.type.reduce(function(e,t){return Qo(t)?r.subFilters=r.subFilters.concat($o(t)):e.push(t),e},[]):Qo(r.type)&&(e=r.type,r.subFilters=r.subFilters.concat($o(e)),delete r.type)),r}function Qo(e){var t=!1;return t="string"==typeof e?e in Yo:t}function $o(e){return Yo[e]}function Xo(t){var r={};t.term&&(r.term=t.term);var e,n=["created","modified"],o=I(["filterType","subFilters","term"],n);return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r[t]=Lo(e))}),t.subFilters&&Array.isArray(t.subFilters)&&(e=t.subFilters,r.subFilters=e.map(Xo)),n.forEach(function(e){t[e]&&("relative-date"===t[e].type?r[e]=_o(t[e]):r[e]=p(t[e]))}),r}function ei(e){var t,r=ti(e);return e.subFilters&&(t=e.subFilters.reduce(function(e,t){return e="object"==typeof t?jo(e,ti(t),"OR"):e},{q:"",filter:""}),r=jo(r,t,"AND")),e.term&&(r.q=(e.term+" "+r.q).trim()),r}function ti(e){var r={q:"",filter:""},n=["created","modified"],o=I(["filterType","subFilters","term"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=jo(r,Bo(t,e),"AND")),n.includes(t)&&(r=jo(r,Mo(t,e),"AND"))}),r}function ri(r){var n={},o=["created","modified"],i=I(["term","searchUserAccess"],o);return Object.entries(r).forEach(function(e){var t=e[0],e=e[1];i.includes(t)||A(t,Lo(e),n),o.includes(t)&&(e=p(O(r,t)),"relative-date"===O(r,t+".type")?A(t,_o(e),n):A(t,e,n))}),r.hasOwnProperty("searchUserAccess")&&(n.searchUserAccess=r.searchUserAccess),r.term&&(n.term=r.term),n}function ni(e){var r={q:"",filter:""},n=["created","modified"],o=I(["term","searchUserAccess","filterType"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=jo(r,Bo(t,e),"AND")),n.includes(t)&&(r=jo(r,Mo(t,e),"AND"))}),e.hasOwnProperty("searchUserAccess")&&(r.searchUserAccess=e.searchUserAccess),e.term&&(r.q=(e.term+" "+r.q).trim()),r}function oi(r){var n={},o=["created","modified","lastlogin"],i=I(["disabled","term"],o);return Object.entries(r).forEach(function(e){var t=e[0],e=e[1];i.includes(t)||A(t,Lo(e),n),o.includes(t)&&(e=p(O(r,t)),"relative-date"===O(r,t+".type")?A(t,_o(e),n):A(t,e,n))}),r.hasOwnProperty("disabled")&&(n.disabled=r.disabled),r.term&&(n.term=r.term),n}function ii(e){var r={q:"",filter:""},n=["created","modified","lastlogin"],o=I(["term","filterType"],n);return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];o.includes(t)||(r=jo(r,Bo(t,e),"AND")),n.includes(t)&&(r=jo(r,Mo(t,e),"AND"))}),e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.term&&(r.q=("("+e.term+") "+r.q).trim()),r}function ai(o){var e,t,r=(null===(e=o.authentication)||void 0===e?void 0:e.portal)||o.portal;o.authentication&&(t=o.authentication.token);function i(e){return e.thumbnailUrl=ir(e,r,t),e}return Ne(o).then(function(e){var t=-1<e.nextStart,r=e.results.map(rn),r=(r=o.site?r.map(function(e){return sn(e,o.site)}):r).map(i),n=Wo(e);return{total:e.total,results:r,facets:n,hasNext:t,next:Vo(o,e.nextStart,e.total,ai)}})}function si(o){function i(e){return e.siteTeamUrl=o.site.item.url+"/teams/"+e.id+"/about",e}var e,t,r=(null===(e=o.authentication)||void 0===e?void 0:e.portal)||o.portal;o.authentication&&(t=o.authentication.token);function a(e){return e.thumbnailUrl=Ho(r,e,t),e}return Ue(o,"group").then(function(e){var t,r=-1<e.nextStart,n=e.results.map(a);return null!==(t=null===(t=o.site)||void 0===t?void 0:t.item)&&void 0!==t&&t.url&&(n=e.results.map(i)),{hasNext:r,total:e.total,results:n,next:Vo(o,e.nextStart,e.total,si)}})}function ui(o){function i(e){return e.profileUrl=o.site.item.url+"/people/"+e.username+"/profile",e}function a(e){return e.thumbnail&&(e.thumbnailUrl=zo(t,e,r)),e}var t=o.authentication.portal,r=o.authentication.token;return Ue(o,"user").then(function(e){var t,r=-1<e.nextStart,n=e.results.map(a);return null!==(t=null===(t=o.site)||void 0===t?void 0:t.item)&&void 0!==t&&t.url&&(n=e.results.map(i)),{hasNext:r,total:e.total,results:n,next:Vo(o,e.nextStart,e.total,ui)}})}function ci(t){return T(this,void 0,void 0,function(){return q(this,function(e){return 200<=t.status&&t.status<300?[2,t.json()]:[2,t.json().then(function(e){if(e.error)throw new Error(e.error.title+" :: "+e.error.detail+" :: "+t.status);throw new Error("Got "+t.status+" "+t.statusText)})]})})}function li(e){var t={},e=O(e,"authentication.token");return e&&(t.Authorization=e),t}function pi(e){return(e||"https://hub.arcgis.com")+"/api/v3/domains"}function di(e,t){var r=e,n="hubsubdomain|"+(r=-1<e.indexOf("#/")?e.split("#/")[1]:r);return Ne(Object.assign({q:"typekeywords: "+n},t)).then(function(e){return e.results.filter(function(e){return E(e.typeKeywords,n)})[0]}).then(function(e){if(!e)throw new Error("site not found");return{hostname:e.url,siteId:e.id}})}function fi(e,t){if(t.isPortal)throw new Error("domainExists is not available in ArcGIS Enterprise.");e=ot(e);e=pi(t.hubApiUrl)+"/"+e,t=li(t);return fetch(e,{method:"GET",headers:t,mode:"cors"}).then(function(e){return 404!==e.status})}function hi(e,t){return di(e,t).then(function(e){return!0}).catch(function(e){return!1})}function mi(t,r,n,o){var i=t;return fi((i=(o=void 0===o?0:o)?t+"-"+o:t)+"-"+r,n).then(function(e){return e?mi(t,r,n,o+1):i})}function gi(t,r,n){var o=(n=void 0===n?0:n)?t+"-"+n:t;return hi(o,r).then(function(e){return e?gi(t,r,n+1):o})}function bi(e,t){if(t.isPortal)return di(e,t);e=pi(t.hubApiUrl)+"/"+e,t=li(t);return fetch(e,{method:"GET",headers:t,mode:"cors"}).then(ci)}function yi(e,t){var r=p(e),e=63;return t&&(e-=t.length+1),r=r.length>e?r.slice(0,e-6)+"-"+j(5):r}function vi(e,t){return Fn(e,t).then(xi)}function wi(e){if(1.4<=O(e,"item.properties.schemaVersion"))return e;var t=p(e),e=O(t,"data.values.gacode");return t.data.values.telemetry={consentNotice:{isTheme:!0,consentText:"",policyURL:""},customAnalytics:{ga:{customerTracker:{enabled:Boolean(e),id:e}}}},Nn(t,"data.values.gacode"),A("item.properties.schemaVersion",1.4,t),t}var Ai=1.5;function Di(e){if(1.5<=O(e,"item.properties.schemaVersion"))return e;var r,t=p(e),e=t.data.values.dcatConfig;return t.data.feeds={},e&&(t.data.feeds.dcatUS11=(r=JSON.stringify(e),Object.keys(Si).forEach(function(e){var t=Si[e];r=r.split(e).join(t)}),JSON.parse(r))),t.item.properties.schemaVersion=1.5,t}var Si={"{{default.name}}":"{{name}}","{{default.description}}":"{{description}}","{{item.tags}}":"{{tags}}","{{item.created:toISO}}":"{{created:toISO}}","{{item.modified:toISO}}":"{{modified:toISO}}","{{default.source.source}}":"{{source}}","{{item.owner}}":"{{owner}}","{{org.portalProperties.links.contactUs.url}}":"{{orgContactEmail}}","{{org.name}}":"{{orgName}}","{{item.categories}}":"{{categories}}","{{item.licenseInfo}}":"{{licenseInfo}}","{{item.modified}}":"{{modified}}","{{enrichments.categories}}":"{{categories}}","{{default.id}}":"{{id}}","{{item.licenseInfo || No License}}":"{{licenseInfo || No License}}","{{org.portalProperties.links.contactUs.url || mailto:data@tempe.gov}}":"{{orgContactEmail || mailto:data@tempe.gov}}","{{default.description || No Description}}":"{{description || No Description}}","{{item.id}}":"{{id}}"};function xi(e){return O(e,"item.properties.schemaVersion")===Ai?e:e=Di(e=wi(e=function(e){if(1.3<=O(e,"item.properties.schemaVersion"))return e;var t=p(e),e=O(t,"data.catalog.groups")||[];return t.data.catalog.groups=e.filter(B),t.item.properties.schemaVersion=1.3,t}(e=function(e){if(1.2<=O(e,"item.properties.schemaVersion"))return e;var t=p(e),e=O(t,"data.catalog")||{};return O(t,"data.values.groups")&&(e.groups=p(t.data.values.groups),delete t.data.values.groups),t.data.catalog=e,t.item.properties.schemaVersion=1.2,t}(e=function(e){if(1.1<=O(e,"item.properties.schemaVersion"))return e;var t=p(e);return["subdomain","defaultHostname","internalUrl","customHostname","externalUrl"].forEach(function(e){t.data.values[e]&&"string"==typeof t.data.values[e]&&(t.data.values[e]=t.data.values[e].toLowerCase())}),t.item.properties.schemaVersion=1.1,t}(e=function(e){if(1<=O(e,"item.properties.schemaVersion"))return e;var t=p(e);return["groupId","title"].forEach(function(e){delete t.data.values[e]}),t.item.properties||(t.item.properties={}),t.item.properties.schemaVersion=1,t.data.values.groups&&Array.isArray(t.data.values.groups)&&(e=t.data.values.groups.map(function(e){return"object"==typeof e?e.id:e}).filter(function(e){return!!e}),t.data.values.groups=e),t}(e))))))}function Ei(e,t){return ke(U({id:e,relationshipType:"Survey2Service",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function ki(e,t){return ke(U({id:e,relationshipType:"Service2Data",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function Ci(e,t){return ke(U({id:e,relationshipType:"Survey2Data",direction:"forward"},t)).then(function(e){var t,e=e.relatedItems[0];return t=e?{item:e}:t})}function Ti(t){function e(e){return-1<t.typeKeywords.indexOf(e)}var r=e("FieldworkerView");return r=r||["Survey123","Feature Service","View Service"].every(e)&&!e("StakeholderView")}qi.create=function(r){return T(this,void 0,void 0,function(){var t;return q(this,function(e){switch(e.label){case 0:return r.contextManager?[2,new qi(r.contextManager)]:[3,1];case 1:return t=r.managerOptions||{},[4,At.create(t)];case 2:return[2,new qi(e.sent())]}})})},Object.defineProperty(qi.prototype,"context",{get:function(){return this._contextManager.context},enumerable:!1,configurable:!0}),Object.defineProperty(qi.prototype,"projects",{get:function(){return this._projectManager||(this._projectManager=ko.init(this._contextManager)),this._projectManager},enumerable:!1,configurable:!0}),Ut=qi;function qi(e){this._contextManager=e}var Ii,Oi=(e(Pi,Ii=R),Pi);function Pi(e,t,r){var n=this;return t=t||"UNKNOWN_ERROR",r=y(r,"rootCause",r),(n=Ii.call(this,e,t,r)||this).name="HubError",n.stack=y(r,"stack",(new Error).stack),n}n.ArcGISContext=vt,n.ArcGISContextManager=At,n.GLOBAL_EXTENT=Mt,n.HUB_CDN_URLMAP=tt,n.HUB_LOCALES=Un,n.HUB_PROJECT_ITEM_TYPE=Pt,n.Hub=Ut,n.HubError=Oi,n.HubProjectManager=ko,n.Logger=G,n.OperationError=R,n.OperationStack=xr,n.PORTAL_EXPORT_TYPES=hn,n.REQUIRED_PRIVS=me,n.RemoteServerError=zr,n.SEARCH_APIS=Po,n.SITE_SCHEMA_VERSION=Ai,n.STANDARD_LICENSES=nr,n.WGS84_WKID=fn,n._addTokenToResourceUrl=To,n._canEmailUser=An,n._checkStatusAndParseJson=ci,n._consolidateResults=vn,n._deepMapValues=i,n._ensureSafeDomainLength=yi,n._ensureTelemetry=wi,n._formatAutoAddResponse=wn,n._getAuthHeader=li,n._getAutoAddUsers=In,n._getDomainServiceUrl=pi,n._getEmailUsers=Pn,n._getHttpAndHttpsUris=function(e){return e?["http://"+(e=e.replace(/^http(s?):\/\//,"")),"https://"+e]:[]},n._getInviteUsers=On,n._getLocation=function(){if(window)return window.location},n._isDate=s,n._isFunction=u,n._isObject=c,n._isOrgAdmin=Dn,n._isRegExp=l,n._isString=a,n._lookupPortal=di,n._mapValues=o,n._processAutoAdd=kn,n._processInvite=Tn,n._processPrimaryEmail=qn,n._processSecondaryEmail=xn,n._searchContent=function(o,i){var a;return T(this,void 0,void 0,function(){var t,r,n;return q(this,function(e){return t=Jo(o),r=Uo(i.api||"arcgis"),[2,"arcgis"===r.type?(n=ei(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){i.hasOwnProperty(e)&&(n[e]=i[e])}),n.authentication||(n.portal=r.url+"/sharing/rest"),null!==(a=i.aggregations)&&void 0!==a&&a.length&&(n.countFields=i.aggregations.join(","),n.countSize=200),ai(n)):Promise.resolve({total:0,results:[],facets:[],hasNext:!1,next:function(){}})]})})},n._searchGroups=function(o,i){return T(this,void 0,void 0,function(){var t,r,n;return q(this,function(e){if(t=ri(o),"arcgis"===(r=Uo(i.api||"arcgis")).type)return n=ni(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){i.hasOwnProperty(e)&&(n[e]=i[e])}),n.authentication||(n.portal=r.url+"/sharing/rest"),[2,si(n)];throw new Error("_searchGroups is not implemented for non-arcgis apis")})})},n._searchUsers=function(n,o){return T(this,void 0,void 0,function(){var t,r;return q(this,function(e){if(!o.authentication)throw new Error("Authentication required to search for users.");if(t=oi(n),"arcgis"===Uo(o.api||"arcgis").type)return r=ii(t),["authentication","num","sortField","sortOrder","site"].forEach(function(e){o.hasOwnProperty(e)&&(r[e]=o[e])}),[2,ui(r)];throw new Error("_searchUsers is not implemented for non-arcgis apis")})})},n._unprotectAndRemoveGroup=function(e){var t=_(Ge,{success:!0}),r=_(Ve,{success:!0});return t(e).then(function(){return r(e)})},n._unprotectAndRemoveItem=function(e){var t=_(Te,{success:!0}),r=_(Ie,{success:!0});return t(e).then(function(){return r(e)})},n.addContextToSlug=Dr,n.addDays=function(e,t){try{var r=new Date(e);return new Date(r.setDate(r.getDate()+t)).toISOString().split("T")[0]}catch(e){throw new Error("Invalid Date")}},n.addDomain=function(e,t){if(t.isPortal)throw new Error("addDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=li(t);r["Content-Type"]="application/json";var n=""+pi(t.hubApiUrl);return"number"==typeof(t=e.siteTitle)&&(e.siteTitle=t.toString()),fetch(n,{method:"POST",headers:r,mode:"cors",body:JSON.stringify(e)}).then(ci)},n.addSolutionResourceUrlToAssets=function(e,t){var r,n,o=e.assets||e.resources||[];return e.bundleItemId&&(r=nt(t.portalSelf)+"/content/items/"+e.bundleItemId,n=e.itemId,o=o.map(function(e){return{name:e.name,type:e.type||"resource",url:r+"/resources/"+n+"-"+e.name}})),o},n.addUsersToGroup=function(e,t,r,n,o){var i=p(y(r,"portalSelf.user",{}));return i.cOrgId=O(r,"portalSelf.portalProperties.hub.settings.communityOrg.orgId"),kn({groupId:e,allUsers:t,primaryRO:r,email:n,secondaryRO:o,requestingUser:i,usersToAutoAdd:In(t,i),usersToInvite:On(t,i),usersToEmail:Pn(t,i,O(n,"copyMe"))}).then(Tn).then(qn).then(xn).then(vn)},n.applyPropertiesToItems=function(e,t){return e.map(function(e){return e.properties||(e.properties={}),Object.assign(e.properties,t),e})},n.arrayToObject=function(e,r){return e.reduce(function(e,t){return e[O(t,r)]=t,e},{})},n.atob=dn.atob,n.autoAddUsers=En,n.bBoxToPolygon=zt,n.batch=x,n.btoa=dn.btoa,n.buildDraft=function(e,t){return w(e,{},t)},n.buildExistingExportsPortalQuery=function(e,t){var r,n,o,i,a=(c=function(e){if(e)return{onlyTypes:e.onlyTypes,layerId:e.layerId,spatialRefId:e.spatialRefId};return{}}(t)).onlyTypes,s=c.layerId,u=c.spatialRefId,t=Object.keys(hn).map(function(e){return hn[e]}),c=new Set(g(t.filter(function(e){return!e.supportsProjection}).map(function(e){return e.itemTypes}))),t=a||g(t.map(function(e){return e.itemTypes})),s=(new Oe).startGroup().match(bn(e)).in("typekeywords").and().match(yn(s)).in("typekeywords").endGroup().and().startGroup();function l(e,t){var r;t.startGroup().match(/\s/g.test(e)?e:'"'+e+'"').in("type").and().match(gn((r=e,t=fn,t=(e=i)&&!o.has(r)?e:t))).in("typekeywords").endGroup()}return r=s,n=(c={types:t,spatialRefId:u,noProjectionItemTypes:c}).types,o=c.noProjectionItemTypes,i=c.spatialRefId,n.forEach(function(e,t){l(e,r),t<n.length-1&&r.or()}),s.endGroup(),s.toParam()},n.buildUrl=ge,n.camelize=h,n.canEditEvent=function(e,t){var r=!1;return fe(t)&&(e=O(e,"initiative.item.properties.collaborationGroupId"),t=t.groups,r=!!e&&!!d(void 0===t?[]:t,"id",e)),r},n.canEditItem=he,n.canEditSite=function(e,t){var r=!1;return r=!O(e,"properties.isDefaultHubHome")&&fe(t)?he(e,t):r},n.canEditSiteContent=function(e,t){var r,n=!1,o=O(e,"properties.isDefaultHubHome"),i=fe(t);return!o&&i?n=he(e,t):i&&(i=t.orgId,e=e.orgId,i&&i===e&&(r=t.privileges||[],n=me.every(function(e){return E(r,e)}))),n},n.capitalize=t,n.categories=Ft,n.chunkArray=function(e,t){for(var r=[],n=0;n<e.length;)r.push(e.slice(n,n+t)),n+=t;return r},n.clearSession=function(e,t){(t=void 0===t?window:t).localStorage&&t.localStorage.removeItem("__CONTEXT_"+e)},n.cloneObject=p,n.completeOAuth2=function(t,e){var r=(e=(e=void 0===e?window:e).location.href.match(/access_token=(.+)&expires_in=.+&username=([^&]+)/))[1],n="https://www.arcgis.com/sharing/rest/community/users/"+decodeURIComponent(e[2]);return te(n,{params:{token:r},httpMethod:"GET"}).then(function(e){return Date.now()-e.created<5e3?te(n+"/update",{params:{token:r,tags:["hubRole:participant","org:"+e.orgId],access:"public"}}).then(function(){return pe.completeOAuth2(t)}):pe.completeOAuth2(t)})},n.compose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(r,n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(n.apply(void 0,e))}})},n.composeContent=vr,n.constructSlug=ao,n.convertContentDefinitionToFilter=Xo,n.convertContentFilterToSearchOptions=ti,n.convertPortalResponseToFacets=Wo,n.convertSolutionTemplateResourcesToAssets=function(e,t){var r,n,o=[];return e.resources&&e.bundleItemId&&(r=nt(t.portalSelf)+"/content/items/"+e.bundleItemId,n=e.itemId,o=e.resources.map(function(e){return{name:e,type:"resource",url:r+"/resources/"+n+"-"+e}})),o},n.convertToWellKnownLocale=function(e){var t="en";return e=(e=void 0===e?"en":e).toLowerCase(),-1<Un.indexOf(e)?t=e:1<(e=e.split("-")).length&&-1<Un.indexOf(e[0])&&(t=e[0]),t},n.convertUrlsToAnchorTags=function(t){var e=t.match(/((((ftp|https?):\/\/)|(w{3}\.))[-\w@:%_+.~#?,&//=]+)/g);return e&&e.forEach(function(e){t=t.replace(e,'<a target="_blank" href="'+e+'">'+e+"</a>")}),t.replace("(","<br/>(")},n.createExtent=function(e,t,r,n,o){return{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:{wkid:o=void 0===o?4326:o}}},n.createId=r,n.createModel=_n,n.createOperationPipeline=L,n.createProject=wo,n.dasherize=function(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase().replace(/[ _]/g,"-")},n.datasetToContent=function(e){var t=nn(e),r=(g=e.attributes).errors,n=g.boundary,o=g.metadata,i=g.slug,a=g.groupIds,s=g.orgId,u=g.orgName,c=g.organization,l=g.orgExtent,p=g.server,d=g.layers,f=g.layer,h=g.recordCount,m=g.statistics,e=g.extent,g=g.searchDescription,f=f&&f.id;return vr(t,{layerId:f,slug:i,errors:r,metadata:o||null,groupIds:a,org:s&&{id:s,name:u||c,extent:l},server:p,layers:d,recordCount:h,boundary:n,extent:e,searchDescription:g,statistics:m})},n.datasetToItem=nn,n.deepFind=D,n.deepFindById=function(e,t){return D(e,function(e){return e.id===t})},n.deepSet=b,n.deepStringReplace=v,n.deleteProp=Nn,n.destroyProject=So,n.doesItemExistWithTitle=io,n.domainExists=fi,n.domainExistsPortal=hi,n.emailOrgUsers=Sn,n.ensureProp=function(e,t){return b(e,t)},n.ensureUniqueDomainName=function(e,t){return(t.isPortal?gi(e,t):mi(e,t.portalSelf.urlKey+"."+ot(mt(t)),t)).then(function(e){return yi(e,t.portalSelf.urlKey)})},n.ensureUniqueString=function(e,t){for(var r=!1,n=0,o=t;!r;)E(e,o)?o=t+"-"+ ++n:r=!0;return o},n.expandApi=Uo,n.expandApis=function(e){return e.map(Uo)},n.expandContentFilter=Jo,n.expandGroupFilter=ri,n.expandTypeField=Zo,n.expandUserFilter=oi,n.extend=function n(e,o,i){void 0===i&&(i=!0);e=p(e);return Object.keys(o).reduce(function(e,t){var r;return null!==o[t]&&void 0!==o[t]&&(r=p(o[t]),Array.isArray(r)?e[t]=r:e[t]=i&&"object"==typeof r?n(e[t]||{},r,i):r),e},e)},n.extentToBBox=Bt,n.failSafe=_,n.failSafeUpdate=function(e,t){return _(we,{id:e.item.id,success:!0})(Object.assign({item:Rn(e)},t))},n.fetchAllPages=function(n,o,r,i){var a=o.num||100,e=o.start||1;return(-1===(r=void 0===r?-1:r)?n(U(U({},o),{num:a,start:e})):Promise.resolve({nextStart:e,total:r,results:[],num:a})).then(function(t){if(-1===t.nextStart)return[t];for(var e=[],r=t.nextStart;r<=t.total;r+=a)e.push(r);return x(e,function(e){return n(U(U({},o),{start:e,num:a}))},i).then(function(e){return I([t],e)})}).then(function(e){var t=e.reduce(function(e,t){return I(e,t.results)},[]),e=-1===r?t.length:r;return t.slice(0,e)})},n.fetchAndUploadResource=Io,n.fetchAndUploadThumbnail=Oo,n.fetchContent=function(e,t){return Ar(e)?Xr(Dr(e,null==t?void 0:t.siteOrgKey),t):(p=e,d=t,T(void 0,void 0,void 0,function(){var t,r,n,o,i,a,s,u,c,l;return q(this,function(e){switch(e.label){case 0:return u=wr(p).itemId,[4,$r(u,d)];case 1:return c=e.sent(),t=c.item,r=C(c,["item"]),n=d&&!P(d.layerId)&&d.layerId,Kt(t,d)?[4,Qr(p,d)]:[3,3];case 2:return l=e.sent(),[3,4];case 3:l={},e.label=4;case 4:return o=l.slug,i=l.layerId,a=l.boundary,s=l.extent,u=l.searchDescription,c=l.statistics,[2,vr(t,U(U({requestOptions:d},r),{slug:o,layerId:n||i,boundary:a,extent:s,searchDescription:u,statistics:c}))]}})}));var p,d},n.fetchHubTranslation=function(t,e,r){void 0===r&&(r="cors");var n=(rt(e)+"/locales/"+t+".json").toLocaleLowerCase();return fetch(n,{method:"GET",credentials:"same-origin",mode:r}).then(function(e){return e.json()}).catch(function(e){throw Error("Attempt to fetch locale "+t+" from "+n+" failed: "+JSON.stringify(e))})},n.fetchImageAsBlob=qo,n.fetchModelFromItem=Bn,n.fetchProject=Do,n.fetchSite=function(e,t){return B(e)?vi(e,t):bi(ot(e).split("/")[0],t).then(function(e){return vi(e.siteId,t)})},n.filterBy=function(e,t,r){return e.filter(function(e){return O(e,t)===r})},n.findBy=d,n.findItemsBySlug=co,n.flattenArray=g,n.generateRandomString=j,n.getCategory=en,n.getContentIdentifier=tn,n.getContentSiteUrls=on,n.getContentTypeIcon=lr,n.getContentTypeLabel=an,n.getCulture=function(e){return O(e,"portalSelf.user.culture")||O(e,"portalSelf.culture")||"en-us"},n.getDomainsForSite=function(e,t){return t.isPortal?Promise.resolve([]):(e=pi(t.hubApiUrl)+"?siteId="+e,t=li(t),fetch(e,{method:"GET",headers:t,mode:"cors"}).then(ci).catch(function(e){throw Error("Error in getDomainsForSite "+e)}))},n.getExportItemTypeKeyword=bn,n.getExportLayerTypeKeyword=yn,n.getFamily=Yt,n.getGeographicOrgExtent=Gt,n.getGroupThumbnailUrl=Ho,n.getHubApiFromPortalUrl=lt,n.getHubApiUrl=mt,n.getHubApiUrlFromPortal=function(e){return at(e)+"/api/v3"},n.getHubLocaleAssetUrl=rt,n.getHubProduct=function(e){var t=O(e,"portalProperties.hub.enabled")||!1?"premium":"basic";return t=e.isPortal&&"singletenant"===e.portalMode?"portal":t},n.getHubUrlFromPortal=at,n.getInputFeatureServiceModel=Ei,n.getItemApiUrl=ct,n.getItemAssets=function(e,t){var r=nt(t.portalSelf)+"/content/items/"+e.id,n=ir(e,t),o=[];return n&&o.push({name:e.thumbnail,url:n,type:"thumbnail"}),e=e.id,e=xe(e,t=t)+"/resources",(t=U({},t)).params=U({num:1e3},t.params),te(e,t).then(function(e){e=e.resources.map(function(e){return{name:e.resource,type:"resource",url:r+"/resources/"+e.resource}});return o.concat(e)})},n.getItemBySlug=uo,n.getItemDataUrl=ut,n.getItemHomeUrl=st,n.getItemHubId=br,n.getItemHubType=function(e){return console.warn("DEPRECATED: Use getFamily() instead. getItemHubType() will be removed at v10.0.0"),e=mr(e="string"==typeof e?{type:e}:e),St(e)},n.getItemLayerId=gr,n.getItemThumbnailUrl=ir,n.getLayerIdFromUrl=hr,n.getModel=Fn,n.getModelBySlug=Ln,n.getModelFromOptions=function(e,t){var r=e+"Model",e=e+"Id";if(t[r])return Promise.resolve(t[r]);if(t[e])return _(Fn,{item:{id:t[e]},isMissing:!0})(t[e],t);throw new Error("getModelFromOptions requires either a ."+r+" or ."+e+" property.")},n.getNextFunction=Vo,n.getOrgExtentAsBBox=function(e){return Gt(e).then(Bt)},n.getPortalApiUrl=nt,n.getPortalBaseFromOrgUrl=pt,n.getPortalUrl=et,n.getPortalUrls=pr,n.getProp=O,n.getProps=function(r,e){return e.reduce(function(e,t){t=O(r,t);return t&&e.push(t),e},[])},n.getProxyUrl=dr,n.getServiceTypeFromUrl=ht,n.getSession=function(e,t){var r=null;return!(t=void 0===t?window:t).localStorage||(e=t.localStorage.getItem("__CONTEXT_"+e))&&(r=pe.deserialize(e)),r},n.getSiteById=vi,n.getSourceFeatureServiceModelFromFieldworker=ki,n.getSpatialRefTypeKeyword=gn,n.getStakeholderModel=Ci,n.getStructuredLicense=or,n.getSubscriptionType=function(e){return y(e,"subscriptionInfo.type","Enterprise")},n.getSurveyModels=function(e,r){var n,o;return("string"==typeof e?Se(e,r):Promise.resolve(e)).then(function(t){var e=[Ei(t.id,r),Ci(t.id,r)];return Promise.all(e).then(function(e){var t=e[0],e=e[1];return o=e,t&&Ti(t.item)?ki((n=t).item.id,r):t}).then(function(e){return{form:{item:t},featureService:e,fieldworker:n,stakeholder:o}})})},n.getTypeCategories=function(e){if(e=en(mr(e=void 0===e?{}:e))){e=Array.from(e);return e[0]=e[0].toUpperCase(),[e.join("")]}return["Other"]},n.getTypes=function(e){return Ft[(e=void 0===e?"":e).toLowerCase()]},n.getUniqueDomainName=mi,n.getUniqueDomainNamePortal=gi,n.getUniqueItemTitle=function t(r,n,o,i){var a=(i=void 0===i?0:i)?r+" "+i:r;return io(a,n,o).then(function(e){return e?t(r,n,o,++i):a}).catch(function(e){throw Error("Error in getUniqueItemTitle "+e)})},n.getUniqueSlug=lo,n.getUserThumbnailUrl=zo,n.getWithDefault=y,n.hasBasePriv=fe,n.hubApiRequest=Wr,n.hubApiSearch=function(e){var t=(t=e.authentication)&&t.serialize&&{authentication:t.serialize()};return Wr("/search",U(U({},{headers:t,httpMethod:"POST"}),e))},n.includes=E,n.incrementString=function(e){var t=e.match(/-\s(\d+$)/);return t?(t=parseInt(t[1],10),e=e.replace("- "+t,"- "+(t+1))):e+=" - 1",e},n.interpolate=oo,n.interpolateItemId=function(e){return oo(e,{item:{id:e.item.id},appid:e.item.id},{toISO:function(e,t){return t}})},n.inviteUsers=Cn,n.isBBox=Vt,n.isDomainForLegacySite=function(e){return!B(e.siteId)},n.isDomainUsedElsewhere=function(e,t,r){return bi(e,r).then(function(e){return e.siteId!==t}).catch(function(){return!1})},n.isDownloadable=Lt,n.isExtentCoordinateArray=Ht,n.isFeatureService=fr,n.isFieldworkerView=Ti,n.isGuid=B,n.isMapOrFeatureServerUrl=dt,n.isNil=P,n.isSlug=Ar,n.isUpdateGroup=H,n.isValidDomain=function(t,e){if(e.isPortal)throw new Error("isValidDomain is not available in ArcGIS Enterprise.");var r=pi(e.hubApiUrl)+"/validate?hostname="+t,e=li(e);return fetch(r,{method:"GET",headers:e,mode:"cors"}).then(function(e){return e.json()}).catch(function(e){return{success:!1,input:t,error:{code:400,detail:e,message:"lookupFailed"}}})},n.isValidExtent=function(t){return!!t&&[Ht,function(t){return["xmin","ymin","xmax","ymax"].every(function(e){return"number"==typeof t[e]})}].some(function(e){return e(t)})},n.itemPropsNotInTemplates=po,n.itemToContent=rn,n.last=function(e){return e[e.length-1]},n.lookupDomain=bi,n.mapBy=function(t,e){return(e=void 0===e?[]:e).map(function(e){return e[t]})},n.maybeAdd=function(e,t,r){return null!=t&&((r=p(r))[e]=t),r},n.maybePush=f,n.mergeContentFilter=Ko,n.mergeDateRange=No,n.mergeGroupFilters=function(e){var e=e.map(ri),o=["created","modified"],i=I(["filterType","term"],o);return e.reduce(function(n,e){return Object.entries(e).forEach(function(e){var t=e[0],r=e[1];n.hasOwnProperty(t)?(e=O(n,t),i.includes(t)?o.includes(t)?A(t,No(e,r),n):"term"===t&&(n[t]=n[t]+" "+r):A(t,Ro(e,r),n)):A(t,p(r),n)}),n},{filterType:"group"})},n.mergeMatchOptions=Ro,n.mergeObjects=w,n.mergeSearchOptions=jo,n.mergeUserFilters=function(e){var e=e.map(oi),o=["created","modified","lastlogin"],i=I(["disabled","term","filterType"],o);return e.reduce(function(n,e){return Object.entries(e).forEach(function(e){var t=e[0],r=e[1];n.hasOwnProperty(t)?(e=O(n,t),i.includes(t)?o.includes(t)?A(t,No(e,r),n):"term"===t&&(n[t]=n[t]+" "+r):A(t,Ro(e,r),n)):A(t,p(r),n)}),n},{filterType:"user"})},n.normalizeItemType=mr,n.normalizeSolutionTemplateItem=function(e){var t=p(e);return po.forEach(function(e){delete t[e]}),t.extent="{{organization.defaultExtentBBox}}",t},n.objectToArray=function(r,n){return void 0===n&&(n="id"),Object.keys(r).reduce(function(e,t){return r[t][n]=t,e.push(p(r[t])),e},[])},n.objectToJsonBlob=function(e){if("undefined"!=typeof Blob)return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")},n.parseDatasetId=wr,n.parseItemCategories=yr,n.processRevertableTasks=function(e){return Promise.all(e).then(function(e){function t(e){return"fullfilled"===e.status}var r=e.filter(t),n=e.filter(function(e){return!t(e)});if(n.length){e=r.map(function(e){return e.revert()});throw Promise.all(e).catch(function(){}),n[0].error}return r.map(function(e){return e.results})})},n.propifyString=function(e){return h(e.replace(/^[0-9]*/g,"").replace(/[^\w\s]/g,""))},n.relativeDateToDateRange=_o,n.removeContextFromSlug=Sr,n.removeDomain=function(e,t){if(t.isPortal)throw new Error("removeDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=li(t);return r["Content-Type"]="application/json",e=pi(t.hubApiUrl)+"/"+e,fetch(e,{method:"DELETE",headers:r,mode:"cors"}).then(ci)},n.removeDomainsBySiteId=function(e,t){if(t.isPortal)throw new Error("removeDomainsBySiteId is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=li(t);return r["Content-Type"]="application/json",e=pi(t.hubApiUrl)+"/?siteId="+e,fetch(e,{method:"DELETE",headers:r,mode:"cors"}).then(ci)},n.removeEmptyProps=function t(r){return Object.keys(r).forEach(function(e){r[e]&&"object"==typeof r[e]?t(r[e]):null==r[e]&&delete r[e]}),r},n.replaceItemId=function(e,t,r){return void 0===r&&(r="{{appid}}"),v(p(e),new RegExp(t,"g"),r)},n.runRevertableTask=function(e,t){return e().then(function(e){return{status:"fullfilled",results:e,revert:t}}).catch(function(e){return{status:"rejected",error:e}})},n.saveSession=function(e,t,r){(r=void 0===r?window:r).localStorage&&r.localStorage.setItem("__CONTEXT_"+e,t.serialize())},n.searchProjects=xo,n.serializeContentFilterForPortal=ei,n.serializeDateRange=Mo,n.serializeGroupFilterForPortal=ni,n.serializeMatchOptions=Bo,n.serializeModel=Rn,n.serializeSpatialReference=mn,n.serializeStringOrArray=Go,n.serializeUserFilterForPortal=ii,n.setContentHubId=function(e,t){var r=e.id,r=e.slug||t||r,r=U(U({},e),{hubId:t,identifier:r});return un(r,{relative:cn(r)})},n.setContentSiteUrls=sn,n.setContentType=function(e,t){var r=mr(U(U({},e.item),{type:t})),n=Yt(r),o=lr(r),t=an(r,e.isProxied),t=U(U({},e),{type:r,family:n,normalizedType:r,contentTypeIcon:o,contentTypeLabel:t});return un(t,{relative:cn(t)})},n.setItemThumbnail=fo,n.setProp=A,n.setSlugKeyword=so,n.shareItemToGroups=function(t,e,r,n){return Promise.all(e.map(function(e){e=Object.assign({},{id:t,groupId:e},r);return n&&(e.owner=n),Je(e)}))},n.slugify=M,n.stringToBlob=function(e,t){if(void 0===t&&(t="application/octet-stream"),"undefined"==typeof Blob)throw new Error("stringToBlob is not currently supported on Node");for(var r=[],n=0;n<e.length;n++)r[n]=e.charCodeAt(n);var o=new Uint8Array(r);return new Blob([o],{type:t})},n.stripProtocol=ot,n.unique=m,n.uniqueBy=function(e,r){return e.reduce(function(e,t){return f(e.find(function(e){return O(e,r)===O(t,r)})?null:t,e)},[])},n.unprotectModel=function(e,t){return e.item.protected?Te(Object.assign({id:e.item.id},t)):Promise.resolve({success:!0})},n.unshareItemFromGroups=function(t,e,r,n){return Promise.all(e.map(function(e){e=Object.assign({},{id:t,groupId:e},r);return n&&(e.owner=n),$e(e)}))},n.updateDomain=function(e,t){if(t.isPortal)throw new Error("updateDomain is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");var r=li(t);r["Content-Type"]="application/json";var n=pi(t.hubApiUrl)+"/"+e.id;return"number"==typeof(t=e.siteTitle)&&(e.siteTitle=t.toString()),fetch(n,{method:"PUT",headers:r,mode:"cors",body:JSON.stringify(e)}).then(ci)},n.updateModel=jn,n.updateProject=Ao,n.upgradeProtocol=function(e){return-1===e.indexOf("http")?"https://"+e:-1!==e.indexOf("http://")?e.replace(/^http:/i,"https:"):e},n.upgradeSiteSchema=xi,n.uploadResourcesFromUrl=function(n,e,o){if(Array.isArray(e)){e=e.reduce(function(e,t){var r;return t.url&&(r={id:n.item.id,owner:n.item.owner,fileName:t.name,url:To(t.url,o),authentication:o.authentication},"thumbnail"===t.type?e.push(Oo(r)):e.push(Io(r))),e},[]);return Promise.all(e)}return Promise.resolve([])},n.valueToMatchOptions=Lo,n.without=function(e,t){return e.filter(function(e){return e!==t})},n.withoutByProp=function(t,r,e){return e.filter(function(e){return e[t]!==r})},Object.defineProperty(n,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=common.umd.min.js.map