define("soundmanager", ["componentmodelComponentApi", "cri", "clientkernelLoaderApi", "soundManagerApi", "howler", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(componentmodelComponentApi, cri, clientkernelLoaderApi, soundManagerApi, howler, clientkernelEventbusApi, clientkernelModulesApi) {
        "use strict";

        function $iterator(o) {
            if (o instanceof Array) return function() {
                return {
                    cur: 0,
                    arr: o,
                    hasNext: function() {
                        return this.cur < this.arr.length;
                    },
                    next: function() {
                        return this.arr[this.cur++];
                    }
                };
            };
            return typeof(o.iterator) == 'function' ? $bind(o, o.iterator) : o.iterator;
        };;
        var $fid = 0;

        function $bind(o, m) {
            if (m == null) return null;
            if (m.__id__ == null) m.__id__ = $fid++;
            var f;
            if (o.hx__closures__ == null) o.hx__closures__ = {};
            else f = o.hx__closures__[m.__id__];
            if (f == null) {
                f = function() {
                    return f.method.apply(f.scope, arguments);
                };
                f.scope = o;
                f.method = m;
                o.hx__closures__[m.__id__] = f;
            }
            return f;
        };
        var $_;
        var $estr = function() {
            return _hcmn_.js_Boot.__string_rec(this, '');
        };
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

        haxe.IMap = function() {}
        haxe.IMap.prototype = {

        };
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        if (typeof soundmanager == 'undefined') {
            var soundmanager = {};
        };
        soundmanager.Activator = function(context) {};
        soundmanager.Activator = ck_implements(soundmanager.Activator, clientkernelModulesApi.IModuleActivator);
        soundmanager.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        soundmanager.Activator.__name__ = ["soundmanager", "Activator"];
        soundmanager.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, clientkernelLoaderApi.IVariableRegistry]).then(function(context1) {
                soundmanager.ExternalService.initialize(context1);
                var isADX = soundmanager.ExternalService.variableRegistry.get("CRIWARE.exclude");
                if (isADX == null || isADX == "false") soundmanager.ExternalService.assetRegistry.getAsset("soundplayer-assets").getContent().then(function(sound) {
                    context1.registerService(new soundmanager.SoundManagerFactory(context1, {
                        adx: true
                    }), soundManagerApi.SoundManagerDeclaration, null);
                });
                else if (!soundmanager.ExternalService.checkIsIE()) soundmanager.ExternalService.assetRegistry.getAsset("soundplayer-assets/sounds").getContent().then(function(sound1) {
                    context1.registerService(new soundmanager.SoundManagerFactory(context1, sound1), soundManagerApi.SoundManagerDeclaration, null);
                });
                else soundmanager.ExternalService.assetRegistry.getAsset("soundplayer-assets/soundsIE").getContent().then(function(sound2) {
                    soundmanager.ExternalService.assetRegistry.getAsset("soundplayer-assets/soundMapIE").getContent().then(function(map) {
                        soundmanager.ExternalService.soundMapIE = map;
                        context1.registerService(new soundmanager.SoundManagerFactory(context1, sound2), soundManagerApi.SoundManagerDeclaration, null);
                    });
                });
            });
        };
        soundmanager.Activator.prototype.stop = function(context) {};
        soundmanager.Activator.main = function() {};
        soundmanager.Activator.prototype.__class__ = soundmanager.Activator;
        soundmanager.ExternalService = function() {};
        soundmanager.ExternalService.__name__ = ["soundmanager", "ExternalService"];
        soundmanager.ExternalService.assetRegistry = null;
        soundmanager.ExternalService.variableRegistry = null;
        soundmanager.ExternalService.soundMapIE = null;
        soundmanager.ExternalService.initialize = function(context) {
            soundmanager.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            soundmanager.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
        };
        soundmanager.ExternalService.isMobileGame = function() {
            if (soundmanager.ExternalService.variableRegistry.get("skin") == "mobile" || soundmanager.ExternalService.variableRegistry.get("assetPack") == "mobile") return true;
            return false;
        };
        soundmanager.ExternalService.checkIsIE = function() {
            return soundmanager.ExternalService.variableRegistry.get("browserIE") == "true";
        };
        soundmanager.ExternalService.prototype.__class__ = soundmanager.ExternalService;
        soundmanager.SoundComponent = function(sound) {
            this.muted = false;
            this.map = new _hcmn_.haxe_ds_StringMap();
            this.sound = sound;
            this.events = new soundmanager.SoundEvents();
            Visibility.change($bind(this, this.handleVisibilityChange));
        };
        soundmanager.SoundComponent.__name__ = ["soundmanager", "SoundComponent"];
        soundmanager.SoundComponent.prototype.sound = null;
        soundmanager.SoundComponent.prototype.map = null;
        soundmanager.SoundComponent.prototype.events = null;
        soundmanager.SoundComponent.prototype.muted = null;
        soundmanager.SoundComponent.prototype.getEvents = function() {
            return this.events;
        };
        soundmanager.SoundComponent.prototype.play = function(id) {
            if (!this.map.exists(id)) {
                var value = this.sound.play(id);
                this.map.set(id, value);
                this.attachToEvents(id);
            } else {
                this.stop(id);
                this.play(id);
            }
        };
        soundmanager.SoundComponent.prototype.stop = function(id) {
            if (id == null) this.sound.stop();
            if (this.map.exists(id)) {
                this.sound.stop(this.map.get(id));
                this.map.remove(id);
            }
        };
        soundmanager.SoundComponent.prototype.muteAll = function() {
            howler.Howler.mute(true);
            this.muted = true;
        };
        soundmanager.SoundComponent.prototype.unmuteAll = function() {
            howler.Howler.mute(false);
            this.muted = false;
        };
        soundmanager.SoundComponent.prototype.mute = function(id) {
            if (this.muted) return;
            if (this.map.exists(id)) this.sound.mute(true, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.unmute = function(id) {
            if (this.map.exists(id)) this.sound.mute(false, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.pause = function(id) {
            if (this.map.exists(id)) this.sound.pause(this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.setRate = function(data) {
            if (this.map.exists(data.soundId)) this.sound.rate(data.rate, this.map.get(data.soundId));
        };
        soundmanager.SoundComponent.prototype.setVolume = function(data) {
            if (this.map.exists(data.soundId)) this.sound.volume(data.volume, this.map.get(data.soundId));
        };
        soundmanager.SoundComponent.prototype.fadeIn = function(properties) {
            if (!this.map.exists(properties.soundId)) {
                this.attachToEvents(properties.soundId);
                var value = this.sound.play(properties.soundId);
                this.map.set(properties.soundId, value);
                this.sound.fade(0, 1, properties.length, this.map.get(properties.soundId));
            } else {
                this.sound.off("fade", null, this.map.get(properties.soundId));
                this.stop(properties.soundId);
                this.fadeIn(properties);
            }
        };
        soundmanager.SoundComponent.prototype.fadeOut = function(properties) {
            var _g = this;
            if (this.map.exists(properties.soundId)) {
                this.sound.fade(1, 0, properties.length, this.map.get(properties.soundId));
                this.sound.on("fade", function(id) {
                    _g.sound.stop(id);
                    _g.map.remove(properties.soundId);
                }, this.map.get(properties.soundId));
            }
        };
        soundmanager.SoundComponent.prototype.onPlay = function(id) {
            var _g = this;
            this.sound.once("play", function(i) {
                _g.events.ON_PLAY().dispatch(id);
            }, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.onFinish = function(id) {
            var _g = this;
            this.sound.once("end", function(i) {
                if (!_g.sound.loop(i)) _g.events.ON_FINISH().dispatch(id);
            }, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.onStop = function(id) {
            var _g = this;
            this.sound.once("stop", function(i) {
                _g.events.ON_STOP().dispatch(id);
                _g.events.ON_FINISH().dispatch(id);
            }, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.onPause = function(id) {
            var _g = this;
            this.sound.on("pause", function(i) {
                _g.events.ON_PAUSE().dispatch(id);
            }, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.onFade = function(id) {
            var _g = this;
            this.sound.on("fade", function(i) {
                if (_g.sound.volume(i) == 0 || _g.sound.volume(i) == 1) {
                    if (_g.sound.volume(i) == 0) _g.sound.off("fade", null, i);
                    _g.events.ON_FADE().dispatch(new soundManagerApi.SoundFadeData(id, _g.sound.volume(i)));
                }
            }, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.onRate = function(id) {
            this.sound.on("rate", function(i) {}, this.map.get(id));
        };
        soundmanager.SoundComponent.prototype.attachToEvents = function(id) {
            this.onStop(id);
            this.onFinish(id);
        };
        soundmanager.SoundComponent.prototype.handleVisibilityChange = function(e, state) {
            if (state == "hidden") howler.Howler.mute(true);
            else if (state == "visible" && !this.muted) howler.Howler.mute(false);
        };
        soundmanager.SoundComponent.prototype.__class__ = soundmanager.SoundComponent;
        soundmanager.SoundComponentADX = function(context) {
            this.muted = false;
            this.players = new _hcmn_.haxe_ds_StringMap();
            this.playbacks = new _hcmn_.haxe_ds_StringMap();
            this.volumes = new _hcmn_.haxe_ds_StringMap();
            this.events = new soundmanager.SoundEvents();
            Visibility.change($bind(this, this.handleVisibilityChange));
        };
        soundmanager.SoundComponentADX.__name__ = ["soundmanager", "SoundComponentADX"];
        soundmanager.SoundComponentADX.prototype.players = null;
        soundmanager.SoundComponentADX.prototype.playbacks = null;
        soundmanager.SoundComponentADX.prototype.volumes = null;
        soundmanager.SoundComponentADX.prototype.events = null;
        soundmanager.SoundComponentADX.prototype.muted = null;
        soundmanager.SoundComponentADX.prototype.getEvents = function() {
            return this.events;
        };
        soundmanager.SoundComponentADX.prototype.randomString = function() {
            var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");
            var length = 16;
            var str = "";
            var _g = 0;
            while (_g < length) {
                var i = _g++;
                str += chars[_hcmn_.Math.floor(_hcmn_.Math.random() * chars.length)];
            }
            return str;
        };
        soundmanager.SoundComponentADX.prototype.createPlayer = function() {
            var id = this.randomString();
            var v = cri.AtomExPlayer.create();
            this.players.set(id, v);
            v;
            return id;
        };
        soundmanager.SoundComponentADX.prototype.play = function(soundPlay) {
            if (this.players.get(soundPlay.playerId) != null) {
                var playbackId = this.randomString();
                var v = this.players.get(soundPlay.playerId).start();
                this.playbacks.set(playbackId, v);
                v;
                soundPlay.playbackId = playbackId;
            }
        };
        soundmanager.SoundComponentADX.prototype.setCueName = function(data) {
            if (this.players.get(data.playerId) != null) this.players.get(data.playerId).setCueName(null, data.cue);
        };
        soundmanager.SoundComponentADX.prototype.setRandomSeed = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setRandomSeed(data.seed);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setFirstBlockIndex = function(data) {
            if (this.players.get(data.playbackId) != null) this.players.get(data.playbackId).setFirstBlockIndex(data.index);
        };
        soundmanager.SoundComponentADX.prototype.setNextBlockIndex = function(data) {
            if (this.playbacks.get(data.playbackId) != null) this.playbacks.get(data.playbackId).setNextBlockIndex(data.index);
        };
        soundmanager.SoundComponentADX.prototype.getCurrentBlockIndex = function(data) {
            if (this.playbacks.get(data.playbackId) != null) data.currentBlockIndex = this.playbacks.get(data.playbackId).getCurrentBlockIndex();
        };
        soundmanager.SoundComponentADX.prototype.setSelectorLabel = function(data) {
            if (this.players.get(data.playerId) != null) this.players.get(data.playerId).setSelectorLabel(data.selector, data.label);
        };
        soundmanager.SoundComponentADX.prototype.clearSelectorLabels = function(playerId) {
            if (this.players.get(playerId) != null) {
                this.players.get(playerId).clearSelectorLabels();
                this.players.get(playerId).update(this.playbacks.get(playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.pause = function(playerId) {
            if (this.players.get(playerId) != null) {
                if (this.players.get(playerId).isPaused()) {
                    this.players.get(playerId).pause(true);
                    this.players.get(playerId).update(this.playbacks.get(playerId));
                }
            }
        };
        soundmanager.SoundComponentADX.prototype.resume = function(playerId) {
            if (this.players.get(playerId) != null) {
                if (!this.players.get(playerId).isPaused()) {
                    this.players.get(playerId).pause(false);
                    this.players.get(playerId).update(this.playbacks.get(playerId));
                }
            }
        };
        soundmanager.SoundComponentADX.prototype.stop = function(playerId) {
            if (this.players.get(playerId) != null) {
                this.players.get(playerId).stop();
                this.players.get(playerId).update(this.playbacks.get(playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.attachFader = function(playerId) {
            if (this.players.get(playerId) != null) {
                this.players.get(playerId).attachFader();
                this.players.get(playerId).update(this.playbacks.get(playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setEnvelopeSustainLevel = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setEnvelopeSustainLevel(data.sustainLevel);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setEnvelopeReleaseTime = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setEnvelopeReleaseTime(data.releaseTimeMs);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setEnvelopeDecayTime = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setEnvelopeDecayTime(data.decayTimeMs);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setEnvelopeHoldTime = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setEnvelopeHoldTime(data.holdTimeMs);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setEnvelopeAttackTime = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setEnvelopeAttackTime(data.attackTimeMs);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setBusSendLevel = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setBusSendLevel(data.busIndex, data.level);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setBusSendLevelOffset = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setBusSendLevelOffset(data.busIndex, data.level);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.detachFader = function(playerId) {
            if (this.players.get(playerId) != null) {
                this.players.get(playerId).detachFader();
                this.players.get(playerId).update(this.playbacks.get(playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setPan3dVolume = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setPan3dVolume(data.volume);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
                var v = data.volume;
                this.volumes.set(data.playerId, v);
                v;
            }
        };
        soundmanager.SoundComponentADX.prototype.setPanType = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setPanType(data.panType);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setPan3dInteriorDistance = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setPan3dInteriorDistance(data.pan3dInteriorDistance);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setPan3dAngle = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setPan3dAngle(data.pan3DAngle);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setPitch = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setPitch(data.pitch);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.resetParameters = function(playerId) {
            if (this.players.get(playerId) != null) {
                this.players.get(playerId).resetParameters();
                this.players.get(playerId).update(this.playbacks.get(playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.setStartTime = function(data) {
            if (this.players.get(data.playerId) != null) {
                this.players.get(data.playerId).setStartTime(data.startTimeMs);
                this.players.get(data.playerId).update(this.playbacks.get(data.playerId));
            }
        };
        soundmanager.SoundComponentADX.prototype.muteAll = function() {
            cri.AtomEx.suspendWebAudio();
            this.muted = true;
        };
        soundmanager.SoundComponentADX.prototype.unmuteAll = function() {
            cri.AtomEx.resumeWebAudio();
            this.muted = false;
        };
        soundmanager.SoundComponentADX.prototype.mute = function(playerId) {
            if (this.players.get(playerId) != null) this.players.get(playerId).setVolume(0.0);
        };
        soundmanager.SoundComponentADX.prototype.unmute = function(playerId) {
            if (this.players.get(playerId) != null) this.players.get(playerId).setVolume(this.volumes.get(playerId));
        };
        soundmanager.SoundComponentADX.prototype.setRate = function(id, data) {};
        soundmanager.SoundComponentADX.prototype.setVolume = function(data) {
            var playerId = data.soundId;
            if (this.players.exists(playerId)) {
                this.players.get(playerId).setVolume(data.volume);
                var v = data.volume;
                this.volumes.set(playerId, v);
                v;
            }
        };
        soundmanager.SoundComponentADX.prototype.setFadeOutTime = function(data) {
            var playerId = data.playerId;
            if (this.players.exists(playerId)) this.players.get(playerId).setFadeOutTime(data.timeMs);
        };
        soundmanager.SoundComponentADX.prototype.getFadeOutTime = function(playerId) {
            if (this.players.get(playerId) != null) return this.players.get(playerId).getFadeOutTime();
            return -1;
        };
        soundmanager.SoundComponentADX.prototype.setFadeInTime = function(data) {
            var playerId = data.playerId;
            if (this.players.exists(playerId)) this.players.get(playerId).setFadeInTime(data.timeMs);
        };
        soundmanager.SoundComponentADX.prototype.getFadeInTime = function(playerId) {
            if (this.players.get(playerId) != null) return this.players.get(playerId).getFadeInTime();
            return -1;
        };
        soundmanager.SoundComponentADX.prototype.getStatus = function(data) {
            if (this.players.get(data.playerId) != null) data.status = this.players.get(data.playerId).getStatus();
            return null;
        };
        soundmanager.SoundComponentADX.prototype.onPlay = function(id) {};
        soundmanager.SoundComponentADX.prototype.onFinish = function(id) {};
        soundmanager.SoundComponentADX.prototype.onStop = function(id) {};
        soundmanager.SoundComponentADX.prototype.onPause = function(id) {};
        soundmanager.SoundComponentADX.prototype.onFade = function(id) {};
        soundmanager.SoundComponentADX.prototype.onRate = function(id) {};
        soundmanager.SoundComponentADX.prototype.attachToEvents = function(id) {
            this.onStop(id);
            this.onFinish(id);
        };
        soundmanager.SoundComponentADX.prototype.handleVisibilityChange = function(e, state) {
            if (state == "hidden") this.muteAll();
            else if (state == "visible" && !this.muted) this.unmuteAll();
        };
        soundmanager.SoundComponentADX.prototype.__class__ = soundmanager.SoundComponentADX;
        soundmanager.SoundComponentIE = function(sound, loopMap) {
            this.muted = false;
            this.soundMap = sound;
            this.loopMap = loopMap;
            this.events = new soundmanager.SoundEvents();
            Visibility.change($bind(this, this.handleVisibilityChange));
        };
        soundmanager.SoundComponentIE.__name__ = ["soundmanager", "SoundComponentIE"];
        soundmanager.SoundComponentIE.prototype.soundMap = null;
        soundmanager.SoundComponentIE.prototype.events = null;
        soundmanager.SoundComponentIE.prototype.loopMap = null;
        soundmanager.SoundComponentIE.prototype.muted = null;
        soundmanager.SoundComponentIE.prototype.getEvents = function() {
            return this.events;
        };
        soundmanager.SoundComponentIE.prototype.play = function(id) {
            if (!this.soundMap.exists(id)) return;
            if (this.soundMap.get(id).playing()) this.soundMap.get(id).stop();
            this.soundMap.get(id).play();
            this.soundMap.get(id).loop(this.loopMap.get(id));
            this.attachToEvents(id);
        };
        soundmanager.SoundComponentIE.prototype.stop = function(id) {
            if (id == null) {
                var $it0 = this.soundMap.keys();
                while ($it0.hasNext()) {
                    var key = $it0.next();
                    this.soundMap.get(key).stop();
                }
            }
            if (!this.soundMap.exists(id)) return;
            this.soundMap.get(id).loop(false);
            this.soundMap.get(id).stop();
        };
        soundmanager.SoundComponentIE.prototype.muteAll = function() {
            howler.Howler.mute(true);
            this.muted = true;
        };
        soundmanager.SoundComponentIE.prototype.unmuteAll = function() {
            howler.Howler.mute(false);
            this.muted = false;
        };
        soundmanager.SoundComponentIE.prototype.mute = function(id) {
            if (this.muted) return;
            if (this.soundMap.exists(id)) this.soundMap.get(id).mute(true);
        };
        soundmanager.SoundComponentIE.prototype.unmute = function(id) {
            if (this.soundMap.exists(id)) this.soundMap.get(id).mute(false);
        };
        soundmanager.SoundComponentIE.prototype.pause = function(id) {
            if (!this.soundMap.exists(id)) return;
            this.soundMap.get(id).pause();
        };
        soundmanager.SoundComponentIE.prototype.setRate = function(data) {};
        soundmanager.SoundComponentIE.prototype.setVolume = function(data) {
            if (!this.soundMap.exists(data.soundId)) return;
            this.soundMap.get(data.soundId).volume(data.volume);
        };
        soundmanager.SoundComponentIE.prototype.fadeIn = function(properties) {
            if (!this.soundMap.exists(properties.soundId)) return;
            if (this.soundMap.get(properties.soundId).playing()) this.soundMap.get(properties.soundId).stop();
            this.soundMap.get(properties.soundId).play();
            this.soundMap.get(properties.soundId).fade(0, 1, properties.length);
            this.soundMap.get(properties.soundId).loop(this.loopMap.get(properties.soundId));
        };
        soundmanager.SoundComponentIE.prototype.fadeOut = function(properties) {
            if (!this.soundMap.exists(properties.soundId)) return;
            this.soundMap.get(properties.soundId).fade(1, 0, properties.length);
            if (this.soundMap.get(properties.soundId).loop()) this.soundMap.get(properties.soundId).loop(false);
        };
        soundmanager.SoundComponentIE.prototype.onPlay = function(id) {};
        soundmanager.SoundComponentIE.prototype.onFinish = function(id) {
            if (this.soundMap.exists(id)) this.events.ON_FINISH().dispatch(id);
        };
        soundmanager.SoundComponentIE.prototype.onStop = function(id) {};
        soundmanager.SoundComponentIE.prototype.onPause = function(id) {};
        soundmanager.SoundComponentIE.prototype.onFade = function(id) {};
        soundmanager.SoundComponentIE.prototype.onRate = function(id) {};
        soundmanager.SoundComponentIE.prototype.attachToEvents = function(id) {
            this.onPlay(id);
            this.onStop(id);
            this.onPause(id);
            this.onFade(id);
            this.onFinish(id);
        };
        soundmanager.SoundComponentIE.prototype.handleVisibilityChange = function(e, state) {
            if (state == "hidden") howler.Howler.mute(true);
            else if (state == "visible" && !this.muted) howler.Howler.mute(false);
        };
        soundmanager.SoundComponentIE.prototype.__class__ = soundmanager.SoundComponentIE;
        soundmanager.SoundManager = function(context, sound) {
            this.assetsLoaded = false;
            this.ccontext = context;
            this.port = this.ccontext.getImplementedPort(soundManagerApi.ISoundManagerImplementationPort);
            if (sound.adx == true) {
                this.soundComponent = new soundmanager.SoundComponentADX(context);
                this.initialize(true);
            } else if (!soundmanager.ExternalService.checkIsIE()) {
                this.soundComponent = new soundmanager.SoundComponent(sound);
                this.initialize();
            } else {
                var loopMap = new _hcmn_.haxe_ds_StringMap();
                var map = soundmanager.ExternalService.soundMapIE;
                var _g = 0;
                var _g1 = _hcmn_.Reflect.fields(map);
                while (_g < _g1.length) {
                    var key = _g1[_g];
                    ++_g;
                    if (map[key].length == 3 && map[key][2] == 1) {
                        if (_hcmn_.__map_reserved[key] != null) loopMap.setReserved(key, true);
                        else loopMap.h[key] = true;
                    } else if (_hcmn_.__map_reserved[key] != null) loopMap.setReserved(key, false);
                    else loopMap.h[key] = false;
                }
                this.soundComponent = new soundmanager.SoundComponentIE(sound, loopMap);
                this.initialize();
            }
        };
        soundmanager.SoundManager.__name__ = ["soundmanager", "SoundManager"];
        soundmanager.SoundManager.prototype.port = null;
        soundmanager.SoundManager.prototype.ccontext = null;
        soundmanager.SoundManager.prototype.assetsLoaded = null;
        soundmanager.SoundManager.prototype.soundComponent = null;
        soundmanager.SoundManager.prototype.initialize = function(isADX) {
            if (isADX == null) isADX = false;
            if (isADX) {
                this.port.adx_createPlayer().publish(this.soundComponent.createPlayer());
                this.port.adx_attachFader().subscribe($bind(this, this.handleAdxAttachFader));
                this.port.adx_clearSelectorLabels().subscribe($bind(this, this.handleAdxClearSelectorLabels));
                this.port.adx_detachFader().subscribe($bind(this, this.handleAdxDetachFader));
                this.port.adx_getFadeInTime().subscribe($bind(this, this.handleAdxGetFadeInTime));
                this.port.adx_getFadeOutTime().subscribe($bind(this, this.handleAdxGetFadeOutTime));
                this.port.adx_mute().subscribe($bind(this, this.handleAdxMute));
                this.port.adx_muteAll().subscribe($bind(this, this.handleAdxMuteAll));
                this.port.adx_pause().subscribe($bind(this, this.handleAdxPause));
                this.port.adx_play().subscribe($bind(this, this.handleAdxPlay));
                this.port.adx_resetParameters().subscribe($bind(this, this.handleAdxResetParameters));
                this.port.adx_resume().subscribe($bind(this, this.handleAdxResume));
                this.port.adx_setBusSendLevel().subscribe($bind(this, this.handleAdxSetBusSendLevel));
                this.port.adx_setBusSendLevelOffset().subscribe($bind(this, this.handleAdxSetBusSendLevelOffset));
                this.port.adx_setCueName().subscribe($bind(this, this.handleAdxSetCueName));
                this.port.adx_setEnvelopeAttackTime().subscribe($bind(this, this.handleAdxSetEnvelopeAttackTime));
                this.port.adx_setEnvelopeDecayTime().subscribe($bind(this, this.handleAdxSetEnvelopeDecayTime));
                this.port.adx_setEnvelopeHoldTime().subscribe($bind(this, this.handleAdxSetEnvelopeHoldTime));
                this.port.adx_setEnvelopeReleaseTime().subscribe($bind(this, this.handleAdxSetEnvelopeReleaseTime));
                this.port.adx_setEnvelopeSustainLevel().subscribe($bind(this, this.handleAdxSetEnvelopeSustainLevel));
                this.port.adx_setFadeInTime().subscribe($bind(this, this.handleAdxSetFadeInTime));
                this.port.adx_setFadeOutTime().subscribe($bind(this, this.handleAdxSetFadeOutTime));
                this.port.adx_setFirstBlockIndex().subscribe($bind(this, this.handleAdxSetFirstBlockIndex));
                this.port.adx_setNextBlockIndex().subscribe($bind(this, this.handleAdxSetNextBlockIndex));
                this.port.adx_setPan3dAngle().subscribe($bind(this, this.handleAdxSetPan3dAngle));
                this.port.adx_setPan3dInteriorDistance().subscribe($bind(this, this.handleAdxSetPan3dInteriorDistance));
                this.port.adx_setPan3dVolume().subscribe($bind(this, this.handleAdxSetPan3dVolume));
                this.port.adx_setPanType().subscribe($bind(this, this.handleAdxSetPanType));
                this.port.adx_setPitch().subscribe($bind(this, this.handleAdxSetPitch));
                this.port.adx_setRandomSeed().subscribe($bind(this, this.handleAdxSetRandomSeed));
                this.port.adx_setSelectorLabel().subscribe($bind(this, this.handleAdxSetSelectorLabel));
                this.port.adx_getCurrentBlockIndex().subscribe($bind(this, this.handleAdxGetCurrentBlockIndex));
                this.port.adx_setStartTime().subscribe($bind(this, this.handleAdxSetStartTime));
                this.port.adx_setVolume().subscribe($bind(this, this.handleAdxSetVolume));
                this.port.adx_stop().subscribe($bind(this, this.handleAdxStop));
                this.port.adx_unmute().subscribe($bind(this, this.handleAdxUnmute));
                this.port.adx_unmuteAll().subscribe($bind(this, this.handleAdxUnmuteAll));
                this.port.adx_getPlayerStatus().subscribe($bind(this, this.handleAdxGetPlayerStatus));
            } else {
                this.port.play().subscribe($bind(this, this.handlePlay));
                this.port.stop().subscribe($bind(this, this.handleStop));
                this.port.fadeIn().subscribe($bind(this, this.handleFadeIn));
                this.port.fadeOut().subscribe($bind(this, this.handleFadeOut));
                this.port.mute().subscribe($bind(this, this.handleMute));
                this.port.muteAll().subscribe($bind(this, this.handleMuteAll));
                this.port.unmute().subscribe($bind(this, this.handleUnmute));
                this.port.unmuteAll().subscribe($bind(this, this.handleUnmuteAll));
                this.port.pause().subscribe($bind(this, this.handlePause));
                this.port.volume().subscribe($bind(this, this.handleVolume));
                this.port.rate().subscribe($bind(this, this.handleRate));
            }
            this.soundComponent.getEvents().ON_PLAY().addListener($bind(this, this.handleOnPlay));
            this.soundComponent.getEvents().ON_STOP().addListener($bind(this, this.handleOnStop));
            this.soundComponent.getEvents().ON_FINISH().addListener($bind(this, this.handleOnFinish));
            this.soundComponent.getEvents().ON_PAUSE().addListener($bind(this, this.handleOnPause));
            this.soundComponent.getEvents().ON_FADE().addListener($bind(this, this.handleOnFade));
        };
        soundmanager.SoundManager.prototype.handleAdxCreatePlayer = function(e) {
            var id = this.soundComponent.createPlayer();
        };
        soundmanager.SoundManager.prototype.handleAdxGetCurrentBlockIndex = function(e) {
            this.soundComponent.getCurrentBlockIndex(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxAttachFader = function(e) {
            this.soundComponent.attachFader(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxClearSelectorLabels = function(e) {
            this.soundComponent.clearSelectorLabels(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxDetachFader = function(e) {
            this.soundComponent.detachFader(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxGetFadeInTime = function(e) {
            this.soundComponent.getFadeInTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxGetFadeOutTime = function(e) {
            this.soundComponent.getFadeOutTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxMute = function(e) {
            this.soundComponent.mute(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxMuteAll = function(e) {
            this.soundComponent.muteAll(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxPause = function(e) {
            this.soundComponent.pause(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxPlay = function(e) {
            this.soundComponent.play(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxResetParameters = function(e) {
            this.soundComponent.resetParameters(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxResume = function(e) {
            this.soundComponent.resume(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetBusSendLevel = function(e) {
            this.soundComponent.setBusSendLevel(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetBusSendLevelOffset = function(e) {
            this.soundComponent.setBusSendLevel(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetCueName = function(e) {
            this.soundComponent.setCueName(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetEnvelopeAttackTime = function(e) {
            this.soundComponent.setEnvelopeAttackTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetEnvelopeDecayTime = function(e) {
            this.soundComponent.setEnvelopeDecayTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetEnvelopeHoldTime = function(e) {
            this.soundComponent.setEnvelopeHoldTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetEnvelopeReleaseTime = function(e) {
            this.soundComponent.setEnvelopeReleaseTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetEnvelopeSustainLevel = function(e) {
            this.soundComponent.setEnvelopeSustainLevel(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetFadeInTime = function(e) {
            this.soundComponent.setFadeInTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetFadeOutTime = function(e) {
            this.soundComponent.setFadeOutTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetFirstBlockIndex = function(e) {
            this.soundComponent.setFirstBlockIndex(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetNextBlockIndex = function(e) {
            this.soundComponent.setNextBlockIndex(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetPan3dAngle = function(e) {
            this.soundComponent.setPan3dAngle(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetPan3dInteriorDistance = function(e) {
            this.soundComponent.setPan3dInteriorDistance(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetPan3dVolume = function(e) {
            this.soundComponent.setPan3dVolume(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetPanType = function(e) {
            this.soundComponent.setPanType(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetPitch = function(e) {
            this.soundComponent.setPitch(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetRandomSeed = function(e) {
            this.soundComponent.setRandomSeed(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetSelectorLabel = function(e) {
            this.soundComponent.setSelectorLabel(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetStartTime = function(e) {
            this.soundComponent.setStartTime(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxSetVolume = function(e) {
            this.soundComponent.setVolume(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxStop = function(e) {
            this.soundComponent.stop(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxUnmute = function(e) {
            this.soundComponent.unmute(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxUnmuteAll = function(e) {
            this.soundComponent.unmuteAll(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleAdxGetPlayerStatus = function(e) {
            this.soundComponent.getStatus(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handlePlay = function(e) {
            this.soundComponent.play(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleStop = function(e) {
            this.soundComponent.stop(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleFadeIn = function(e) {
            this.soundComponent.fadeIn(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleFadeOut = function(e) {
            this.soundComponent.fadeOut(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleMute = function(e) {
            this.soundComponent.mute(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleMuteAll = function(e) {
            this.soundComponent.muteAll();
        };
        soundmanager.SoundManager.prototype.handleUnmute = function(e) {
            this.soundComponent.unmute(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleUnmuteAll = function(e) {
            this.soundComponent.unmuteAll();
        };
        soundmanager.SoundManager.prototype.handlePause = function(e) {
            this.soundComponent.pause(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleVolume = function(e) {
            this.soundComponent.setVolume(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleRate = function(e) {
            this.soundComponent.setRate(e.getPayload());
        };
        soundmanager.SoundManager.prototype.handleOnPlay = function(e) {
            this.port.onPlay().publish(e);
        };
        soundmanager.SoundManager.prototype.handleOnStop = function(e) {
            this.port.onStop().publish(e);
        };
        soundmanager.SoundManager.prototype.handleOnFinish = function(e) {
            this.port.onFinish().publish(e);
        };
        soundmanager.SoundManager.prototype.handleOnPause = function(e) {
            this.port.onPause().publish(e);
        };
        soundmanager.SoundManager.prototype.handleOnFade = function(e) {
            this.port.onFade().publish("");
        };
        soundmanager.SoundManager.prototype.__class__ = soundmanager.SoundManager;
        soundmanager.SoundManagerFactory = function(context, sound) {
            this.context = context;
            this.sound = sound;
        };
        soundmanager.SoundManagerFactory = ck_implements(soundmanager.SoundManagerFactory, clientkernelModulesApi.IService);
        soundmanager.SoundManagerFactory = ck_implements(soundmanager.SoundManagerFactory, componentmodelComponentApi.IComponentFactory);
        soundmanager.SoundManagerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        soundmanager.SoundManagerFactory.__name__ = ["soundmanager", "SoundManagerFactory"];
        soundmanager.SoundManagerFactory.prototype.context = null;
        soundmanager.SoundManagerFactory.prototype.sound = null;
        soundmanager.SoundManagerFactory.prototype.getComponentDeclaration = function() {
            return soundManagerApi.SoundManagerDeclaration;
        };
        soundmanager.SoundManagerFactory.prototype.createComponent = function(context) {
            new soundmanager.SoundManager(context, this.sound);
        };
        soundmanager.SoundManagerFactory.prototype.__class__ = soundmanager.SoundManagerFactory;
        soundmanager.BaseEvent = function() {
            this._signal = new _hcmn_.msignal_Signal1();
        };
        soundmanager.BaseEvent.__name__ = ["soundmanager", "BaseEvent"];
        soundmanager.BaseEvent.prototype._signal = null;
        soundmanager.BaseEvent.prototype.addListener = function(listener) {
            this._signal.add(listener);
        };
        soundmanager.BaseEvent.prototype.removeListener = function(listener) {
            this._signal.remove(listener);
        };
        soundmanager.BaseEvent.prototype.dispatch = function(data) {
            this._signal.dispatch(data);
        };
        soundmanager.BaseEvent.prototype.__class__ = soundmanager.BaseEvent;
        soundmanager.SoundEvents = function() {
            this.onPlay = new soundmanager.BaseEvent();
            this.onFinish = new soundmanager.BaseEvent();
            this.onStop = new soundmanager.BaseEvent();
            this.onPause = new soundmanager.BaseEvent();
            this.onFade = new soundmanager.BaseEvent();
        };
        soundmanager.SoundEvents.__name__ = ["soundmanager", "SoundEvents"];
        soundmanager.SoundEvents.prototype.onPlay = null;
        soundmanager.SoundEvents.prototype.onFinish = null;
        soundmanager.SoundEvents.prototype.onStop = null;
        soundmanager.SoundEvents.prototype.onPause = null;
        soundmanager.SoundEvents.prototype.onMute = null;
        soundmanager.SoundEvents.prototype.onFade = null;
        soundmanager.SoundEvents.prototype.onLoaded = null;
        soundmanager.SoundEvents.prototype.ON_PLAY = function() {
            return this.onPlay;
        };
        soundmanager.SoundEvents.prototype.ON_FINISH = function() {
            return this.onFinish;
        };
        soundmanager.SoundEvents.prototype.ON_STOP = function() {
            return this.onStop;
        };
        soundmanager.SoundEvents.prototype.ON_PAUSE = function() {
            return this.onPause;
        };
        soundmanager.SoundEvents.prototype.ON_FADE = function() {
            return this.onFade;
        };
        soundmanager.SoundEvents.prototype.ON_LOADED = function() {
            return this.onLoaded;
        };
        soundmanager.SoundEvents.prototype.__class__ = soundmanager.SoundEvents;
        return {
            exports: soundmanager,
            activator: soundmanager.Activator
        };
    });
//# sourceURL=soundManager.js