/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/typedArrayUtil","../../webgl-engine/lib/geometryDataUtils"],(function(e,t,n){"use strict";function r(e,r=n.generateDefaultIndexArray){return"number"==typeof e?r(e):t.isUint16Array(e)||t.isUint8Array(e)?new Uint32Array(e):e}function i(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const n=t-2,r=n<=65536?new Uint16Array(3*n):new Uint32Array(3*n);if("number"==typeof e){let e=0;for(let t=0;t<n;t+=1)t%2==0?(r[e++]=t,r[e++]=t+1,r[e++]=t+2):(r[e++]=t+1,r[e++]=t,r[e++]=t+2)}else{let t=0;for(let i=0;i<n;i+=1)if(i%2==0){const n=e[i],o=e[i+1],l=e[i+2];r[t++]=n,r[t++]=o,r[t++]=l}else{const n=e[i+1],o=e[i],l=e[i+2];r[t++]=n,r[t++]=o,r[t++]=l}}return r}function o(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const n=t-2,r=n<=65536?new Uint16Array(3*n):new Uint32Array(3*n);if("number"==typeof e){let e=0;for(let t=0;t<n;++t)r[e++]=0,r[e++]=t+1,r[e++]=t+2;return r}{const t=e[0];let i=e[1],o=0;for(let l=0;l<n;++l){const n=e[l+2];r[o++]=t,r[o++]=i,r[o++]=n,i=n}return r}}e.triangleFanToTriangles=o,e.triangleStripToTriangles=i,e.trianglesToTriangles=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
