@arcgis/core 4.28.0-next.20230912 → 4.28.0-next.20230913

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 (47) hide show
  1. package/arcade/featureset/support/errorsupport.js +1 -1
  2. package/arcade.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{aa78ca83a4b582b6c2b6.js → 6d94b358e8d1cf79bba3.js} +1 -1
  5. package/assets/esri/core/workers/chunks/8aa7e994b74f66522c37.js +1 -0
  6. package/assets/esri/core/workers/chunks/a047fcf3c7307a69b63c.js +1 -0
  7. package/assets/esri/core/workers/chunks/c51233ad51823cb98c35.js +1 -0
  8. package/assets/esri/core/workers/chunks/dbf343d1fb746f99bb6e.js +1 -0
  9. package/assets/esri/core/workers/chunks/{271ec1d1666bf6dc3dda.js → dc74b4ec85e8e3de5b27.js} +1 -1
  10. package/assets/esri/themes/base/widgets/_Sketch.scss +0 -5
  11. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +0 -5
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/core/promiseUtils.js +1 -1
  16. package/core/sql/DateOnly.js +1 -1
  17. package/core/sql/TimeOnly.js +1 -1
  18. package/interfaces.d.ts +190 -144
  19. package/layers/SceneLayer.js +1 -1
  20. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  21. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  22. package/layers/support/TilemapCache.js +1 -1
  23. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  24. package/layers/video/VideoController.js +1 -1
  25. package/package.json +1 -1
  26. package/support/revision.js +1 -1
  27. package/views/2d/engine/webgl/DisplayId.js +1 -1
  28. package/views/2d/engine/webgl/Utils.js +1 -1
  29. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  30. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  31. package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
  32. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  33. package/views/3d/analysis/Dimension/settings.js +1 -1
  34. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  35. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  36. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  37. package/views/animation/easing.js +1 -1
  38. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  39. package/widgets/Feature/FeatureMedia.js +1 -1
  40. package/widgets/Features.js +1 -1
  41. package/widgets/support/SketchTooltipControls/SketchTooltipControlsViewModel.js +1 -1
  42. package/widgets/support/SketchTooltipControls.js +1 -1
  43. package/widgets/support/SnappingControls.js +1 -1
  44. package/assets/esri/core/workers/chunks/15056f91d87f11b00bcc.js +0 -1
  45. package/assets/esri/core/workers/chunks/877302d6e39a0d530aab.js +0 -1
  46. package/assets/esri/core/workers/chunks/aedb1f944b332b098933.js +0 -1
  47. package/assets/esri/core/workers/chunks/c8dd21a332559c99815c.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{clock as t}from"./clock.js";import e from"./Error.js";import{once as r}from"./events.js";import n from"./Logger.js";import{removeMaybe as o}from"./maybe.js";async function i(t,e){const r=t.slice(),n=await Promise.all(t.map(((t,r)=>e(t,r))));return r.filter(((t,e)=>n[e]))}function u(t="Aborted"){return new e("AbortError",t)}function s(t,e="Aborted"){if(c(t))throw u(e)}function l(t){return null!=t?"aborted"in t?t:t.signal:t}function c(t){const e=l(t);return null!=e&&e.aborted}function a(t){if(b(t))throw t}function f(t){if(!b(t))throw t}function m(t,e){const n=l(t);if(null!=n){if(!n.aborted)return r(n,"abort",(()=>e()));e()}}function w(t,e){const n=l(t);if(null!=n)return s(n),r(n,"abort",(()=>e(u())))}function h(t,e){return null==l(e)?t:new Promise(((r,n)=>{let i=m(e,(()=>n(u())));const s=()=>i=o(i);t.then(s,s),t.then(r,n)}))}function p(t,r,n){return Promise.race([t,A(r).then((()=>{throw new e("timeout",`Did not resolve within ${r} milliseconds (${n??"timeout"})`)}))])}function b(t){return"AbortError"===t?.name}async function d(t){try{return await t}catch(e){if(!b(e))throw e;return}}async function y(t,e=n.getLogger("esri")){try{return await t}catch(r){b(r)||e.error(r)}}async function v(t){if(!t)return;if("function"!=typeof t.forEach){const e=Object.keys(t),r=e.map((e=>t[e])),n=await v(r),o={};return e.map(((t,e)=>o[t]=n[e])),o}const e=t;return Promise.allSettled(e).then((t=>Array.from(e,((e,r)=>{const n=t[r];return"fulfilled"===n.status?{promise:e,value:n.value}:{promise:e,error:n.reason}}))))}async function j(t){return(await v(t)).filter((t=>!!t.value)).map((t=>t.value))}async function P(t){return(await Promise.allSettled(t)).filter((t=>"fulfilled"===t.status)).map((t=>t.value))}async function g(t){return(await Promise.allSettled(t)).filter((t=>"rejected"===t.status)).map((t=>t.reason))}function A(t,e=void 0,r){const n=new AbortController;return m(r,(()=>n.abort())),new Promise(((r,o)=>{let i=setTimeout((()=>{i=0,r(e)}),t);m(n,(()=>{i&&(clearTimeout(i),o(u()))}))}))}function T(t,r,n,o){const i=n&&"abort"in n?n:null;null!=o||i||(o=n);let u=setTimeout((()=>{u=0,i&&i.abort()}),r);const s=()=>o||new e("promiseUtils:timeout","The wrapped promise did not resolve within "+r+" ms");return t.then((t=>{if(0===u)throw s();return clearTimeout(u),t}),(t=>{throw clearTimeout(u),0===u?s():t}))}function E(t){return t&&"function"==typeof t.then}function S(t){return E(t)?t:Promise.resolve(t)}function k(t,e=-1){let r,n,o,i,s=null;const l=(...c)=>{if(r){n=c,i&&i.reject(u()),i=C();const t=i.promise;if(s){const t=s;s=null,t.abort()}return t}if(o=i||C(),i=null,e>0){const n=new AbortController;r=S(t(...c,n.signal));const o=r;A(e).then((()=>{r===o&&(i?n.abort():s=n)}))}else r=1,r=S(t(...c));const a=()=>{const t=n;n=o=r=s=null,null!=t&&l(...t)},f=r,m=o;return f.then(a,a),f.then(m.resolve,m.reject),m.promise};return l}function C(){let e,r;const n=new Promise(((t,n)=>{e=t,r=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=t=>r(t),o.timeout=(e,r)=>t.setTimeout((()=>o.reject(r)),e),o.promise=n,o}function L(t,e){return t.then(e,e)}function $(t,e){e.then(t.resolve,t.reject)}async function x(t){await Promise.resolve(),s(t)}export{A as after,g as allSettledErrors,P as allSettledValues,L as always,u as createAbortError,C as createResolver,k as debounce,v as eachAlways,j as eachAlwaysValues,i as filter,d as ignoreAbortErrors,b as isAbortError,c as isAborted,E as isPromiseLike,y as logOnError,m as onAbort,w as onAbortOrThrow,$ as settleWithPromise,a as throwIfAbortError,s as throwIfAborted,f as throwIfNotAbortError,T as timeout,x as waitTick,S as when,h as whenOrAbort,p as whenOrTimeout};
5
+ import{clock as t}from"./clock.js";import e from"./Error.js";import{once as r}from"./events.js";import n from"./Logger.js";import{removeMaybe as o}from"./maybe.js";async function i(t,e){const r=t.slice(),n=await Promise.all(t.map(((t,r)=>e(t,r))));return r.filter(((t,e)=>n[e]))}function u(t="Aborted"){return new e("AbortError",t)}function s(t,e="Aborted"){if(c(t))throw u(e)}function l(t){return null!=t?"aborted"in t?t:t.signal:t}function c(t){const e=l(t);return null!=e&&e.aborted}function a(t){if(b(t))throw t}function f(t){if(!b(t))throw t}function m(t,e){const n=l(t);if(null!=n){if(!n.aborted)return r(n,"abort",(()=>e()));e()}}function w(t,e){const n=l(t);if(null!=n)return s(n),r(n,"abort",(()=>e(u())))}function h(t,e){return null==l(e)?t:new Promise(((r,n)=>{let i=m(e,(()=>n(u())));const s=()=>{i=o(i)};t.then(s,s),t.then(r,n)}))}function p(t,r,n){return Promise.race([t,A(r).then((()=>{throw new e("timeout",`Did not resolve within ${r} milliseconds (${n??"timeout"})`)}))])}function b(t){return"AbortError"===t?.name}async function d(t){try{return await t}catch(e){if(!b(e))throw e;return}}async function y(t,e=n.getLogger("esri")){try{return await t}catch(r){b(r)||e.error(r)}}async function v(t){if(!t)return;if("function"!=typeof t.forEach){const e=Object.keys(t),r=e.map((e=>t[e])),n=await v(r),o={};return e.map(((t,e)=>o[t]=n[e])),o}const e=t;return Promise.allSettled(e).then((t=>Array.from(e,((e,r)=>{const n=t[r];return"fulfilled"===n.status?{promise:e,value:n.value}:{promise:e,error:n.reason}}))))}async function j(t){return(await v(t)).filter((t=>!!t.value)).map((t=>t.value))}async function P(t){return(await Promise.allSettled(t)).filter((t=>"fulfilled"===t.status)).map((t=>t.value))}async function g(t){return(await Promise.allSettled(t)).filter((t=>"rejected"===t.status)).map((t=>t.reason))}function A(t,e=void 0,r){const n=new AbortController;return m(r,(()=>n.abort())),new Promise(((r,o)=>{let i=setTimeout((()=>{i=0,r(e)}),t);m(n,(()=>{i&&(clearTimeout(i),o(u()))}))}))}function T(t,r,n,o){const i=n&&"abort"in n?n:null;null!=o||i||(o=n);let u=setTimeout((()=>{u=0,i&&i.abort()}),r);const s=()=>o||new e("promiseUtils:timeout","The wrapped promise did not resolve within "+r+" ms");return t.then((t=>{if(0===u)throw s();return clearTimeout(u),t}),(t=>{throw clearTimeout(u),0===u?s():t}))}function E(t){return t&&"function"==typeof t.then}function S(t){return E(t)?t:Promise.resolve(t)}function k(t,e=-1){let r,n,o,i,s=null;const l=(...c)=>{if(r){n=c,i&&i.reject(u()),i=C();const t=i.promise;if(s){const t=s;s=null,t.abort()}return t}if(o=i||C(),i=null,e>0){const n=new AbortController;r=S(t(...c,n.signal));const o=r;A(e).then((()=>{r===o&&(i?n.abort():s=n)}))}else r=1,r=S(t(...c));const a=()=>{const t=n;n=o=r=s=null,null!=t&&l(...t)},f=r,m=o;return f.then(a,a),f.then(m.resolve,m.reject),m.promise};return l}function C(){let e,r;const n=new Promise(((t,n)=>{e=t,r=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=t=>r(t),o.timeout=(e,r)=>t.setTimeout((()=>o.reject(r)),e),o.promise=n,o}function L(t,e){return t.then(e,e)}function $(t,e){e.then(t.resolve,t.reject)}async function x(t){await Promise.resolve(),s(t)}export{A as after,g as allSettledErrors,P as allSettledValues,L as always,u as createAbortError,C as createResolver,k as debounce,v as eachAlways,j as eachAlwaysValues,i as filter,d as ignoreAbortErrors,b as isAbortError,c as isAborted,E as isPromiseLike,y as logOnError,m as onAbort,w as onAbortOrThrow,$ as settleWithPromise,a as throwIfAbortError,s as throwIfAborted,f as throwIfNotAbortError,T as timeout,x as waitTick,S as when,h as whenOrAbort,p as whenOrTimeout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const a=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}class n{constructor(t,e,a){this._year=t,this._month=e,this._day=a}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(t){return t instanceof n&&t.day===this.day&&t.month===this.month&&t.year===this.year}clone(){return new n(this._year,this._month,this._day)}toDateTime(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toDateTimeLuxon(t){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(t=null){if(null===t||""===t)return this.toString();if(!(t=o(t)))return"";const r=this.toDateTime("unknown");return e.dateTimeToArcadeDate(r).toFormat(t,{locale:a(),numberingSystem:"latn"})}toArcadeDate(){const t=this.toDateTime("unknown");return e.dateTimeToArcadeDate(t)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(t,e){switch(t){case"days":case"years":case"months":e=Math.trunc(e);break;case"hours":e=Math.trunc(e)/24,t="days";break;case"minutes":e=Math.trunc(e/1440),t="days";break;case"seconds":e=Math.trunc(e/86400),t="days";break;case"milliseconds":e=Math.trunc(e/864e5),t="days"}return n.fromDateTime(this.toUTCDateTime().plus({[t]:e}))}toUTCDateTime(){return r.utc(this.year,this.month,this.day,0,0,0,0)}difference(t,e){switch(e.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===e?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}static fromMilliseconds(t){const e=r.fromMillis(t,{zone:s.utcInstance});return e.isValid?n.fromParts(e.year,e.month,e.day):null}static fromSeconds(t){const e=r.fromSeconds(t,{zone:s.utcInstance});return e.isValid?n.fromParts(e.year,e.month,e.day):null}static fromReader(t){if(!t)return null;const e=t.split("-");return 3!==e.length?null:new n(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10))}static fromParts(t,e,a){const r=new n(t,e,a);return!1===r.isValid?null:r}static fromDateJS(t){return n.fromParts(t.getFullYear(),t.getMonth()+1,t.getDay())}static fromDateTime(t){return n.fromParts(t.year,t.month,t.day)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,e=null){if(""===t)return null;if(null===t)return null;const a=[];if(e)(e=o(e))&&a.push(e);else if(null===e||""===e){const e=r.fromISO(t,{setZone:!0});return e.isValid?n.fromParts(e.year,e.month,e.day):null}for(const s of a){const a=r.fromFormat(t,e??s);if(a.isValid)return new n(a.year,a.month,a.day)}return null}static fromNow(t="system"){const e=r.fromJSDate(new Date).setZone(t);return new n(e.year,e.month,e.day)}}export{n as DateOnly,o as standardiseDateOnlyFormat};
5
+ import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const a=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}class n{constructor(t,e,a){this._year=t,this._month=e,this._day=a,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(t){return t instanceof n&&t.day===this.day&&t.month===this.month&&t.year===this.year}clone(){return new n(this._year,this._month,this._day)}toDateTime(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toDateTimeLuxon(t){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(t=null){if(null===t||""===t)return this.toString();if(!(t=o(t)))return"";const r=this.toDateTime("unknown");return e.dateTimeToArcadeDate(r).toFormat(t,{locale:a(),numberingSystem:"latn"})}toArcadeDate(){const t=this.toDateTime("unknown");return e.dateTimeToArcadeDate(t)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(t,e){switch(t){case"days":case"years":case"months":e=Math.trunc(e);break;case"hours":e=Math.trunc(e)/24,t="days";break;case"minutes":e=Math.trunc(e/1440),t="days";break;case"seconds":e=Math.trunc(e/86400),t="days";break;case"milliseconds":e=Math.trunc(e/864e5),t="days"}return n.fromDateTime(this.toUTCDateTime().plus({[t]:e}))}toUTCDateTime(){return r.utc(this.year,this.month,this.day,0,0,0,0)}difference(t,e){switch(e.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===e?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}static fromMilliseconds(t){const e=r.fromMillis(t,{zone:s.utcInstance});return e.isValid?n.fromParts(e.year,e.month,e.day):null}static fromSeconds(t){const e=r.fromSeconds(t,{zone:s.utcInstance});return e.isValid?n.fromParts(e.year,e.month,e.day):null}static fromReader(t){if(!t)return null;const e=t.split("-");return 3!==e.length?null:new n(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10))}static fromParts(t,e,a){const r=new n(t,e,a);return!1===r.isValid?null:r}static fromDateJS(t){return n.fromParts(t.getFullYear(),t.getMonth()+1,t.getDay())}static fromDateTime(t){return n.fromParts(t.year,t.month,t.day)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,e=null){if(""===t)return null;if(null===t)return null;const a=[];if(e)(e=o(e))&&a.push(e);else if(null===e||""===e){const e=r.fromISO(t,{setZone:!0});return e.isValid?n.fromParts(e.year,e.month,e.day):null}for(const s of a){const a=r.fromFormat(t,e??s);if(a.isValid)return new n(a.year,a.month,a.day)}return null}static fromNow(t="system"){const e=r.fromJSDate(new Date).setZone(t);return new n(e.year,e.month,e.day)}}export{n as DateOnly,o as standardiseDateOnlyFormat};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{isInteger as t}from"../../arcade/kernel.js";import{getLocale as s}from"../../intl/locale.js";import{DateTime as e}from"luxon";function i(t){if(!t)return"";const s=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let e="";for(const i of t.match(s)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":e+=i;break;case"A":case"a":e+="a";break;default:e+=`'${i}'`}return e}class n{constructor(t,s,e,i){this._hour=t,this._minute=s,this._second=e,this._millisecond=i}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(t){return t instanceof n&&t.hour===this.hour&&t.minute===this.minute&&t.second===this.second&&t.millisecond===this.millisecond}clone(){return new n(this.hour,this.minute,this.second,this.millisecond)}isValid(){return t(this.hour)&&t(this.minute)&&t(this.second)&&t(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(t=null){if(null===t||""===t)return this.toString();if(!(t=i(t)))return"";return e.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(t,{locale:s(),numberingSystem:"latn"})}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(t,s,e,i){const r=new n(t,s,e,i);return r.isValid()?r:null}static fromReader(t){if(!t)return null;const s=t.split(":");return 3!==s.length?null:new n(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),0)}static fromMilliseconds(t){if(t>864e5||t<0)return null;const s=Math.floor(t/1e3%60),e=Math.floor(t/6e4%60),i=Math.floor(t/36e5%24),r=Math.floor(t%1e3);return new n(i,e,s,r)}static fromDateJS(t){return new n(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}static fromDateTime(t){return new n(t.hour,t.minute,t.second,t.millisecond)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,s=null){if(""===t)return null;if(null===t)return null;const r=[];s?(s=i(s))&&r.push(s):null!==s&&""!==s||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const i of r){const s=e.fromFormat(t,i);if(s.isValid)return new n(s.hour,s.minute,s.second,s.millisecond)}return null}plus(t,s){switch(t){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return n.fromDateTime(this.toUTCDateTime().plus({[t]:s}))}return null}toUTCDateTime(){return e.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(t,s){switch(s.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===s?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}}export{n as TimeOnly,i as standardiseTimeFormat};
5
+ import{isInteger as t}from"../../arcade/kernel.js";import{getLocale as s}from"../../intl/locale.js";import{DateTime as e}from"luxon";function i(t){if(!t)return"";const s=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let e="";for(const i of t.match(s)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":e+=i;break;case"A":case"a":e+="a";break;default:e+=`'${i}'`}return e}class n{constructor(t,s,e,i){this._hour=t,this._minute=s,this._second=e,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(t){return t instanceof n&&t.hour===this.hour&&t.minute===this.minute&&t.second===this.second&&t.millisecond===this.millisecond}clone(){return new n(this.hour,this.minute,this.second,this.millisecond)}isValid(){return t(this.hour)&&t(this.minute)&&t(this.second)&&t(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(t=null){if(null===t||""===t)return this.toString();if(!(t=i(t)))return"";return e.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(t,{locale:s(),numberingSystem:"latn"})}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(t,s,e,i){const r=new n(t,s,e,i);return r.isValid()?r:null}static fromReader(t){if(!t)return null;const s=t.split(":");return 3!==s.length?null:new n(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),0)}static fromMilliseconds(t){if(t>864e5||t<0)return null;const s=Math.floor(t/1e3%60),e=Math.floor(t/6e4%60),i=Math.floor(t/36e5%24),r=Math.floor(t%1e3);return new n(i,e,s,r)}static fromDateJS(t){return new n(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}static fromDateTime(t){return new n(t.hour,t.minute,t.second,t.millisecond)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,s=null){if(""===t)return null;if(null===t)return null;const r=[];s?(s=i(s))&&r.push(s):null!==s&&""!==s||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const i of r){const s=e.fromFormat(t,i);if(s.isValid)return new n(s.hour,s.minute,s.second,s.millisecond)}return null}plus(t,s){switch(t){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return n.fromDateTime(this.toUTCDateTime().plus({[t]:s}))}return null}toUTCDateTime(){return e.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(t,s){switch(s.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===s?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}}export{n as TimeOnly,i as standardiseTimeFormat};