!function(){"use strict";function e(e,t){var n=this,i=function(i){0!=e.isInitialized&&t.hasLayersError().then(function(c){c?t.reset(!0):t.script("selectLayer()").then(function(n){return t.script(""+i+"("+e.mergedLayerID+")")}).then(function(e){n.cancel()})})};n.selection=function(){0!=e.isInitialized&&t.hasLayersError().then(function(e){e?t.reset(!0):t.script("loadSelectionFromActiveMask()").then(function(e){n.cancel()})})},n.levels=function(){i("createAdjLevelsWithMask")},n.bc=function(){i("createAdjBrightnessContrastWithMask")},n.curves=function(){i("createAdjCurvesWithMask")},n.hs=function(){i("createAdjHueSaturationWithMask")},n.channel=function(){0!=e.isInitialized&&t.hasLayersError().then(function(e){e?t.reset(!0):t.script('createChannelFromLayerMask("TK Infinity Mask")').then(function(e){n.cancel()})})},n.apply=function(){0!=e.isInitialized&&t.hasLayersError().then(function(i){i?t.reset(!0):t.script("applyLayerMask("+e.originalLayerID+", "+e.mergedLayerID+")").then(function(e){n.cancel()})})},n.pixels=function(){0!=e.isInitialized&&t.hasLayersError().then(function(n){n?t.reset(!0):(t.script("applyMaskToBitmapLayer()"),document.getElementById("Luminosity").checked=!1,document.getElementById("R").checked=!1,document.getElementById("G").checked=!1,document.getElementById("B").checked=!1,document.getElementById("Saturation").checked=!1,e.isInitialized=!1)})},n.cancel=function(){t.reset()},n.openWebsite=function(){t.openWeb("http://www.goodlight.us")}}angular.module("app").controller("OutputController",e),e.$inject=["tk","ps"]}();