Mini Kabibi Habibi
(function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=8)}([function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};t.__esModule=!0;var i=r(4),o=r(6);function applyOptionalParams(e,t){for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return t}t.ref={active:function(){return{_ref:"document",_enum:"ordinal",_value:"targetEnum"}},first:function(){return{_ref:"document",_enum:"ordinal",_value:"first"}},next:function(){return{_ref:"document",_enum:"ordinal",_value:"next"}},previous:function(){return{_ref:"document",_enum:"ordinal",_value:"previous"}},title:function(e){return{_ref:"document",_name:e}},id:function(e){return{_ref:"document",_id:e}},offset:function(e){return{_ref:"document",_offset:e}},index:function(e){return{_ref:"document",_index:e}},name:function(e){return{_ref:"document",_name:e}},range:function(e,t){return{_obj:"document",index:e,count:t}}},t.colorSampler=function colorSampler(e,t,r){return{_obj:"colorSampler",_target:e,samplePoint:{horizontal:t,vertical:r}}},t.createPreview=function createPreview(e,t,r,n){return void 0===t&&(t=100),void 0===r&&(r=100),void 0===n&&(n=!1),{_obj:"createPreview",width:t,height:r,embedProfile:n,_target:e}},t.convertToProfile=function convertToProfile(e){return{_obj:"convertToProfile",engine:"huh",to:"okthen",_target:e}},t.rasterizeAllPlaced=function rasterizeAllPlaced(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!1),{_obj:"rasterizeAllPlaced",missing:t,filterFX:r,_target:e}},t.select=function select(e){return{_obj:"select",_target:e}},t.fixMissingLinkedAssets=function fixMissingLinkedAssets(e){return{_obj:"fixMissingLinkedAssets",_target:e}},t.hitTest=function hitTest(e,t,r,n,i){void 0===n&&(n=!1);var o={_obj:"hitTest",_target:e,x:t,y:r,ignoreEmptyGroups:n};return applyOptionalParams(o,{alpha:i}),o},t.duplicate=function duplicate(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n={_obj:"duplicate",untitled:t,merged:r};return applyOptionalParams(n,{name:e}),n},t.rotate=function rotate(e,t){return{_obj:"rotateEventEnum",_target:e,angle:t}},t.open=function open(e,t){var r={_obj:"open",null:{_path:e,_kind:"local"}};return applyOptionalParams(r,{forceMRU:t}),r},t.flip=function flip(e,t){return void 0===t&&(t="vertical"),{_obj:"flip",_target:e,axis:t}},t.resizeImage=function resizeImage(e,t,r){var i=n({_obj:"imageSize"},e);return applyOptionalParams(i,{interpolation:t,resolution:r}),i},t.resizeCanvas=function resizeCanvas(e,t){var r=n({_obj:"canvasSize"},e);return void 0!==t&&(r=n(n({},r),t)),r},t.flattenImage=function flattenImage(){return{_obj:"flattenImage"}},t.mergeVisible=function mergeVisible(){return{_obj:"mergeVisible"}},t.crop=function crop(e,t){return void 0===t&&(t=0),{_obj:"crop",to:{_obj:"rectangle",left:o.Pixel(e.left),top:o.Pixel(e.top),right:o.Pixel(e.right),bottom:o.Pixel(e.bottom)},angle:o.Angle(t)}},t.close=function close(e){return{_obj:"close",saving:{_enum:"saving",_value:e?"yes":"no"}}},t.revert=function revert(){return{_obj:"revert"}},function(e){e[e.None=1]="None",e[e.JPEGMaximumQuality=7]="JPEGMaximumQuality",e[e.JPEGHighQuality=8]="JPEGHighQuality",e[e.JPEGMediumQuality=9]="JPEGMediumQuality",e[e.JPEGLowQuality=10]="JPEGLowQuality",e[e.JPEGMinimumQuality=11]="JPEGMinimumQuality",e[e.JPEG2000MaximumQuality=14]="JPEG2000MaximumQuality",e[e.JPEG2000HighQuality=15]="JPEG2000HighQuality",e[e.JPEG2000MediumQuality=16]="JPEG2000MediumQuality",e[e.JPEG2000LowQuality=17]="JPEG2000LowQuality",e[e.JPEG2000MinimumQuality=18]="JPEG2000MinimumQuality",e[e.JPEG2000LosslessQuality=19]="JPEG2000LosslessQuality",e[e.ZIP=65540]="ZIP"}(t.PDFCompressionType||(t.PDFCompressionType={})),t.save=function save(e,t,r){return{_obj:"save",documentID:e,in:t,as:r}},t.saveDocumentDialog=function saveDocumentDialog(){return{name:"save",descriptor:{},options:{dialogOptions:"dontDisplay"}}},t.getProperties=function getProperties(e,t){return{_obj:"multiGet",_target:e,extendedReference:[t]}},t.getPropertiesRange=function getPropertiesRange(e,t,r){return void 0===t&&(t=1),void 0===r&&(r=-1),{_obj:"multiGet",_target:i.ref.active(),extendedReference:[e,{_obj:"document",index:t,count:r}]}},t.set=function set(e,r){return void 0===r&&(r=t.ref.active()),{_obj:"set",_target:r,to:e}},function(e){e.bitmap="bitmapMode",e.CMYKColor="CMYKColorMode",e.duotone="duotoneMode",e.grayscale="grayscaleMode",e.indexedColor="indexedColorMode",e.labColor="labColorMode",e.multichannel="multichannelMode",e.RGBColor="RGBColorMode"}(t.ColorModes||(t.ColorModes={})),t.makeFromHistoryState=function makeFromHistoryState(){return{_obj:"make",_target:{_ref:"document"},using:{_property:"currentHistoryState",_ref:"historyState"}}}},function(e,t,r){"use strict";var n,i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function applyOptionalParams(e,t){for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return t}function fillLayerSetup(e){void 0===e&&(e={});var t={_obj:"make",_target:[{_ref:"contentLayer"}],using:{_obj:"contentLayer",type:{}}};return applyOptionalParams(t.using,{name:e.name,color:e.color?{_enum:"color",_value:e.color}:void 0,mode:e.mode?{_enum:"blendMode",_value:e.mode}:void 0,opacity:e.opacity?{_unit:"percentUnit",_value:e.opacity}:void 0}),t}t.__esModule=!0,t.ref={selected:function(){return{_ref:"layer",_enum:"ordinal",_value:"targetEnum"}},next:function(){return{_ref:"layer",_enum:"ordinal",_value:"next"}},front:function(){return{_ref:"layer",_enum:"ordinal",_value:"front"}},previous:function(){return{_ref:"layer",_enum:"ordinal",_value:"previous"}},forward:function(){return{_ref:"layer",_enum:"ordinal",_value:"forward"}},backward:function(){return{_ref:"layer",_enum:"ordinal",_value:"backward"}},back:function(){return{_ref:"layer",_enum:"ordinal",_value:"back"}},all:function(){return{_ref:"layer",_enum:"ordinal",_value:"all"}},name:function(e){return{_ref:"layer",_name:e}},id:function(e){return{_ref:"layer",_id:e}},offset:function(e){return{_ref:"layer",_offset:e}},index:function(e){return{_ref:"layer",_index:e}},range:function(e,t){return{_obj:"layer",index:e,count:t}}},t.convertPlacedToLinked=function convertPlacedToLinked(e,t){return{_obj:"convertPlacedToLinked",_target:e,destination:t}},t.setPlacedLayerComp=function setPlacedLayerComp(e){return{_obj:"setPlacedLayerComp",_target:t.ref.selected(),compId:e}},t.createClippingMask=function createClippingMask(){return{_obj:"groupEvent",_target:t.ref.selected()}},t.releaseClippingMask=function releaseClippingMask(){return{_obj:"ungroup",_target:t.ref.selected()}},t.applyLocking=function applyLocking(e,t){return{_obj:"applyLocking",layerLocking:t,_target:e}},t.linkLayers=function linkLayers(){return{_obj:"linkSelectedLayers",_target:t.ref.selected()}},t.unlinkLayers=function unlinkLayers(){return{_obj:"unlinkSelectedLayers",_target:t.ref.selected()}},t.reorderEffects=function reorderEffects(e,t,r,n,i){var o={_obj:"reorderFX",_target:e,from:t,to:r,effectType:n};return applyOptionalParams(o,{duplicate:i}),o},t.addLayerToGroupByDrag=function addLayerToGroupByDrag(e){return{_obj:"addLayerTogroupByDrag",_target:t.ref.selected(),to:e}},t.selectLinkedLayers=function selectLinkedLayers(e){return{_obj:"selectLinkedLayers",_target:e}},t.selectAllLayers=function selectAllLayers(){return{_obj:"selectAllLayers",_target:t.ref.selected()}},t.selectNoLayers=function selectNoLayers(){return{_obj:"selectNoLayers",_target:t.ref.selected()}},t.activateFindLayers=function activateFindLayers(){return{_obj:"findLayers",_target:t.ref.selected()}},t.activateRenameLayer=function activateRenameLayer(){return{_obj:"renameLayer",_target:t.ref.selected()}},t.disableEffects=function disableEffects(e){return{_obj:"disableLayerFX",_target:e}},t.disableStyle=function disableStyle(e){return{_obj:"disableLayerStyle",_target:e}},t.wrapEnum=function(e,t){return{_enum:e,_value:t}},t.rasterizeLayer=function rasterizeLayer(e,r){var n={_obj:"rasterizeLayer",_target:e};return applyOptionalParams(n,{what:t.wrapEnum("rasterizeItem",r)}),n},t.reverseLayers=function reverseLayers(){return{_obj:"reverse",_target:t.ref.selected()}},t.clearStyle=function clearStyle(e){return{_obj:"clearStyle",_target:e}},t.applyStyleFile=function applyStyleFile(e,t){return{_obj:"applyStyleFile",_target:e,from:t}},t.saveStyleFile=function saveStyleFile(e,t,r){var n={_obj:"saveStyleFile",to:t,_target:e};return applyOptionalParams(n,{thumbnailPath:r}),n},t.ungroupLayers=function ungroupLayers(){return{_obj:"ungroupLayersEvent",_target:t.ref.selected()}},t.enableLink=function enableLink(e){return{_obj:"enableLayerLink",_target:e}},t.disableLink=function disableLink(e){return{_obj:"disableLayerLink",_target:e}},t.merge=function merge(){return{_obj:"mergeLayersNew"}},t.mergeVisible=function mergeVisible(){return{_obj:"mergeVisible"}},t.flattenImage=function flattenImage(){return{_obj:"flattenImage"}},t.exportLayer=function exportLayer(e){return{_obj:"export",saveDesc:e}},t.layersPanelInfo=function layersPanelInfo(e,t){return{_obj:"getLayersPanelInfo",_target:e,view:t}},t.applySVGOffset=function applySVGOffset(e){return i({_obj:"layerSVGcoordinateOffset"},e)},t.set=function set(e,t){return{_obj:"set",_target:e,to:t}},t.flip=function flip(e,t,r){return void 0===r&&(r=!1),{_obj:"flip",_target:e,axis:t,copy:r}},t.rotate=function rotate(e,t,r){return void 0===r&&(r=!1),{_obj:"rotate",_target:e,angle:t,copy:r}},t.transform=function transform(e,t){return i({_obj:"transform",_target:e},t)},t.makeLayer=function makeLayer(e){void 0===e&&(e={});var t={_obj:"make",_target:[{_ref:"layer"}],using:{_obj:"layer"}};return applyOptionalParams(t.using,{name:e.name,color:e.color?{_enum:"color",_value:e.color}:void 0,mode:e.mode?{_enum:"blendMode",_value:e.mode}:void 0,opacity:e.opacity?{_unit:"percentUnit",_value:e.opacity}:void 0,group:e.group,fillNeutral:e.fillNeutral}),t},t.makeFillLayer={solid:function(e,t){var r;return void 0===e&&(e={}),void 0===t&&(t={}),applyOptionalParams((r=fillLayerSetup(t)).using.type,{_obj:"solidColorLayer",color:e.color}),r},gradient:function(e,t){var r;return void 0===e&&(e={}),void 0===t&&(t={}),applyOptionalParams((r=fillLayerSetup(t)).using.type,{_obj:"gradientLayer",angle:e.angle,gradient:e.gradient||{}}),r},pattern:function(e,t){var r;return void 0===e&&(e={}),void 0===t&&(t={}),applyOptionalParams((r=fillLayerSetup(t)).using.type,{_obj:"patternLayer",angle:e.angle,pattern:e.pattern,scale:e.scale}),r}},t.makeGroup=function makeGroup(e){void 0===e&&(e={});var t=e.from;delete e.from;var r={_obj:"make",_target:[{_ref:"layerSection"}],using:{_obj:"layerSection"}};return applyOptionalParams(r.using,i(i({},e),{color:e.color?{_enum:"color",_value:e.color}:void 0,mode:e.mode?{_enum:"blendMode",_value:e.mode}:void 0,opacity:e.opacity?{_unit:"percentUnit",_value:e.opacity}:void 0})),applyOptionalParams(r,{from:t}),r},t.deleteLayer=function deleteLayer(e,t){return void 0===t&&(t=!1),{_obj:"delete",_target:e,deleteContained:t}},t.duplicate=function duplicate(e,t,r){var n={name:"duplicate",descriptor:{_target:e,version:5}};return applyOptionalParams(n.descriptor,{to:t,name:r}),n},function(e){e.select="0",e.deselect="removeFromSelection",e.add="addToSelection",e.addUpTo="addToSelectionContinuous"}(n=t.SelectionModifier||(t.SelectionModifier={})),t.select=function select(e,t,r){void 0===t&&(t=n.select);var i={_obj:"select",_target:e,selectionModifier:{_enum:"selectionModifierType",_value:t}};return applyOptionalParams(i,{makeVisible:r}),i},t.hide=function hide(e,t){var r={_obj:"hide",_target:e};return applyOptionalParams(r,{toggleOthers:t}),r},t.show=function show(e,t){var r={_obj:"show",_target:e};return applyOptionalParams(r,{toggleOthers:t}),r},t.link=function link(e,t){return{_obj:"link",_target:e,to:t}},t.unlink=function unlink(e,t){var r={_obj:"unlink",_target:e};return applyOptionalParams(r,{to:t}),r},t.move=function move(e,r){return{_obj:"move",_target:e,to:t.ref.index(r),version:5}},t.makeBackground=function makeBackground(e){return{_obj:"make",_target:[{_ref:"backgroundLayer"}],using:e}},t.getProperties=function getProperties(e,t,r){return void 0===r&&(r={}),{_obj:"multiGet",_target:e,extendedReference:[t],options:r}},t.getPropertiesRange=function getPropertiesRange(e,t,r,n,i){return void 0===r&&(r=0),void 0===n&&(n=-1),void 0===i&&(i={}),{_obj:"multiGet",_target:e,extendedReference:[t,{_obj:"layer",index:r,count:n}],options:i}},function(e){e.red="red",e.orange="orange",e.yellow="yellowColor",e.green="green",e.blue="blue",e.violet="violet",e.gray="gray"}(t.LabelColors||(t.LabelColors={})),function(e){e[e.any=0]="any",e[e.pixel=1]="pixel",e[e.adjustment=2]="adjustment",e[e.text=3]="text",e[e.vector=4]="vector",e[e.smartObject=5]="smartObject",e[e.video=6]="video",e[e.group=7]="group",e[e.threeD=8]="threeD",e[e.gradient=9]="gradient",e[e.pattern=10]="pattern",e[e.solidColor=11]="solidColor",e[e.background=12]="background",e[e.groupEnd=13]="groupEnd"}(t.Kinds||(t.Kinds={})),function(e){e.solid="solidColorLayer",e.gradient="gradientLayer",e.pattern="patternLayer"}(t.FillKinds||(t.FillKinds={}))},function(e,t,r){"use strict";t.__esModule=!0,t.ref={name:function(e){return{_ref:"actionSet",_name:e}},index:function(e){return{_ref:"actionSet",_index:e}},id:function(e){return{_ref:"actionSet",_id:e}},selected:function(){return{_ref:"actionSet",_enum:"ordinal",_value:"targetEnum"}}},t.remove=function remove(e){return void 0===e&&(e=t.ref.selected()),{_obj:"delete",_target:e}},t.rename=function rename(e,r){return void 0===e&&(e=t.ref.selected()),{_obj:"set",_target:{_ref:[{_ref:"property",_property:"title"},e]},to:{title:r}}},t.duplicate=function duplicate(e){return void 0===e&&(e=t.ref.selected()),{_obj:"duplicate",_target:e}},t.play=function play(e,r){return void 0===e&&(e=t.ref.selected()),void 0===r&&(r=!1),{_obj:"play",_target:e,continue:r}},t.getProperty=function getProperty(e,r){return void 0===r&&(r=t.ref.selected()),{_obj:"multiGet",_target:r,extendedReference:[e]}}},function(e,t,r){"use strict";t.__esModule=!0,t.ref={name:function(e){return{_ref:"action",_name:e}},index:function(e){return{_ref:"action",_index:e}},id:function(e){return{_ref:"action",_id:e}},selected:function(){return{_ref:"action",_enum:"ordinal",_value:"targetEnum"}}},t.play=function play(e,r){return void 0===e&&(e=t.ref.selected()),void 0===r&&(r=!1),{_obj:"play",_target:e,continue:r}},t.duplicate=function duplicate(e){return void 0===e&&(e=t.ref.selected()),{_obj:"duplicate",_target:e}},t.remove=function remove(e){return void 0===e&&(e=t.ref.selected()),{_obj:"delete",_target:e}},t.rename=function rename(e,r){return void 0===e&&(e=t.ref.selected()),{_obj:"set",_target:{_ref:[{_ref:"property",_property:"title"},e]},to:{title:r}}},t.getProperty=function getProperty(e,r){return void 0===r&&(r=t.ref.selected()),{_obj:"multiGet",_target:r,extendedReference:[e]}},t.getPropertiesRange=function getPropertiesRange(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=-1),{_obj:"multiGet",_target:t,extendedReference:[e,{_obj:"action",index:r,count:n}]}}},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};t.__esModule=!0,t.ref={active:function(){return{_ref:"application",_enum:"ordinal",_value:"targetEnum"}}},t.createLibraryElement=function createLibraryElement(e){return"object"==typeof e&&(e=JSON.stringify(e)),{_obj:"spacesLibraryElementCreated",_target:t.ref.active(),json:e}},t.chooseLibraryElement=function chooseLibraryElement(e){return"object"==typeof e&&(e=JSON.stringify(e)),{_obj:"spacesLibraryElementChosen",_target:t.ref.active(),json:e}},t.owlAction=function owlAction(e,r,n){return void 0===n&&(n=!1),{_obj:"owlAction",_target:t.ref.active(),owlPanelID:r,activate:n}},t.getPanelList=function getPanelList(){return{_obj:"owlAction",_target:t.ref.active(),owlCommand:"getPanelList"}},t.getPanelInfo=function getPanelInfo(e){return{_obj:"owlAction",_target:t.ref.active(),owlPanelID:e,owlCommand:"getPanelInfo"}},t.getApplicationFrameInfo=function getApplicationFrameInfo(){return{_obj:"owlAction",_target:t.ref.active(),owlCommand:"getApplicationFrameInfo"}},t.showPanel=function showPanel(e){return{_obj:"owlAction",_target:t.ref.active(),owlPanelID:e,owlCommand:"show"}},t.closePanel=function closePanel(e){return{_obj:"owlAction",_target:t.ref.active(),owlPanelID:e,owlCommand:"close"}},t.highlightPanel=function highlightPanel(e){return{_obj:"owlAction",_target:t.ref.active(),owlPanelID:e,owlCommand:"identify"}},t.openAndStartTutorial=function openAndStartTutorial(e){return{_obj:"openAndStartTutorial",_target:t.ref.active(),info:e}},t.showCoachmark=function showCoachmark(e,r,n){return{_obj:"showCoachmark",_target:t.ref.active(),type:e,position:r,description:n}},t.getToolList=function getToolList(){return{_obj:"uiInfo",_target:t.ref.active(),command:"getToolList"}},t.getToolInfoById=function getToolInfoById(e){return{_obj:"uiInfo",_target:t.ref.active(),command:"getToolInfo",toolID:e}},t.getCurrentToolbarSpecification=function getCurrentToolbarSpecification(){return{_obj:"uiInfo",_target:t.ref.active(),command:"getCurrentToolbarSpecification"}},t.getViewList=function getViewList(e){return{_obj:"uiInfo",_target:t.ref.active(),command:"getViewList",detailed:e}},t.getViewInfo=function getViewInfo(e,r){return{_obj:"uiInfo",_target:t.ref.active(),command:"getViewInfo",panel:e,viewID:r}},t.getModalViewInfo=function getModalViewInfo(e){return{_obj:"uiInfo",_target:t.ref.active(),command:"getModalViewInfo",viewID:e}},t.getMondoFilterViewInfo=function getMondoFilterViewInfo(){return{_obj:"uiInfo",_target:t.ref.active(),command:"getMondoFilterViewInfo"}},t.getCommandEnabled=function getCommandEnabled(e){return{_obj:"uiInfo",_target:t.ref.active(),command:"getCommandEnabled",commandID:e}},t.getFeatureList=function getFeatureList(){return{_obj:"featureInfo",_target:t.ref.active(),command:"getFeatureList"}},t.getFeatureInfo=function getFeatureInfo(e){return{_obj:"featureInfo",_target:t.ref.active(),command:"getFeatureInfo",feature:e}},t.getFeatureActive=function getFeatureActive(e){return{_obj:"featureInfo",_target:t.ref.active(),command:"getFeatureActive",feature:e}},t.getFeatureMetadata=function getFeatureMetadata(e){return{_obj:"featureInfo",_target:t.ref.active(),command:"getFeatureMeta",feature:e}},t.hideHomeScreen=function hideHomeScreen(){return{_obj:"hideHomeScreen",_target:t.ref.active()}},t.ImageColorModeClasses={bitmapMode:"bitmapMode",grayscaleMode:"grayscaleMode",RGBColorMode:"RGBColorMode",CMYKColorMode:"CMYKColorMode",labColorMode:"labColorMode"},t.BackgroundFillMethods={white:"white",black:"black",backgroundColor:"backgroundColor",transparent:"transparent",color:"color"},t.makeDocument=function makeDocument(e){var t,r,o,a,c,u;return t=e.mode,r=e.width,o=e.height,a=e.resolution,c=e.fill,{_obj:"make",new:void 0!==(u=i(e,["mode","width","height","resolution","fill"])).preset?n({_obj:"document"},u):void 0!==t&&void 0!==r&&void 0!==o&&void 0!==a&&void 0!==c?n({_obj:"document",mode:{_class:t},width:{_unit:"distanceUnit",_value:r},height:{_unit:"distanceUnit",_value:o},resolution:{_unit:"densityUnit",_value:a},fill:{_enum:"fill",_value:c}},u):n({_obj:"document"},e)}},t.getProperties=function getProperties(e){return{_obj:"multiGet",_target:t.ref.active(),extendedReference:[e]}}},function(e){e.exports=JSON.parse('{"name":"@photoshop/app","main":"dist/photoshop.js","typings":"dist/photoshop.d.ts","version":"0.6.3","scripts":{"build":"webpack --config webpack.config.js","dev":"NODE_ENV=dev webpack --config webpack.config.js","watch":"NODE_ENV=dev webpack --watch --config webpack.config.js","test":"tslint -p ./tsconfig.json","docs":"typedoc --tsconfig ./tsconfig.json ../../src/dom/","clean":"rm -rf ./dist"},"devDependencies":{"@alpha/typedoc-plugin-markdown":"2.3.0","@babel/core":"^7.4.5","@babel/parser":"^7.5.0","@babel/preset-env":"^7.4.5","@babel/preset-typescript":"^7.3.3","@babel/types":"^7.7.4","babel-loader":"^8.0.6","prettier":"^1.18.2","terser-webpack-plugin":"^2.3.5","ts-loader":"^6.2.1","tsconfig-paths-webpack-plugin":"^3.3.0","tslint":"^5.18.0","tslint-config-prettier":"^1.18.0","tslint-loader":"^3.5.4","tslint-plugin-prettier":"^2.0.1","typedoc":"0.16.10","typedoc-plugin-external-module-name":"^3.0.0","typescript":"^3.7.5","watch":"^1.0.2","webpack":"^4.41.5","webpack-cli":"^3.3.10","webpack-sources":"^1.4.3"},"publishConfig":{"registry":"https://artifactory.corp.adobe.com/artifactory/api/npm/npm-adobe-photoshop-release/","artifact_name":"alpha/uxp-api"},"files":["dist/photoshop.js"],"dependencies":{"@photoshop/descriptors":"0.2.12"}}')},function(e,t,r){"use strict";t.__esModule=!0;var n=r(7);function isAngleValue(e){return"angleUnit"===e._unit}function isDensityValue(e){return"densityUnit"===e._unit}function isDistanceValue(e){return"distanceUnit"===e._unit}function isPercentValue(e){return"percentUnit"===e._unit}function isPixelValue(e){return"pixelsUnit"===e._unit}function isPointValue(e){return"pointsUnit"===e._unit}function isMillimeterValue(e){return"millimetersUnit"===e._unit}function isCentimeterValue(e){return"centimetersUnit"===e._unit}function isInchValue(e){return"inchesUnit"===e._unit}function isPicaValue(e){return"picasUnit"===e._unit}t.Angle=function(e){return n.angle(e)},t.Density=function(e){return n.density(e)},t.Distance=function(e){return n.distance(e)},t.Percent=function(e){return n.percent(e)},t.Pixel=function(e){return n.pixels(e)},t.Point=function(e){return n.points(e)},t.Millimeter=function(e){return n.millimeters(e)},t.Centimeter=function(e){return n.centimeters(e)},t.Inch=function(e){return n.inches(e)},t.Pica=function(e){return n.picas(e)},t.isAngleValue=isAngleValue,t.isDensityValue=isDensityValue,t.isDistanceValue=isDistanceValue,t.isPercentValue=isPercentValue,t.isPixelValue=isPixelValue,t.isPointValue=isPointValue,t.isMillimeterValue=isMillimeterValue,t.isCentimeterValue=isCentimeterValue,t.isInchValue=isInchValue,t.isPicaValue=isPicaValue,t.FromAngle=function FromAngle(e){if(e&&isAngleValue(e))return e._value;throw new Error("descriptor is not of type AngleValue")},t.FromDensity=function FromDensity(e){if(e&&isDensityValue(e))return e._value;throw new Error("descriptor is not of type DensityValue")},t.FromDistance=function FromDistance(e){if(e&&isDistanceValue(e))return e._value;throw new Error("descriptor is not of type DistanceValue")},t.FromPercent=function FromPercent(e){if(e&&isPercentValue(e))return e._value;throw new Error("descriptor is not of type PercentValue")},t.FromPixel=function FromPixel(e){if(e&&isPixelValue(e))return e._value;throw new Error("descriptor is not of type PixelValue")},t.FromPoint=function FromPoint(e){if(e&&isPointValue(e))return e._value;throw new Error("descriptor is not of type PointValue")},t.FromMillimeter=function FromMillimeter(e){if(e&&isMillimeterValue(e))return e._value;throw new Error("descriptor is not of type MillimeterValue")},t.FromCentimeter=function FromCentimeter(e){if(e&&isCentimeterValue(e))return e._value;throw new Error("descriptor is not of type CentimeterValue")},t.FromInch=function FromInch(e){if(e&&isInchValue(e))return e._value;throw new Error("descriptor is not of type InchValue")},t.FromPica=function FromPica(e){if(e&&isPicaValue(e))return e._value;throw new Error("descriptor is not of type PicaValue")}},function(e,t,r){"use strict";function _unit(e,t){return{_unit:e+"Unit",_value:t}}t.__esModule=!0,t.density=_unit.bind(null,"density"),t.pixels=_unit.bind(null,"pixels"),t.px=t.pixels,t.percent=_unit.bind(null,"percent"),t.angle=_unit.bind(null,"angle"),t.inches=_unit.bind(null,"inches"),t.centimeters=_unit.bind(null,"centimeters"),t.cm=t.centimeters,t.picas=_unit.bind(null,"picas"),t.degrees=_unit.bind(null,"degrees"),t.number=_unit.bind(null,"number"),t.seconds=_unit.bind(null,"seconds"),t.points=_unit.bind(null,"points"),t.pt=t.points,t.millimeters=_unit.bind(null,"millimeters"),t.mm=t.millimeters,t.distance=_unit.bind(null,"distance"),t.hasSameUnits=function hasSameUnits(e){var t,r=(null===(t=e[0])||void 0===t?void 0:t._unit)||-1;return r&&e.every((function(e){return r===e._unit}))}},function(e,t,r){"use strict";var n;r.r(t),function(e){e[e.NoError=0]="NoError",e[e.UnknownError=1]="UnknownError",e[e.UserCancelled=2]="UserCancelled",e[e.NullPointer=3]="NullPointer",e[e.EnsureError=4]="EnsureError",e[e.RequireError=5]="RequireError",e[e.Timeout=6]="Timeout",e[e.InvalidType=10]="InvalidType",e[e.MissingArgument=999]="MissingArgument",e[e.InvalidArgument=1e3]="InvalidArgument",e[e.ScriptingEngineError=2e3]="ScriptingEngineError"}(n||(n={}));var i=window.require("photoshop").action,o=window.require("photoshop").core,a=window.require("uxp");function _unit(e,t){return{_unit:e+"Unit",_value:t}}_unit.bind(null,"density");var c=_unit.bind(null,"pixels"),u=_unit.bind(null,"percent"),l=_unit.bind(null,"angle");_unit.bind(null,"inches"),_unit.bind(null,"centimeters"),_unit.bind(null,"picas"),_unit.bind(null,"degrees"),_unit.bind(null,"number"),_unit.bind(null,"seconds"),_unit.bind(null,"points"),_unit.bind(null,"millimeters"),_unit.bind(null,"distance");function hasSameUnits(e){var t,r=(null===(t=e[0])||void 0===t?void 0:t._unit)||-1;return r&&e.every((function(e){return r===e._unit}))}var s,d,f,p,y,b,_,Angle=function(e){return l(e)},Percent=function(e){return u(e)},Pixel=function(e){return c(e)};function isAngleValue(e){return"angleUnit"===e._unit}function isPercentValue(e){return"percentUnit"===e._unit}function isPixelValue(e){return"pixelsUnit"===e._unit}function FromPixel(e){if(e&&isPixelValue(e))return e._value;throw new Error("descriptor is not of type PixelValue")}!function(e){e[e.ALL=0]="ALL",e[e.ERROR=1]="ERROR",e[e.NO=2]="NO"}(s||(s={})),function(e){e[e.DISCARD_CHANGES=0]="DISCARD_CHANGES",e[e.PROMPT_TO_SAVE_CHANGES=1]="PROMPT_TO_SAVE_CHANGES",e[e.SAVE_CHANGES=2]="SAVE_CHANGES"}(d||(d={})),function(e){e[e.END=0]="END",e[e.FRONT=1]="FRONT"}(f||(f={})),function(e){e.nearestNeighbor="nearestNeighbor",e.bilinear="bilinear",e.bicubic="bicubic",e.bicubicSmoother="bicubicSmoother",e.bicubicSharper="bicubicSharper",e.bicubicAutomatic="bicubicAutomatic",e.preserveDetailsUpscale="preserveDetailsUpscale",e.deepUpscale="deepUpscale"}(p||(p={})),function(e){e.nearestNeighbor="nearestNeighbor",e.bilinear="bilinear",e.bicubic="bicubic",e.bicubicSmoother="bicubicSmoother",e.bicubicSharper="bicubicSharper",e.bicubicAutomatic="bicubicAutomatic"}(y||(y={})),function(e){e.BOTTOMCENTER="bottom-center",e.BOTTOMLEFT="bottom-left",e.BOTTOMRIGHT="bottom-right",e.MIDDLECENTER="middle-center",e.MIDDLELEFT="middle-left",e.MIDDLERIGHT="middle-right",e.TOPCENTER="top-center",e.TOPLEFT="top-left",e.TOPRIGHT="top-right"}(b||(b={})),function(e){e.normal="normal",e.dissolve="dissolve",e.darken="darken",e.multiply="multiply",e.colorBurn="colorBurn",e.linearBurn="linearBurn",e.darkerColor="darkerColor",e.lighten="lighten",e.screen="screen",e.colorDodge="colorDodge",e.linearDodge="linearDodge",e.lighterColor="lighterColor",e.overlay="overlay",e.softLight="softLight",e.hardLight="hardLight",e.vividLight="vividLight",e.linearLight="linearLight",e.pinLight="pinLight",e.hardMix="hardMix",e.difference="difference",e.exclusion="exclusion",e.subtract="blendSubtraction",e.divide="blendDivide",e.hue="hue",e.saturation="saturation",e.color="color",e.luminosity="luminosity"}(_||(_={}));var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},__generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(c){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},m={modalBehavior:"execute"},g=!0;function batchPlay(e,t){return void 0===t&&(t=m),__awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(o){if(!0===t.synchronousExecution)throw new Error("BatchPlay is asynchronous, please use batchPlaySync");return r=Array.isArray(e)?e:[e],n=__assign(__assign({},t),{skipAnalytics:!0}),[2,i.batchPlay(r,n)]}))}))}function batchPlaySync(e,t){void 0===t&&(t=m);var r=Array.isArray(e)?e:[e],n=__assign(__assign({},t),{synchronousExecution:!0,skipAnalytics:!0});return i.batchPlay(r,n)}function validateReference(e){if(!g)return!0;try{return i.validateReference(e)}catch(e){return!1}}var P,j,O,w,S,L=r(0);!function(e){e.background="backgroundColor",e.black="black",e.foreground="foregroundColor",e.netscape="netscapeGray",e.none="none",e.semigray="gray50",e.white="white"}(P||(P={})),function(e){e[e.diffusion=0]="diffusion",e[e.noise=1]="noise",e[e.none=2]="none",e[e.pattern=3]="pattern"}(j||(j={})),function(e){e[e.blackwhite=0]="blackwhite",e[e.none=1]="none",e[e.primaries=2]="primaries",e[e.web=3]="web"}(O||(O={})),function(e){e[e.exact=0]="exact",e[e.localAdaptive=1]="localAdaptive",e[e.localPerceptual=2]="localPerceptual",e[e.localSelective=3]="localSelective",e[e.macOSPalette=4]="macOSPalette",e[e.masterAdaptive=5]="masterAdaptive",e[e.masterPerceptual=6]="masterPerceptual",e[e.masterSelective=7]="masterSelective",e[e.previousPalette=8]="previousPalette",e[e.uniform=9]="uniform",e[e.webPalette=10]="webPalette",e[e.windowsPalette=11]="windowsPalette"}(w||(w={})),function(e){e[e.optimizedBaseline=0]="optimizedBaseline",e[e.progressive=1]="progressive",e[e.standardBaseline=2]="standardBaseline"}(S||(S={}));var D,I,k=r(1),allLayerInfo=function(e,t){var r=void 0===t?L.ref.active():t;return Object(k.getPropertiesRange)(r,["name","layerID","layerKind","itemIndex"],e?0:1,-1,{failOnMissingProperty:!0,failOnMissingElement:!1})},x=(D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function __(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),Layer_awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},Layer_generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(c){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};function validateLayer(e){if(!validateReference([k.ref.id(e._id),L.ref.id(e._docId)]))throw new Error("This layer does not exist.")}!function(e){e[e.any=0]="any",e[e.pixel=1]="pixel",e[e.adjustment=2]="adjustment",e[e.text=3]="text",e[e.vector=4]="vector",e[e.smartObject=5]="smartObject",e[e.video=6]="video",e[e.group=7]="group",e[e.threeD=8]="threeD",e[e.gradient=9]="gradient",e[e.pattern=10]="pattern",e[e.solidColor=11]="solidColor",e[e.background=12]="background",e[e.groupEnd=13]="groupEnd"}(I||(I={}));var E={};function PSLayer(e,t,r){switch(E.hasOwnProperty(t)||(E[t]={}),null!=r?r:batchPlaySync(Object(k.getProperties)([k.ref.id(e),L.ref.id(t)],["layerKind"]))[0].layerKind){case I.groupEnd:throw new Error("Invalid Layer ID");case I.group:E[t][e]=new M(e,t);break;case I.pixel:default:E[t][e]=new A(e,t)}return E[t][e]}function _directRef(e){return[k.ref.id(e._id),L.ref.id(e._docId)]}var A=function(){function Layer(e,t){this._id=e,this._docId=t}return Object.defineProperty(Layer.prototype,"locked",{get:function(){validateLayer(this);var e,t=batchPlaySync(Object(k.getProperties)(_directRef(this),["layerLocking"]))[0].layerLocking;return(e=t).protectAll||e.protectArtboardAutonest||e.protectComposite||e.protectPosition||e.protectTransparency},set:function(e){validateLayer(this);var t=this.kind,r=K.activeDocument;if(t===I.background){if(!0===e)return;var n=batchPlaySync([Object(L.select)(L.ref.id(this._docId)),{_obj:"set",_target:k.ref.id(this._id),to:{}},Object(L.select)(L.ref.id(r._id))])[1].layerID;delete E[this._docId][this._id],this._id=n}else batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.set)(k.ref.id(this._id),{_obj:"layer",layerLocking:{_obj:"layerLocking",protectAll:e}}),Object(L.select)(L.ref.id(r._id))])},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"visible",{get:function(){return validateLayer(this),batchPlaySync(Object(k.getProperties)(_directRef(this),["visible"]))[0].visible},set:function(e){validateLayer(this);var t=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),e?Object(k.show)([k.ref.id(this._id)]):Object(k.hide)([k.ref.id(this._id)]),Object(L.select)(L.ref.id(t._id))])},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"kind",{get:function(){return validateLayer(this),1===this._id?I.background:batchPlaySync(Object(k.getProperties)(_directRef(this),["layerKind"]))[0].layerKind},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"bounds",{get:function(){validateLayer(this);var e=batchPlaySync(Object(k.getProperties)(_directRef(this),["bounds"]))[0].bounds;return{left:FromPixel(e.left),top:FromPixel(e.top),bottom:FromPixel(e.bottom),right:FromPixel(e.right)}},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"boundsNoEffects",{get:function(){validateLayer(this);var e=batchPlaySync(Object(k.getProperties)(_directRef(this),["boundsNoEffects"]))[0].boundsNoEffects;return{left:FromPixel(e.left),top:FromPixel(e.top),bottom:FromPixel(e.bottom),right:FromPixel(e.right)}},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"opacity",{get:function(){return validateLayer(this),100*batchPlaySync(Object(k.getProperties)(_directRef(this),["opacity"]))[0].opacity/255},set:function(e){validateLayer(this);var t=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.set)(k.ref.id(this._id),{_obj:"layer",opacity:Percent(e)}),Object(L.select)(L.ref.id(t._id))])},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"blendMode",{get:function(){validateLayer(this);var e=batchPlaySync(Object(k.getProperties)(_directRef(this),["mode"]))[0].mode;return _[e._value]},set:function(e){validateLayer(this);var t=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.set)(k.ref.id(this._id),{_obj:"layer",mode:{_enum:"blendMode",_value:_[e]}}),Object(L.select)(L.ref.id(t._id))])},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"linkedLayers",{get:function(){var e=this;validateLayer(this);var t=batchPlaySync(Object(k.getProperties)(_directRef(this),["linkedLayerIDs"]))[0].linkedLayerIDs;return Array.isArray(t)?t.map((function(t){return PSLayer(t,e._docId)})):[]},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"name",{get:function(){return validateLayer(this),batchPlaySync(Object(k.getProperties)(_directRef(this),["name"]))[0].name},set:function(e){validateLayer(this);var t=K.activeDocument,r=t.activeLayers;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.select)([k.ref.id(this._id)]),Object(k.set)(k.ref.id(this._id),{_obj:"layer",name:e}),Object(k.select)(r.map((function(e){return k.ref.id(e._id)}))),Object(L.select)(L.ref.id(t._id))])},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"parent",{get:function(){var e;validateLayer(this);var t=batchPlaySync(Object(k.getProperties)(_directRef(this),["parentLayerID"])),r=null===(e=null==t?void 0:t[0])||void 0===e?void 0:e.parentLayerID;return r&&r>=0?PSLayer(r,this._docId,I.group):null},enumerable:!0,configurable:!0}),Object.defineProperty(Layer.prototype,"selected",{get:function(){var e=this;validateLayer(this);var t=PSDocument(this._docId),r=[];try{r=t.activeLayers}catch(e){throw new Error("invalid document")}return r.some((function(t){return t._id===e._id}))},set:function(e){validateLayer(this);var t=K.activeDocument,r=batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.select)([k.ref.id(this._id)],e?k.SelectionModifier.add:k.SelectionModifier.deselect),Object(L.select)(L.ref.id(t._id))])[1];(null==r?void 0:r._obj)||e||(r=batchPlaySync(Object(k.selectNoLayers)())).message&&console.warn(r.message)},enumerable:!0,configurable:!0}),Layer.prototype.delete=function(){validateLayer(this);var e=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.deleteLayer)([k.ref.id(this._id)],!1),Object(L.select)(L.ref.id(e._id))])},Layer.prototype.duplicate=function(e,t){var r,n;return Layer_awaiter(this,void 0,void 0,(function(){var i,o,a,c;return Layer_generator(this,(function(u){switch(u.label){case 0:return validateLayer(this),validateDocument(i=PSDocument(void 0!==e?e._id:this._docId)),o=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._docId)),Object(k.duplicate)([k.ref.id(this._id)],L.ref.id(i._id),t),Object(L.getProperties)(L.ref.id(i._id),["targetLayersIDs"]),Object(L.select)(L.ref.id(o._id))])];case 1:return a=u.sent(),(null==(c=a[1])?void 0:c.ID)&&Array.isArray(c.ID)?1===c.ID.length?[2,PSLayer(c.ID[0],i._id)]:[2,PSLayer(a[2].targetLayersIDs[0]._id,i._id)]:1===this._id||"background"===(null===(n=null===(r=null==c?void 0:c._target)||void 0===r?void 0:r[0])||void 0===n?void 0:n._property)?[2,PSLayer(a[2].targetLayersIDs[0]._id,i._id)]:[2,null]}}))}))},Layer.prototype.link=function(e){var t=this;if(validateLayer(this),validateLayer(e),this._docId!==e._docId)throw new Error("You can only link layers in the same document");var r=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.link)(k.ref.id(this._id),[k.ref.id(e._id)]),Object(L.select)(L.ref.id(r._id))]);return[e._id,this._id].map((function(e){return PSLayer(e,t._docId)}))},Layer.prototype.unlink=function(){return Layer_awaiter(this,void 0,void 0,(function(){var e;return Layer_generator(this,(function(t){return validateLayer(this),e=K.activeDocument,batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.unlink)(k.ref.id(this._id)),Object(L.select)(L.ref.id(e._id))]),[2]}))}))},Layer.prototype.moveAbove=function(e){var t,r=this;validateLayer(this);var n,i=-1;if(void 0!==e){if(validateLayer(e),e._docId!==this._docId)throw new Error("provided layer does not exist on this document");var o=PSDocument(this._docId).layers;i=(l=o.findIndex((function(e){return e._id===r._id})))>o.findIndex((function(t){return t._id===e._id}))?-1:0,t=e}else{var a=this.parent;if(a&&a instanceof M){var c=a.children,u=(l=c.findIndex((function(e){return e._id===r._id})))-1;if((u=Math.max(u,0))===l)return;t=c[u]}else{var l,s=PSDocument(this._docId).layerTree;u=(l=s.findIndex((function(e){return e._id===r._id})))-1;if((u=Math.max(u,0))===l)return;t=s[u]}}n=this instanceof M?batchPlaySync(Object(k.getProperties)(_directRef(t),["itemIndex"]))[0].itemIndex:batchPlaySync(Object(k.getProperties)(_directRef(t),["itemIndex"]))[0].itemIndex+i;var d=K.activeDocument;if(void 0===batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.move)([k.ref.id(this._id)],n),Object(L.select)(L.ref.id(d._id))])[1]._obj)throw new Error("Invalid target for move (target is a child, or target results in no change)")},Layer.prototype.moveBelow=function(e){var t,r=this;validateLayer(this);var n,i=-1;if(void 0!==e){if(validateLayer(e),e._docId!==this._docId)throw new Error("provided layer does not exist on this document");var o=PSDocument(this._docId).layers;i=(l=o.findIndex((function(e){return e._id===r._id})))>o.findIndex((function(t){return t._id===e._id}))?-2:-1,t=e}else{var a=this.parent;if(a&&a instanceof M){var c=a.children,u=(l=c.findIndex((function(e){return e._id===r._id})))+1;if((u=Math.min(u,c.length-1))===l)return;t=c[u]}else{var l,s=PSDocument(this._docId).layerTree;u=(l=s.findIndex((function(e){return e._id===r._id})))+1;if((u=Math.min(u,s.length-1))===l)return;t=s[u]}}n=t instanceof M?function(e,t){for(var r=-1,n=0,i=0,o=batchPlaySync(allLayerInfo(null!==e.backgroundLayer,L.ref.id(e._id)))[0].list.reverse();i<o.length;i++){var a=o[i];if(a.layerKind===I.group)a.layerID===t&&(r=n),n++;else if(a.layerKind===I.groupEnd&&--n<=r)return a}return null}(PSDocument(this._docId),t._id).itemIndex-1:batchPlaySync(Object(k.getProperties)(_directRef(t),["itemIndex"]))[0].itemIndex+i;var d=K.activeDocument;if(void 0===batchPlaySync([Object(L.select)(L.ref.id(this._docId)),Object(k.move)([k.ref.id(this._id)],n),Object(L.select)(L.ref.id(d._id))])[1]._obj)throw new Error("Invalid target for move (background layer or target is a child)")},Layer.prototype.nudge=function(e,t){return Layer_awaiter(this,void 0,void 0,(function(){var r,n;return Layer_generator(this,(function(i){switch(i.label){case 0:if(validateLayer(this),"number"==typeof e&&"number"==typeof t)r=Pixel(e),n=Pixel(t);else{if(!hasSameUnits([e,t]))throw new Error("horizontal and vertical must be of the same type (percent, pixel).");if(!isPercentValue(e)&&!isPixelValue(e))throw new Error("horizontal and vertical must be percent or pixel values.");r=e,n=t}return[4,batchPlay(Object(k.transform)(k.ref.id(this._id),{offset:{_obj:"offset",horizontal:r,vertical:n},freeTransformCenterState:{_enum:"quadCenterState",_value:"QCSAverage"}}))];case 1:return i.sent(),[2]}}))}))},Layer.prototype.flip=function(e){return Layer_awaiter(this,void 0,void 0,(function(){var t,r=this;return Layer_generator(this,(function(n){switch(n.label){case 0:if(!["horizontal","vertical","both"].includes(e))throw new Error("axis must be 'horizontal', 'vertical', 'both'");return t=function(e){return Object(k.flip)(k.ref.id(r._id),{_enum:"orientation",_value:e})},[4,batchPlay("both"===e?[t("horizontal"),t("vertical")]:[t(e)])];case 1:return n.sent(),[2]}}))}))},Layer.prototype.scale=function(e,t,r){return Layer_awaiter(this,void 0,void 0,(function(){var n,i,o;return Layer_generator(this,(function(a){switch(a.label){case 0:if(validateLayer(this),"number"==typeof e&&"number"==typeof t)n=Percent(e),i=Percent(t);else{if(!hasSameUnits([e,t])||!isPercentValue(e))throw new Error("width and height must be of same type (percent).");n=e,i=t}if(o=y.bilinear,void 0!==r&&"interpolation"in r){if(!(r.interpolation in y))throw new Error("invalid interpolation option");o=r.interpolation}return[4,batchPlay(Object(k.transform)(k.ref.id(this._id),{width:n,height:i,interpolation:{_enum:"interpolation",_value:o},freeTransformCenterState:{_enum:"quadCenterState",_value:"QCSAverage"}}))];case 1:return a.sent(),[2]}}))}))},Layer.prototype.rotate=function(e,t){return Layer_awaiter(this,void 0,void 0,(function(){var r;return Layer_generator(this,(function(n){switch(n.label){case 0:if(validateLayer(this),"number"!=typeof e&&!isAngleValue(e))throw new Error("angle is of unexpected type.");if(r=y.bilinear,void 0!==t&&"interpolation"in t){if(!(t.interpolation in y))throw new Error("invalid interpolation option");r=t.interpolation}return[4,batchPlay(Object(k.transform)(k.ref.id(this._id),{angle:"number"==typeof e?Angle(e):e,interpolation:{_enum:"interpolation",_value:r},freeTransformCenterState:{_enum:"quadCenterState",_value:"QCSAverage"}}))];case 1:return n.sent(),[2]}}))}))},Layer.prototype.skew=function(e,t,r){return Layer_awaiter(this,void 0,void 0,(function(){var n,i,o;return Layer_generator(this,(function(a){switch(a.label){case 0:if(validateLayer(this),"number"==typeof e&&"number"==typeof t)n=Angle(e),i=Angle(t);else{if(!hasSameUnits([e,t])||!isAngleValue(e))throw new Error("angleH and angleV must be of same type (angle).");n=e,i=t}if(o=y.bilinear,void 0!==r&&"interpolation"in r){if(!(r.interpolation in y))throw new Error("invalid interpolation option");o=r.interpolation}return[4,batchPlay(Object(k.transform)(k.ref.id(this._id),{skew:{_obj:"point",horizontal:n,vertical:i},interpolation:{_enum:"interpolation",_value:o},freeTransformCenterState:{_enum:"quadCenterState",_value:"QCSAverage"}}))];case 1:return a.sent(),[2]}}))}))},Layer}(),C=A,M=function(e){function GroupLayer(t,r){var n=e.call(this,t,r)||this;return n.isGroupLayer=!0,n}return x(GroupLayer,e),Object.defineProperty(GroupLayer.prototype,"children",{get:function(){var e,t=this;validateLayer(this);K.activeDocument;var r=null!==PSDocument(this._docId).backgroundLayer;return function(e,t){if(!Array.isArray(e))return[];e.reverse();for(var r=-1,n=0,i=[],o=0,a=e;o<a.length;o++){var c=a[o];if(t===c.layerID)r=++n;else if(c.layerKind===I.groupEnd){if(r===n--)return i}else{var u=r===n;c.layerKind===I.group?(u&&i.push(c),n++):u&&i.push(c)}}return[]}(null===(e=batchPlaySync([Object(k.getPropertiesRange)(L.ref.id(this._docId),["name","layerID","layerKind","itemIndex"],r?0:1,-1,{failOnMissingProperty:!0,failOnMissingElement:!1})])[0])||void 0===e?void 0:e.list,this._id).map((function(e){return PSLayer(e.layerID,t._docId)}))},enumerable:!0,configurable:!0}),GroupLayer}(A),Document_awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},Document_generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(c){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};function validateDocument(e){if(!validateReference(L.ref.id(e._id)))throw new Error("This document does not exist.")}var T={};function PSDocument(e){return T.hasOwnProperty(e)||(T[e]=new V(e)),T[e]}var V=function(){function Document(e){this._id=e}return Object.defineProperty(Document.prototype,"activeLayers",{get:function(){var e=this;return validateDocument(this),batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["targetLayersIDs"]))[0].targetLayersIDs.map((function(t){return PSLayer(t._id,e._id)}))},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"artboards",{get:function(){var e=this;return validateDocument(this),batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["artboards"]))[0].artboards.list.map((function(e){return e.layerID})).map((function(t){return PSLayer(t,e._id,I.group)}))},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"layers",{get:function(){var e=this;validateDocument(this);var t=null!==this.backgroundLayer;return batchPlaySync(Object(k.getPropertiesRange)(L.ref.id(this._id),["layerID","layerKind"],t?0:1,-1,{failOnMissingProperty:!0,failOnMissingElement:!1}))[0].list.filter((function(e){return e.layerKind!==I.groupEnd})).reverse().map((function(t){return PSLayer(t.layerID,e._id,t.layerKind)}))},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"layerTree",{get:function(){validateDocument(this);var e=null!==this.backgroundLayer,t=batchPlaySync(Object(k.getPropertiesRange)(L.ref.id(this._id),["name","layerID","layerKind","itemIndex"],e?0:1,-1,{failOnMissingProperty:!0,failOnMissingElement:!1}))[0].list;t.reverse();for(var r=0,n=[[]],i=[],o=0,a=t;o<a.length;o++){var c=a[o];switch(c.layerKind){case k.Kinds.groupEnd:var u=PSLayer(i.pop(),this._id,k.Kinds.group);n.pop(),n[--r].push(u);break;case k.Kinds.group:r++,n.push([]),i.push(c.layerID);break;default:n[r].push(PSLayer(c.layerID,this._id,c.layerKind))}}return n[0]},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"backgroundLayer",{get:function(){return validateDocument(this),batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["hasBackgroundLayer"]))[0].hasBackgroundLayer?PSLayer(1,this._id,I.background):null},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"path",{get:function(){validateDocument(this);var e=batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["fileReference"]))[0];return e.fileReference?"local"===e.fileReference._kind?e.fileReference._path:"cloud"===e.fileReference._kind?JSON.parse(e.fileReference._path).cloud_id:"":""},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"title",{get:function(){return validateDocument(this),batchPlaySync([Object(L.getProperties)(L.ref.id(this._id),["title"])])[0].title},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"resolution",{get:function(){validateDocument(this);K.activeDocument;return batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["resolution"]))[0].resolution._value},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"width",{get:function(){validateDocument(this);var e=batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["width","resolution"])),t=e[0].width._value*(e[0].resolution._value/72);return Number(t.toFixed(0))},enumerable:!0,configurable:!0}),Object.defineProperty(Document.prototype,"height",{get:function(){validateDocument(this);var e=batchPlaySync(Object(L.getProperties)(L.ref.id(this._id),["height","resolution"])),t=e[0].height._value*(e[0].resolution._value/72);return Number(t.toFixed(0))},enumerable:!0,configurable:!0}),Document.prototype.close=function(e){return Document_awaiter(this,void 0,void 0,(function(){var t,r;return Document_generator(this,(function(n){switch(n.label){case 0:return validateDocument(this),t={dialogOptions:e===d.PROMPT_TO_SAVE_CHANGES?"display":"dontDisplay",modalBehavior:"execute"},r=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.close)(e!==d.DISCARD_CHANGES),Object(L.select)(L.ref.id(r._id))],t)];case 1:return n.sent(),[2]}}))}))},Document.prototype.closeWithoutSaving=function(){validateDocument(this);var e=K.activeDocument;batchPlaySync([Object(L.select)(L.ref.id(this._id)),Object(L.close)(!1),Object(L.select)(L.ref.id(e._id))],{dialogOptions:"dontDisplay",modalBehavior:"execute"})},Document.prototype.crop=function(e,t){return void 0===t&&(t=0),Document_awaiter(this,void 0,void 0,(function(){var r,n,i,o;return Document_generator(this,(function(a){switch(a.label){case 0:for(validateDocument(this),r=0,n=["left","right","bottom","top"];r<n.length;r++)if(i=n[r],!e.hasOwnProperty(i))throw Error("Rectangle does not contain key: "+i);return o=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.crop)(e,t),Object(L.select)(L.ref.id(o._id))])];case 1:return a.sent(),[2]}}))}))},Document.prototype.flatten=function(){return Document_awaiter(this,void 0,void 0,(function(){var e;return Document_generator(this,(function(t){switch(t.label){case 0:return validateDocument(this),e=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.flattenImage)(),Object(L.select)(L.ref.id(e._id))])];case 1:return t.sent(),[2]}}))}))},Document.prototype.mergeVisibleLayers=function(){return Document_awaiter(this,void 0,void 0,(function(){var e;return Document_generator(this,(function(t){switch(t.label){case 0:return validateDocument(this),e=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.mergeVisible)(),Object(L.select)(L.ref.id(e._id))])];case 1:return t.sent(),[2]}}))}))},Document.prototype.resizeCanvas=function(e,t,r){return Document_awaiter(this,void 0,void 0,(function(){var n,i,o,a;return Document_generator(this,(function(c){switch(c.label){case 0:return validateDocument(this),n="number"==typeof e?Pixel(e):e,i="number"==typeof t?Pixel(t):t,o=function(e){var h=function(e){return{_enum:"horizontalLocation",_value:e}},v=function(e){return{_enum:"verticalLocation",_value:e}};switch(e){case b.BOTTOMCENTER:return{horizontal:h("center"),vertical:v("bottom")};case b.BOTTOMLEFT:return{horizontal:h("left"),vertical:v("bottom")};case b.BOTTOMRIGHT:return{horizontal:h("right"),vertical:v("bottom")};case b.MIDDLECENTER:return{horizontal:h("center"),vertical:v("center")};case b.MIDDLELEFT:return{horizontal:h("left"),vertical:v("center")};case b.MIDDLERIGHT:return{horizontal:h("right"),vertical:v("center")};case b.TOPCENTER:return{horizontal:h("center"),vertical:v("top")};case b.TOPLEFT:return{horizontal:h("left"),vertical:v("top")};case b.TOPRIGHT:return{horizontal:h("right"),vertical:v("top")};default:return{horizontal:h("center"),vertical:v("center")}}},a=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.resizeCanvas)({width:n,height:i},o(r)),Object(L.select)(L.ref.id(a._id))])];case 1:return c.sent(),[2]}}))}))},Document.prototype.resizeImage=function(e,t,r,n){return Document_awaiter(this,void 0,void 0,(function(){var i,o,a,c,u;return Document_generator(this,(function(l){switch(l.label){case 0:return validateDocument(this),i="number"==typeof e?Pixel(e):e,o="number"==typeof t?Pixel(t):t,a=void 0!==n&&n in p?n:p.bicubicAutomatic,c={_enum:"interpolationType",_value:a},u=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.resizeImage)({width:i,height:o},c,r),Object(L.select)(L.ref.id(u._id))])];case 1:return l.sent(),[2]}}))}))},Document.prototype.rotate=function(e){return Document_awaiter(this,void 0,void 0,(function(){var t;return Document_generator(this,(function(r){switch(r.label){case 0:return validateDocument(this),t=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.rotate)(L.ref.active(),Angle(e)),Object(L.select)(L.ref.id(t._id))])];case 1:return r.sent(),[2]}}))}))},Document.prototype.save=function(e,t){return Document_awaiter(this,void 0,void 0,(function(){var r,n,i,o,c;return Document_generator(this,(function(u){switch(u.label){case 0:return validateDocument(this),void 0!==e?[3,2]:(c=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.saveDocumentDialog)(),Object(L.select)(L.ref.id(c._id))])]);case 1:return u.sent(),[3,4];case 2:if(r=a.storage.localFileSystem.createSessionToken(e),n=e.nativePath,i=(n.substr(n.lastIndexOf(".")+1)||n).toUpperCase(),void 0===t?t={_obj:"",format:i}:t.format||(t.format=i),o=void 0,function isPSDSaveOptions(e){return"PSD"===e.format}(t))o={_obj:"photoshop35Format"},void 0!==t.maximizeCompatibility&&(o.maximizeCompatibility=t.maximizeCompatibility);else if(function isJPEGSaveOptions(e){return"JPG"===e.format||"JPEG"===e.format}(t))o={_obj:"JPEG",extendedQuality:3,matteType:{_enum:"matteColor",_value:P.white}},void 0!==t.quality&&(o.extendedQuality=t.quality),void 0!==t.scans&&(o.scans=t.scans),void 0!==t.matteType&&(o.matteType={_enum:"matteColor",_value:t.matteType});else if(function isPNGSaveOptions(e){return"PNG"===e.format}(t))o={_obj:"PNGFormat"},void 0!==t.compression&&(o.compression=t.compression);else{if(!function isGIFSaveOptions(e){return"GIF"===e.format}(t))throw new Error("Unsupported format detected");o={_obj:"GIFFormat"}}return c=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(L.save)(this._id,{_kind:"local",_path:r},o),Object(L.select)(L.ref.id(c._id))])];case 3:u.sent(),u.label=4;case 4:return[2]}}))}))},Document.prototype.duplicateLayers=function(e,t){var r;return Document_awaiter(this,void 0,void 0,(function(){var n,i,o,a,c=this;return Document_generator(this,(function(u){switch(u.label){case 0:if(!Array.isArray(e))throw new Error("layers is not an array");return validateDocument(this),t&&validateDocument(t),e.forEach(validateLayer),n=void 0!==t?L.ref.id(t._id):void 0,i=e.map((function(e){return k.ref.id(e._id)})),o=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(k.duplicate)(i,n),Object(L.getProperties)(L.ref.active(),["targetLayersIDs"]),Object(L.select)(L.ref.id(o._id))])];case 1:return a=u.sent(),[2,(null===(r=a[2])||void 0===r?void 0:r.targetLayersIDs).map((function(e){return PSLayer(e._id,c._id)}))]}}))}))},Document.prototype.linkLayers=function(e){if(validateDocument(this),e.forEach(validateLayer),e.length<2)return[];var t=k.ref.id(e[0]._id),r=e.map((function(e){return e._id})).slice(1).map((function(e){return k.ref.id(e)})),n=K.activeDocument;return batchPlaySync([Object(L.select)(L.ref.id(this._id)),Object(k.link)(t,r),Object(L.select)(L.ref.id(n._id))]),e[0].linkedLayers},Document.prototype.createLayer=function(e){var t;return Document_awaiter(this,void 0,void 0,(function(){var r,n;return Document_generator(this,(function(i){switch(i.label){case 0:return validateDocument(this),r=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(k.makeLayer)(e),Object(L.select)(L.ref.id(r._id))])];case 1:return n=i.sent(),(null===(t=n[1])||void 0===t?void 0:t.layerID)?[2,PSLayer(n[1].layerID,this._id)]:[2,null]}}))}))},Document.prototype.createLayerGroup=function(e){var t;return Document_awaiter(this,void 0,void 0,(function(){var r,n,i;return Document_generator(this,(function(o){switch(o.label){case 0:return validateDocument(this),r=Object(k.select)([k.ref.selected()]),(null==e?void 0:e.fromLayers)&&(Array.isArray(e.fromLayers)?(e.fromLayers.forEach(validateLayer),r=Object(k.select)(e.fromLayers.map((function(e){return k.ref.id(e._id)})))):(validateLayer(e.fromLayers),r=Object(k.select)([k.ref.id(e.fromLayers._id)])),e.from=k.ref.selected(),delete e.fromLayers),n=K.activeDocument,[4,batchPlay([Object(L.select)(L.ref.id(this._id)),r,Object(k.makeGroup)(e),Object(L.select)(L.ref.id(n._id))])];case 1:return i=o.sent(),(null===(t=i[2])||void 0===t?void 0:t.layerSectionStart)?[2,PSLayer(i[2].layerSectionStart,this._id,I.group)]:[2,null]}}))}))},Document.prototype.groupLayers=function(e){var t;return Document_awaiter(this,void 0,void 0,(function(){var r,n,i;return Document_generator(this,(function(o){switch(o.label){case 0:return validateDocument(this),e.forEach(validateLayer),r=K.activeDocument,n=e.map((function(e){return k.ref.id(e._id)})),[4,batchPlay([Object(L.select)(L.ref.id(this._id)),Object(k.select)(n),Object(k.makeGroup)({from:k.ref.selected()}),Object(L.select)(L.ref.id(r._id))])];case 1:return i=o.sent(),(null===(t=i[2])||void 0===t?void 0:t.layerSectionStart)?[2,PSLayer(i[2].layerSectionStart,this._id,I.group)]:[2,null]}}))}))},Document}(),F=V,R=r(2),G=r(3),Actions_awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},Actions_generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(c){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};function validateActionSet(e){if(!validateReference(R.ref.id(e._id)))throw new Error("This action set does not exist.")}var N={};function PSActionSet(e){return N.hasOwnProperty(e)||(N[e]=new U(e)),N[e]}var z={};function PSAction(e){return z.hasOwnProperty(e)||(z[e]=new B(e)),z[e]}var U=function(){function ActionSet(e){this._id=e}return Object.defineProperty(ActionSet.prototype,"index",{get:function(){return validateActionSet(this),batchPlaySync(Object(R.getProperty)(["itemIndex"],R.ref.id(this._id)))[0].itemIndex-1},enumerable:!0,configurable:!0}),Object.defineProperty(ActionSet.prototype,"name",{get:function(){return validateActionSet(this),batchPlaySync(Object(R.getProperty)(["name"],R.ref.id(this._id)))[0].name},set:function(e){validateActionSet(this),batchPlaySync(Object(R.rename)(R.ref.id(this._id),e))},enumerable:!0,configurable:!0}),Object.defineProperty(ActionSet.prototype,"actions",{get:function(){return validateActionSet(this),batchPlaySync([Object(G.getPropertiesRange)(["ID"],R.ref.id(this._id))])[0].list.map((function(e){return PSAction(e.ID)}))},enumerable:!0,configurable:!0}),ActionSet.prototype.delete=function(){validateActionSet(this),batchPlaySync(Object(R.remove)(R.ref.id(this._id)))},ActionSet.prototype.duplicate=function(){validateActionSet(this),batchPlaySync(Object(R.duplicate)(R.ref.id(this._id)));var e=this.index+2;return PSActionSet(batchPlaySync(Object(R.getProperty)(["ID"],R.ref.index(e)))[0].ID)},ActionSet.prototype.play=function(){return Actions_awaiter(this,void 0,void 0,(function(){return Actions_generator(this,(function(e){switch(e.label){case 0:return validateActionSet(this),[4,batchPlay(Object(R.play)(R.ref.index(this._id)))];case 1:return e.sent(),[2]}}))}))},ActionSet}();function validateAction(e){if(!validateReference(G.ref.id(e._id)))throw new Error("This action does not exist.")}var B=function(){function Action(e){this._id=e}return Object.defineProperty(Action.prototype,"index",{get:function(){return validateAction(this),batchPlaySync(Object(G.getProperty)(["itemIndex"],G.ref.id(this._id)))[0].itemIndex-1},enumerable:!0,configurable:!0}),Object.defineProperty(Action.prototype,"name",{get:function(){return validateAction(this),batchPlaySync(Object(G.getProperty)(["name"],G.ref.id(this._id)))[0].name},set:function(e){validateAction(this),batchPlaySync(Object(G.rename)(G.ref.id(this._id),e))},enumerable:!0,configurable:!0}),Object.defineProperty(Action.prototype,"parent",{get:function(){validateAction(this);var e=batchPlaySync(Object(G.getProperty)(["parentIndex"],G.ref.id(this._id)))[0].parentIndex;return PSActionSet(batchPlaySync(Object(R.getProperty)(["ID"],R.ref.index(e)))[0].ID)},enumerable:!0,configurable:!0}),Action.prototype.delete=function(){validateAction(this),batchPlaySync(Object(G.remove)(G.ref.id(this._id)))},Action.prototype.play=function(){return Actions_awaiter(this,void 0,void 0,(function(){return Actions_generator(this,(function(e){switch(e.label){case 0:return validateAction(this),[4,batchPlay(Object(G.play)(G.ref.id(this._id)))];case 1:return e.sent(),[2]}}))}))},Action.prototype.duplicate=function(){return validateAction(this),batchPlaySync(Object(G.duplicate)(G.ref.id(this._id))),PSAction(batchPlaySync(Object(G.getProperty)(["ID"],G.ref.selected()))[0].ID)},Action}();var J,q=r(5),Q=r(4),Photoshop_assign=function(){return(Photoshop_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Photoshop_awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},Photoshop_generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(c){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},K=new(function(){function Photoshop(){this.Document=F,this.Layer=C,this.ActionSet=U,this.Action=B,this.Photoshop=Photoshop,this._apiVersion=q.version,this._eventHandler=null}return Object.defineProperty(Photoshop.prototype,"validation",{set:function(e){!function setValidation(e){g=e}(e)},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"activeDocument",{get:function(){var e=batchPlaySync(Object(L.getProperties)(L.ref.active(),["documentID"]))[0].documentID;return void 0===e?null:PSDocument(e)},set:function(e){validateDocument(e),batchPlaySync(Object(L.select)(L.ref.id(e._id)))},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"currentTool",{get:function(){return{id:batchPlaySync(Object(Q.getProperties)(["tool"]))[0].tool._enum}},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"actionTree",{get:function(){var e=batchPlaySync(Object(Q.getProperties)(["numberOfActionSets"]))[0].numberOfActionSets;return batchPlaySync(Array.apply(null,Array(e)).map((function(e,t){return t+1})).map((function(e){return Object(R.getProperty)(["ID"],R.ref.index(e))}))).map((function(e){return PSActionSet(e.ID)}))},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"documents",{get:function(){return batchPlaySync(Object(L.getPropertiesRange)(["documentID"]))[0].list.map((function(e){return PSDocument(e.documentID)}))},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"foregroundColor",{get:function(){return batchPlaySync(Object(Q.getProperties)(["foregroundColor"]))[0].foregroundColor},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"backgroundColor",{get:function(){return batchPlaySync(Object(Q.getProperties)(["backgroundColor"]))[0].backgroundColor},enumerable:!0,configurable:!0}),Object.defineProperty(Photoshop.prototype,"eventNotifier",{set:function(e){J&&function removeNotificationListener(e,t){i.removeNotificationListener(e,t)}([{event:"$All "}],J),(J=e)&&function addNotificationListener(e,t){i.addNotificationListener(e,t)}([{event:"$All "}],J)},enumerable:!0,configurable:!0}),Photoshop.prototype.showAlert=function(e){return Photoshop_awaiter(this,void 0,void 0,(function(){return Photoshop_generator(this,(function(t){return[2,o.showAlert({message:e})]}))}))},Photoshop.prototype.batchPlay=function(e,t){return Photoshop_awaiter(this,void 0,void 0,(function(){return Photoshop_generator(this,(function(r){return t?t.skipAnalytics=!1:t={skipAnalytics:!1},[2,i.batchPlay(e,t)]}))}))},Photoshop.prototype.bringToFront=function(){batchPlaySync([{_obj:"bringToFront"}])},Photoshop.prototype.open=function(e){return Photoshop_awaiter(this,void 0,void 0,(function(){var t;return Photoshop_generator(this,(function(r){switch(r.label){case 0:return t=e?a.storage.localFileSystem.createSessionToken(e):void 0,[4,batchPlay(Object(L.open)(t))];case 1:return[2,PSDocument(r.sent()[0].documentID)]}}))}))},Photoshop.prototype.createDocument=function(e){var t;return Photoshop_awaiter(this,void 0,void 0,(function(){var r,n;return Photoshop_generator(this,(function(i){switch(i.label){case 0:if(r={},void 0===e||e==={})r={mode:"RGBColorMode",width:504,height:360,resolution:300,fill:"white"};else{if(void 0===e.preset&&(void 0===e.mode||void 0===e.width||void 0===e.height||void 0===e.resolution||void 0===e.fill))throw new Error("Missing required param to create document.");r=Photoshop_assign(Photoshop_assign({},e),{width:e.width*(72/e.resolution),height:e.height*(72/e.resolution)})}return[4,batchPlay(Object(Q.makeDocument)(r))];case 1:return n=i.sent(),[2,(null===(t=null==n?void 0:n[0])||void 0===t?void 0:t.documentID)?PSDocument(n[0].documentID):null]}}))}))},Photoshop}());t.default={app:K,core:o,action:i}}]).default.app)