/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./tracking","./tracking/SimpleTrackingTarget"],(function(n,e,r){"use strict";let t=!1;const u=[];function i(n,u){let i=new r.SimpleTrackingTarget(f),c=null,l=!1;function f(){if(!i||l)return;if(t)return void o(f);const r=c;i.clear(),t=!0,l=!0,c=e.runTracked(i,n),l=!1,t=!1,u(c,r),a()}function d(){i&&(i.destroy(),i=null,c=null)}return l=!0,c=e.runTracked(i,n),l=!1,{remove:d}}function c(n,t){let u=new r.SimpleTrackingTarget(c),i=null;function c(){t(i,o)}function l(){u&&(u.destroy(),u=null),i=null}function o(){return u?(u.clear(),i=e.runTracked(u,n),i):null}return o(),{remove:l}}function l(n){let u=new r.SimpleTrackingTarget(c),i=!1;function c(){u&&!i&&(t?o(c):(u.clear(),t=!0,i=!0,e.runTracked(u,n),i=!1,t=!1,a()))}function l(){u&&(u.destroy(),u=null)}return i=!0,e.runTracked(u,n),i=!1,{remove:l}}function o(n){u.includes(n)||u.unshift(n)}function a(){for(;u.length;)u.pop()()}n.autorun=l,n.reaction=i,n.reactionDeferred=c,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
