/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details. */ define(["exports"],function(n){"use strict";function r(n,r){return null!=n?n:r}var t,e,h;function j(n,r,t,e){return l(n).then(r,t,e)}function l(n){var r,t;return n instanceof a?n:u(n)?(r=m(),n.then(function(n){r.resolve(n)},function(n){r.reject(n)},function(n){r.progress(n)}),r.promise):(t=n,new a(function(n){try{return l(n?n(t):t)}catch(n){return p(n)}}))}function a(n){this.then=n}function p(t){return new a(function(n,r){try{return r?l(r(t)):p(t)}catch(n){return p(n)}})}function m(){var n,i,c,e,r,t;return n=new a(u),i=[],c=[],e=function(r,t,e){var u,o;return u=m(),o="function"==typeof e?function(n){try{u.progress(e(n))}catch(n){u.progress(n)}}:function(n){u.progress(n)},i.push(function(n){n.then(r,t).then(u.resolve,u.reject,o)}),c.push(o),u.promise},r=function(n){return v(c,n),n},t=function(n){return n=l(n),e=n.then,t=l,r=w,v(i,n),c=i=h,n},{then:u,resolve:o,reject:f,progress:s,promise:n,resolver:{resolve:o,reject:f,progress:s}};function u(n,r,t){return e(n,r,t)}function o(n){return t(n)}function f(n){return t(p(n))}function s(n){return r(n)}}function u(n){return n&&"function"==typeof n.then}function o(n,p,v,g,y){return f(2,arguments),j(n,function(n){var r,t,e,u,o,i,c,f,s,h;if(s=n.length>>>0,r=Math.max(0,Math.min(p,s)),e=[],t=s-r+1,u=[],o=m(),r)for(f=o.progress,c=function(n){u.push(n),--t||(i=c=w,o.reject(u))},i=function(n){e.push(n),--r||(i=c=w,o.resolve(e))},h=0;h>>0,t=[],i=m(),e)for(u=function(n,r){j(n,c).then(function(n){t[r]=n,--e||i.resolve(t)},i.reject)},o=0;o>>0,(t=arguments).length<=1)for(;;){if(o in r){e=r[o++];break}if(++o>=u)throw new TypeError}else e=t[1];for(;o