@arcgis/core 5.2.0-next.160 → 5.2.0-next.161

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 (63) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{15bcf7cfe603f2ee1a24.js → 28104681ba161967039f.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{842893e75696428d536f.js → 3b0808ee3c4facfaca3d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{4eae066673484986d4c1.js → 4ed76fb5f6096a089f5b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/5daa9429808ca31279f2.js +1 -0
  7. package/assets/esri/core/workers/chunks/83f29a159b8b5197e76a.js +1 -0
  8. package/assets/esri/core/workers/chunks/{77ebacfdf8e57f2e03f1.js → 8480fe6b4372dbbfa7cc.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{1d77c8c59b0118c7e77b.js → 85bba551057366cd00ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/a2fcbc494333376192aa.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/f74ae0eff3f08978e607.js +1 -0
  14. package/chunks/RibbonLine.glsl.js +69 -83
  15. package/config.d.ts +62 -34
  16. package/config.js +1 -1
  17. package/core/has.js +1 -1
  18. package/core/mapCollectionUtils.js +1 -1
  19. package/core/workers/Connection.d.ts +58 -89
  20. package/core/workers.d.ts +45 -54
  21. package/geometry/support/Indices.js +1 -1
  22. package/geometry/support/aaBoundingRect.js +1 -1
  23. package/geometry/support/ray.js +1 -1
  24. package/kernel.js +1 -1
  25. package/layers/GeospatialPDFLayer.js +1 -1
  26. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  27. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  28. package/layers/support/commonProperties.js +1 -1
  29. package/package.json +2 -2
  30. package/rest/print.js +1 -1
  31. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  32. package/views/3d/input/SceneInputManager.js +1 -1
  33. package/views/3d/input/handlers/DragZoom.js +1 -1
  34. package/views/3d/input/handlers/MouseWheelFov.js +1 -1
  35. package/views/3d/layers/I3SMeshView3D.js +1 -1
  36. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  37. package/views/3d/layers/graphics/extrudePolygon.js +1 -1
  38. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  39. package/views/3d/state/controllers/FovController.js +1 -1
  40. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  41. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  42. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  43. package/views/3d/terrain/PatchRenderData.js +1 -1
  44. package/views/3d/terrain/TextureReference.js +1 -1
  45. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  46. package/views/SceneView.js +1 -1
  47. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  48. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  49. package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
  50. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  51. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  52. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  53. package/widgets/Search/LocatorSearchSource.d.ts +22 -1
  54. package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
  55. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  56. package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
  57. package/widgets/support/SelectionList/ItemBase.js +1 -1
  58. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  59. package/widgets/support/SelectionList.js +1 -1
  60. package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +0 -1
  61. package/assets/esri/core/workers/chunks/abb9e820d2871fa7acae.js +0 -1
  62. package/assets/esri/core/workers/chunks/ade5fdcd08dcbac74740.js +0 -1
  63. package/assets/esri/core/workers/chunks/b390b9cde2884755e8be.js +0 -1
package/core/workers.d.ts CHANGED
@@ -32,14 +32,18 @@ import type { AbortOptions } from "./promiseUtils.js";
32
32
  *
33
33
  * Possible Value | Description
34
34
  * ---------------|------------
35
- * distributed | The module is loaded in each available worker. Each call to [Connection.invoke()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/#invoke) targets an available worker. Use this strategy if the module doesn't maintain information between invocations (stateless).
36
- * dedicated | The module is loaded in one worker. Each call to [Connection.invoke()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/#invoke) will target the same worker. Use this strategy if the module maintains information from previous invocations or communication between main and worker threads needs to be stateful.
37
- * local | The module is loaded in the main thread. Use this strategy when using the worker framework API while disabling the use of workers.
35
+ * distributed | The module is loaded in each available worker. Each invocation is handled by an available worker. Use this strategy when the module is stateless and does not need to retain data between invocations.
36
+ * dedicated | The module is loaded in a single worker, and all invocations are handled by that worker. Use this strategy when the module needs to retain state between invocations or maintain stateful communication with the main thread.
37
+ * local | The module runs on the main thread instead of in a worker. Use this strategy when worker execution is unavailable or not desired. This can affect UI responsiveness.
38
38
  */
39
39
  export type OpenStrategy = "distributed" | "dedicated" | "local";
40
40
 
41
41
  export interface OpenOptions extends AbortOptions {
42
- /** The objects defining the API accessible from the module. */
42
+ /**
43
+ * An object containing methods that the worker module can call on the main thread.
44
+ * In a custom worker class, declare a `remoteClient` property and use
45
+ * `this.remoteClient.invoke("methodName", data)` to invoke a method on this object.
46
+ */
43
47
  client?: any;
44
48
  /**
45
49
  * Indicates whether the module is an ES module.
@@ -51,7 +55,7 @@ export interface OpenOptions extends AbortOptions {
51
55
  */
52
56
  isESM?: boolean;
53
57
  /**
54
- * Indicates how to load the module. See the table below for a list of possible values.
58
+ * Indicates how to load the module. See [OpenStrategy](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#OpenStrategy) for a list of possible values.
55
59
  *
56
60
  * @default distributed
57
61
  */
@@ -66,67 +70,54 @@ export interface OpenOptions extends AbortOptions {
66
70
  * @returns Resolves to an instance of [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/).
67
71
  * @see [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/)
68
72
  * @example
69
- * // Set the path for the worker's AMD loader configuration
70
- * // to a folder called workersFolder.
71
- * esriConfig.workers.loaderConfig = {
72
- * paths: {
73
- * myWorkers: new URL("./workersFolder", document.baseURI).href
74
- * }
75
- * };
73
+ * import { open } from "@arcgis/core/core/workers.js";
76
74
  *
77
- * // load myWorkers/Calculator.js in the workers framework
78
- * // and invoke its "getMaxNumber" method
79
- * workers.open("myWorkers/Calculator")
80
- * .then((connection) => {
81
- * return connection.invoke("getMaxNumber", [0, 1, 2, 3, 4]);
82
- * })
83
- * .then((result) => {
84
- * console.log(result);
85
- * });
75
+ * // Load an ESM worker module and invoke its "getMaxNumber" function.
76
+ * const connection = await open(new URL("./workersFolder/Calculator.js", import.meta.url).href, {
77
+ * isESM: true
78
+ * });
79
+ * try {
80
+ * // Invoke the worker function and receive its result on the main thread.
81
+ * const result = await connection.invoke("getMaxNumber", [0, 1, 2, 3, 4]);
82
+ * console.log(result);
83
+ * } finally {
84
+ * connection.close();
85
+ * }
86
86
  *
87
87
  * //*********************************************************
88
- * // module: workerFolder/Calculator.js
88
+ * // module: workersFolder/Calculator.js
89
89
  * //*********************************************************
90
- * define([], () => {
91
- * return {
92
- * // this function can be invoked from the main thread
93
- * getMaxNumber: function (number) {
94
- * return Math.max.apply(null, numbers);
95
- * }
96
- * };
97
- * });
90
+ * export function getMaxNumber(numbers) {
91
+ * return Math.max(...numbers);
92
+ * }
98
93
  * @example
99
- * // Load workerScripts/TimeOfTheDay.js in the workers framework
100
- * // We define an API accessible from the module
101
- * workers.open(new URL("./workerScripts/TimeOfDay.js", document.baseURI).href, {
94
+ * // Load an ESM worker module that calls a function on the main thread.
95
+ * const connection = await open(new URL("./workerScripts/TimeOfDay.js", import.meta.url).href, {
96
+ * isESM: true,
102
97
  * client: {
103
- * getCurrentTime: function() {
98
+ * getCurrentTime() {
104
99
  * return Date.now();
105
100
  * }
106
101
  * }
107
- * })
108
- * .then((connection) => {
109
- * return connection.invoke("timeOfTheDay");
110
- * })
111
- * .then((result) => {
112
- * console.log(result);
113
- * });
102
+ * });
103
+ *
104
+ * try {
105
+ * const result = await connection.invoke("timeOfTheDay");
106
+ * console.log(result);
107
+ * } finally {
108
+ * connection.close();
109
+ * }
114
110
  *
115
111
  * //*********************************************************
116
- * // module: workerScripts/TimeOfTheDay.js
112
+ * // module: workerScripts/TimeOfDay.js
117
113
  * //*********************************************************
114
+ * export default class TimeOfTheDay {
115
+ * remoteClient;
118
116
  *
119
- * define([], () => {
120
- *
121
- * return {
122
- * timeOfTheDay: function(noArgs, remoteClient) {
123
- * // call back the main thread to get the current time over there.
124
- * return remoteClient.invoke("getCurrentTime")
125
- * .then((time) => {
126
- * return "The time is " + time;
127
- * });
128
- * }
129
- * };
130
- * });
117
+ * async timeOfTheDay() {
118
+ * const time = await this.remoteClient.invoke("getCurrentTime");
119
+ * return `The time is ${time}`;
120
+ * }
121
+ * }
131
122
  */
132
123
  export function open(modulePath: string, options?: OpenOptions): Promise<Connection>;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?h(n.length):o?d(n.length):t(n)&&n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?n:a(n,!r)}function i(t,n){return t.length<e?Array.from(t):n<256?Uint8Array.from(t):n<2**16?Uint16Array.from(t):Uint32Array.from(t)}function a(e,n){for(let r of e){if(r>=65536)return t(e)?e:new Uint32Array(e);r>=256&&(n=!1)}return n?new Uint8Array(e):new Uint16Array(e)}function o(t,n=t){return t<=e?Array(t):n<=65536?new Uint16Array(t):new Uint32Array(t)}function s(e,t,n){if(t.length===0)return e.slice();if(e.length===0)return t.slice();let r=o(e.length+t.length,n);for(let t=0;t<e.length;++t)r[t]=e[t];for(let n=0;n<t.length;++n)r[e.length+n]=t[n];return r}let c=p(131072);const l=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(t){return t===1?l:t<e?Array.from(new Uint16Array(u.buffer,0,t)):t<u.length?new Uint16Array(u.buffer,0,t):(t>c.length&&(c=p(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t))}function f(t){return t===1?[0]:t<e?Array.from(new Uint16Array(u.buffer,0,t)):t<u.length?new Uint16Array(u.buffer,0,t).slice():(t>c.length&&(c=p(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t).slice())}function p(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536);function h(t){if(t===1)return l;if(t<e)return Array(t).fill(0);if(t>m.length){let e=Math.max(2*m.length,t);m=new Uint8Array(e)}return new Uint8Array(m.buffer,0,t)}function g(){c=p(131072),m=new Uint8Array(65536)}function _(e){return`byteLength`in e?e.byteLength:e.length*8}export{r as compactIndices,n as compactMeshIndices,s as concatIndexArrays,d as getContinuousIndexArray,h as getZeroIndexArray,_ as indexArrayByteSize,i as indexArrayFrom,f as newContinuousIndexArray,o as newIndexArray,g as pruneIndexArrays};
2
+ import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?g(n.length):o?d(n.length):t(n)&&n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?n:a(n,!r)}function i(t,n){return t.length<e?Array.from(t):n<256?Uint8Array.from(t):n<2**16?Uint16Array.from(t):Uint32Array.from(t)}function a(e,n){for(let r of e){if(r>=65536)return t(e)?e:new Uint32Array(e);r>=256&&(n=!1)}return n?new Uint8Array(e):new Uint16Array(e)}function o(t,n=t){return t<=e?Array(t):n<=65536?new Uint16Array(t):new Uint32Array(t)}function s(e,t,n){if(t.length===0)return e.slice();if(e.length===0)return t.slice();let r=o(e.length+t.length,n);for(let t=0;t<e.length;++t)r[t]=e[t];for(let n=0;n<t.length;++n)r[e.length+n]=t[n];return r}let c=m(131072);const l=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(t){return t===1?l:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t):(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t))}function f(t){return t===1?[0]:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t).slice():(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t).slice())}function p(e){let t=Array(e).fill(0);for(let n=0;n<e;n++)t[n]=n;return t}function m(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536);function g(t){if(t===1)return l;if(t<e)return Array(t).fill(0);if(t>h.length){let e=Math.max(2*h.length,t);h=new Uint8Array(e)}return new Uint8Array(h.buffer,0,t)}function _(){c=m(131072),h=new Uint8Array(65536)}function v(e){return`byteLength`in e?e.byteLength:e.length*8}export{r as compactIndices,n as compactMeshIndices,s as concatIndexArrays,d as getContinuousIndexArray,g as getZeroIndexArray,v as indexArrayByteSize,i as indexArrayFrom,f as newContinuousIndexArray,o as newIndexArray,_ as pruneIndexArrays};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null){o(n,e);return}if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
2
+ import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null){o(n,e);return}if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e==null&&t==null||e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{equals as e}from"../../core/arrayUtils.js";import{ObjectStack as t}from"../../core/ObjectStack.js";import{set as n,invert as r}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as a,subtract as o,dot as s,normalize as c,cross as l,sub as u,set as d,add as f,scale as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{clone as m,create as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as g}from"./vectorStacks.js";function _(e){return e?v(m(e.origin),m(e.direction)):v(h(),h())}function v(e,t){return{origin:e,direction:t}}function y(t,n){return e(t.origin,n.origin)&&e(t.direction,n.direction)}function b(e,t){let n=D.get();return n.origin=e,n.direction=t,n}function x(e,t=_()){return C(e.origin,e.direction,t)}function S(e,t,n=_()){return a(n.origin,e),o(n.direction,t,e),n}function C(e,t,n=_()){return a(n.origin,e),a(n.direction,t),n}function w(e,t){let n=l(g.get(),c(g.get(),e.direction),o(g.get(),t,e.origin));return s(n,n)}function T(e,t,n){let r=s(e.direction,o(n,t,e.origin));return f(n,e.origin,p(n,e.direction,r)),n}function E(e,t,i,a){let o=e.origin,m=t.origin,h=e.direction,g=t.direction,_=s(c(k,h),c(A,g));if(Math.abs(_)>=1)return null;let v=l(k,h,g),y=u(O,m,o),b=n(j,h[0],h[1],h[2],-g[0],-g[1],-g[2],v[0],v[1],v[2]),x=r(j,b);if(x==null)return[i,a];let S=s(d(k,x[0],x[3],x[6]),y),C=s(d(A,x[1],x[4],x[7]),y);return f(i,o,p(O,h,S)),f(a,m,p(O,g,C)),[i,a]}const D=new t(()=>_()),O=h(),k=h(),A=h(),j=i();export{T as closestPoint,E as closestPoints,x as copy,_ as create,w as distance2,y as equals,S as fromPoints,C as fromValues,b as wrap};
2
+ import{ObjectStack as e}from"../../core/ObjectStack.js";import{set as t,invert as n}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as i,subtract as a,exactEquals as o,dot as s,normalize as c,cross as l,sub as u,set as d,add as f,scale as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{clone as m,create as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as g}from"./vectorStacks.js";function _(e){return e?v(m(e.origin),m(e.direction)):v(h(),h())}function v(e,t){return{origin:e,direction:t}}function y(e,t){return o(e.origin,t.origin)&&o(e.direction,t.direction)}function b(e,t){let n=D.get();return n.origin=e,n.direction=t,n}function x(e,t=_()){return C(e.origin,e.direction,t)}function S(e,t,n=_()){return i(n.origin,e),a(n.direction,t,e),n}function C(e,t,n=_()){return i(n.origin,e),i(n.direction,t),n}function w(e,t){let n=l(g.get(),c(g.get(),e.direction),a(g.get(),t,e.origin));return s(n,n)}function T(e,t,n){let r=s(e.direction,a(n,t,e.origin));return f(n,e.origin,p(n,e.direction,r)),n}function E(e,r,i,a){let o=e.origin,m=r.origin,h=e.direction,g=r.direction,_=s(c(k,h),c(A,g));if(Math.abs(_)>=1)return null;let v=l(k,h,g),y=u(O,m,o),b=t(j,h[0],h[1],h[2],-g[0],-g[1],-g[2],v[0],v[1],v[2]),x=n(j,b);if(x==null)return[i,a];let S=s(d(k,x[0],x[3],x[6]),y),C=s(d(A,x[1],x[4],x[7]),y);return f(i,o,p(O,h,S)),f(a,m,p(O,g,C)),[i,a]}const D=new e(()=>_()),O=h(),k=h(),A=h(),j=r();export{T as closestPoint,E as closestPoints,x as copy,_ as create,w as distance2,y as equals,S as fromPoints,C as fromValues,b as wrap};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.160`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.161`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureClass as a}from"../core/accessorSupport/ensureType.js";import o from"../geometry/SpatialReference.js";import{getInfo as s}from"../geometry/support/spatialReferenceUtils.js";import c from"./Layer.js";import{BlendLayer as l}from"./mixins/BlendLayer.js";import{RasterJobHandlerMixin as u}from"./mixins/RasterJobHandlerMixin.js";import{ScaleRangeLayer as d}from"./mixins/ScaleRangeLayer.js";import f from"./raster/datasets/GeospatialPDFRaster.js";import{clip as p}from"./raster/functions/clipUtils.js";import m from"./support/PortalItemData.js";import h from"./support/TileInfo.js";let g=class extends l(d(u(n(c)))){constructor(e){super(e),this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.serviceRasterInfo=null,this.spatialReference=null,this.type=`geospatial-pdf`}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new t(`geospatial-pdf-layer:fetch-image-bitmap-tile`,`GeospatialPDFLayer does not expose pre-rendered image tile URLs.`)}async fetchPixels(e,t,n,r={}){return _(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(n),r)}async fetchTile(e,n,r,i={}){if(_(this),i.requestAsImageElement)throw new t(`geospatial-pdf-layer:fetch-tile`,`GeospatialPDFLayer does not support requestAsImageElement.`);await this._initJobHandler();let a=await this.raster.fetchTile(e,n,r,i);return this.clippedToNeatline&&a.pixelBlock&&this._frame&&a.srcExtent&&(a.pixelBlock=await p(a.pixelBlock,a.srcExtent,this._frame.sourceNeatlinePolygon)),a}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,n=!1){if(!this.loaded||t==null)return null;if(n&&e.equals(this.spatialReference))return this.tileInfo;let r=s(e);return h.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getDataUrl(e){let{data:n}=this;if(typeof n==`string`)return n;if(n instanceof File)return this._objectURL=URL.createObjectURL(n),this._objectURL;if(n instanceof m){await n.portalItem.load({signal:e?.signal});let r=n.portalItem.url;if(!r)throw new t(`geospatial-pdf-layer:load`,`Portal item does not have a valid data URL.`);return r}throw new t(`geospatialpdf-layer:missing-data`,`A data source must be specified.`)}async _load(e){let t=await this._getDataUrl(e);await this._openRaster(t,e?.signal)}async _openRaster(e,n){let r=new f({url:e});if(await r.open({signal:n}),!r.rasterInfo)throw r.destroy(),new t(`geospatialpdf-layer:load`,`cannot load resources on `+e);let{rasterInfo:i}=r;this._set(`serviceRasterInfo`,i),this.setAtOrigin(`spatialReference`,i.spatialReference,`service`),this.setAtOrigin(`tileInfo`,i.storageInfo.tileInfo,`service`),this._frame=r.frame,this.raster=r}};e([r({clonable:!1})],g.prototype,`_compatibleFullExtent`,void 0),e([r({type:Boolean})],g.prototype,`clippedToNeatline`,void 0),e([r({cast:e=>e?typeof e==`string`||e instanceof File?e:a(m,e):null})],g.prototype,`data`,void 0),e([r({json:{read:!1}})],g.prototype,`fullExtent`,null),e([r()],g.prototype,`raster`,void 0),e([r()],g.prototype,`serviceRasterInfo`,void 0),e([r({readOnly:!0,type:o,json:{read:!1}})],g.prototype,`spatialReference`,void 0),e([r({type:h,readOnly:!0})],g.prototype,`tileInfo`,void 0),e([r({readOnly:!0,value:`geospatial-pdf`})],g.prototype,`type`,void 0),g=e([i(`esri.layers.GeospatialPDFLayer`)],g);function _(e){if(!e.raster||!e.serviceRasterInfo)throw new t(`imagery-tile`,`no raster`)}const v=g;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureClass as a}from"../core/accessorSupport/ensureType.js";import o from"../geometry/SpatialReference.js";import{getInfo as s}from"../geometry/support/spatialReferenceUtils.js";import c from"./Layer.js";import{BlendLayer as l}from"./mixins/BlendLayer.js";import{RasterJobHandlerMixin as u}from"./mixins/RasterJobHandlerMixin.js";import{ScaleRangeLayer as d}from"./mixins/ScaleRangeLayer.js";import f from"./raster/datasets/GeospatialPDFRaster.js";import{clip as p}from"./raster/functions/clipUtils.js";import m from"./support/PortalItemData.js";import h from"./support/TileInfo.js";let g=class extends l(d(u(n(c)))){constructor(e){super(e),this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.serviceRasterInfo=null,this.spatialReference=null,this.type=`geospatial-pdf`}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new t(`geospatial-pdf-layer:fetch-image-bitmap-tile`,`GeospatialPDFLayer does not expose pre-rendered image tile URLs.`)}async fetchPixels(e,t,n,r={}){return _(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(n),r)}async fetchTile(e,n,r,i={}){if(_(this),i.requestAsImageElement)throw new t(`geospatial-pdf-layer:fetch-tile`,`GeospatialPDFLayer does not support requestAsImageElement.`);await this._initJobHandler();let a=await this.raster.fetchTile(e,n,r,i),o=this.clippedToNeatline?this._frame?.sourceNeatlinePolygon:this._frame?.sourceMediaBoxPolygon;return o&&a.pixelBlock&&this._frame&&a.srcExtent&&(a.pixelBlock=await p(a.pixelBlock,a.srcExtent,o)),a}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,n=!1){if(!this.loaded||t==null)return null;if(n&&e.equals(this.spatialReference))return this.tileInfo;let r=s(e);return h.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getDataUrl(e){let{data:n}=this;if(typeof n==`string`)return n;if(n instanceof File)return this._objectURL=URL.createObjectURL(n),this._objectURL;if(n instanceof m){await n.portalItem.load({signal:e?.signal});let r=n.portalItem.url;if(!r)throw new t(`geospatial-pdf-layer:load`,`Portal item does not have a valid data URL.`);return r}throw new t(`geospatialpdf-layer:missing-data`,`A data source must be specified.`)}async _load(e){let t=await this._getDataUrl(e);await this._openRaster(t,e?.signal)}async _openRaster(e,n){let r=new f({url:e});if(await r.open({signal:n}),!r.rasterInfo)throw r.destroy(),new t(`geospatialpdf-layer:load`,`cannot load resources on `+e);let{rasterInfo:i}=r;this._set(`serviceRasterInfo`,i),this.setAtOrigin(`spatialReference`,i.spatialReference,`service`),this.setAtOrigin(`tileInfo`,i.storageInfo.tileInfo,`service`),this._frame=r.frame,this.raster=r}};e([r({clonable:!1})],g.prototype,`_compatibleFullExtent`,void 0),e([r({type:Boolean})],g.prototype,`clippedToNeatline`,void 0),e([r({cast:e=>e?typeof e==`string`||e instanceof File?e:a(m,e):null})],g.prototype,`data`,void 0),e([r({json:{read:!1}})],g.prototype,`fullExtent`,null),e([r()],g.prototype,`raster`,void 0),e([r()],g.prototype,`serviceRasterInfo`,void 0),e([r({readOnly:!0,type:o,json:{read:!1}})],g.prototype,`spatialReference`,void 0),e([r({type:h,readOnly:!0})],g.prototype,`tileInfo`,void 0),e([r({readOnly:!0,value:`geospatial-pdf`})],g.prototype,`type`,void 0),g=e([i(`esri.layers.GeospatialPDFLayer`)],g);function _(e){if(!e.raster||!e.serviceRasterInfo)throw new t(`imagery-tile`,`no raster`)}const v=g;export{v as default};