generated from theripper93/FoundryVTT-Module-Template
-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
3 lines (3 loc) · 66.2 KB
/
index.js
1
2
3
/*! For license information please see index.js.LICENSE.txt */
(()=>{"use strict";var t={d:(r,a)=>{for(var i in a)t.o(a,i)&&!t.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){u=!0,l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,r,a){t[r]=a.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,o){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(o||[]);return i(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var d={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,l,(function(){return this}));var h=Object.getPrototypeOf,m=h&&h(h(values([])));m&&m!==r&&a.call(m,l)&&(p=m);var y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(i,o,l,c){var u=tryCatch(t[i],t,o);if("throw"!==u.type){var d=u.arg,p=d.value;return p&&"object"==_typeof(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(p).then((function(t){d.value=t,l(d)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function value(t,a){function callInvokeWithMethodAndArg(){return new r((function(r,i){invoke(t,a,r,i)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(t,r,a){var i="suspendedStart";return function(o,l){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===o)throw l;return doneResult()}for(a.method=o,a.arg=l;;){var c=a.delegate;if(c){var u=maybeInvokeDelegate(c,a);if(u){if(u===d)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===i)throw i="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);i="executing";var p=tryCatch(t,r,a);if("normal"===p.type){if(i=a.done?"completed":"suspendedYield",p.arg===d)continue;return{value:p.arg,done:a.done}}"throw"===p.type&&(i="completed",a.method="throw",a.arg=p.arg)}}}function maybeInvokeDelegate(t,r){var a=r.method,i=t.iterator[a];if(void 0===i)return r.delegate=null,"throw"===a&&t.iterator.return&&(r.method="return",r.arg=void 0,maybeInvokeDelegate(t,r),"throw"===r.method)||"return"!==a&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),d;var o=tryCatch(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var l=o.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,d):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function next(){for(;++i<t.length;)if(a.call(t,i))return next.value=t[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,i(y,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),i(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),t.AsyncIterator=AsyncIterator,t.async=function(r,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(r,a,i,o),l);return t.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(y),define(y,u,"Generator"),define(y,l,(function(){return this})),define(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var r=this;function handle(a,i){return l.type="throw",l.arg=t,r.next=a,i&&(r.method="next",r.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,d):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),d},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,a){return this.delegate={iterator:values(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){return void a(t)}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(o=i.key,l=void 0,l=function _toPrimitive(t,r){if("object"!==_typeof(t)||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(o,"string"),"symbol"===_typeof(l)?l:String(l)),i)}var o,l}function _createClass(t,r,a){return r&&_defineProperties(t.prototype,r),a&&_defineProperties(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}},_get.apply(this,arguments)}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){return t.__proto__=r,t},_setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,a)}}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}t.d({},{c:()=>a});var r={};function initConfig(){Hooks.on("argonInit",(function(t){var i;if("dnd5e"===game.system.id){!function registerItems(){r[game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name"),type:"feat",img:"modules/enhancedcombathud/icons/journey.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"turn"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"}},sort:0,flags:{core:{sourceId:"Item.wyQkeuZkttllAFB1"},"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name"),type:"feat",img:"modules/enhancedcombathud/icons/armor-upgrade.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"round"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name"),type:"feat",img:"modules/enhancedcombathud/icons/clockwork.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name"),type:"feat",img:"modules/enhancedcombathud/icons/cloak-dagger.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},recharge:{value:null,charged:!1},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name"),type:"feat",img:"modules/enhancedcombathud/icons/walking-boot.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name"),type:"feat",img:"modules/enhancedcombathud/icons/shield-bash.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:1,width:null,units:"",type:"creature"},range:{value:null,long:null,units:"touch"},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}}}();var o=t.ARGON,l=function(t){_inherits(DND5eTooltip,t);var r=_createSuper(DND5eTooltip);function DND5eTooltip(){return _classCallCheck(this,DND5eTooltip),r.apply(this,arguments)}return _createClass(DND5eTooltip,[{key:"classes",get:function get(){return _get(_getPrototypeOf(DND5eTooltip.prototype),"classes",this).concat(["dnd5e2"])}}]),DND5eTooltip}(o.CORE.Tooltip),c=null===(i=game.modules.get("midi-qol"))||void 0===i?void 0:i.active,u=function getMidiFlag(t){var r,a;return c&&ui.ARGON._actor?null!==(a=(null!==(r=ui.ARGON._actor.getFlag("midi-qol","actions"))&&void 0!==r?r:{})[t])&&void 0!==a&&a?0:1:null},d=function getActivationType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a||null===(a=a.activation)||void 0===a?void 0:a.type},p=function getActionType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a?void 0:a.actionType},h={action:["action"],bonus:["bonus"],reaction:["reaction","reactiondamage","reactionmanual"],free:["special"]},m={spell:["spell"],feat:["feat"],consumable:["consumable","equipment","loot"]},y=[];game.settings.get(a,"showWeaponsItems")&&m.consumable.push("weapon"),game.settings.get(a,"showClassActions")&&y.push("class"),t.DND5E={actionTypes:h,itemTypes:m,mainBarFeatures:y,ECHItems:r},Hooks.callAll("enhanced-combat-hud.dnd5e.initConfig",{actionTypes:h,itemTypes:m,ECHItems:r});var v=function(t){_inherits(DND5ePortraitPanel,t);var r,a,i=_createSuper(DND5ePortraitPanel);function DND5ePortraitPanel(){_classCallCheck(this,DND5ePortraitPanel);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return i.call.apply(i,[this].concat(r))}return _createClass(DND5ePortraitPanel,[{key:"description",get:function get(){var t=this.actor,r=t.type,a=t.system,i=this.actor,o="character"===r;if("npc"===r){var l,c,u=game.i18n.localize(null!==(l=null===(c=CONFIG.DND5E.creatureTypes[i.system.details.type.value])||void 0===c?void 0:c.label)&&void 0!==l?l:i.system.details.type.custom),d=a.details.cr>=1||a.details.cr<=0?a.details.cr:"1/".concat(1/a.details.cr);return"CR ".concat(d," ").concat(u)}if(o){var p=Object.values(i.classes).map((function(t){return t.name})).join(" / ");return"Level ".concat(a.details.level," ").concat(p," (").concat(a.details.race,")")}return""}},{key:"isDead",get:function get(){return this.isDying&&"character"!==this.actor.type}},{key:"isDying",get:function get(){return this.actor.system.attributes.hp.value<=0}},{key:"successes",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.success)&&void 0!==t?t:0}},{key:"failures",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.failure)&&void 0!==t?t:0}},{key:"configurationTemplate",get:function get(){return"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs"}},{key:"_onDeathSave",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){return _regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:this.actor.rollDeathSave({});case 1:case"end":return t.stop()}}),_callee,this)}))),function _onDeathSave(t){return a.apply(this,arguments)})},{key:"getStatBlocks",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return a=game.i18n.localize("DND5E.HitPoints").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),i=game.i18n.localize("DND5E.ArmorClass").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),o=game.i18n.localize("DND5E.SaveDC").replace("{ability}","").replace("{dc}","").trim(),l=this.actor.system.attributes.hp.temp?"#6698f3":"rgb(0 255 170)",c=this.actor.system.attributes.hp.tempmax,u=c?c>0?"rgb(222 91 255)":"#ffb000":"rgb(255 255 255)",d.abrupt("return",[[{text:"".concat(this.actor.system.attributes.hp.value+(null!==(t=this.actor.system.attributes.hp.temp)&&void 0!==t?t:0)),color:l},{text:"/"},{text:"".concat(this.actor.system.attributes.hp.max+(null!==(r=this.actor.system.attributes.hp.tempmax)&&void 0!==r?r:0)),color:u},{text:a}],[{text:i},{text:this.actor.system.attributes.ac.value,color:"var(--ech-movement-baseMovement-background)"}],[{text:o},{text:this.actor.system.attributes.spelldc,color:"var(--ech-movement-baseMovement-background)"}]]);case 7:case"end":return d.stop()}}),_callee2,this)}))),function getStatBlocks(){return r.apply(this,arguments)})}]),DND5ePortraitPanel}(o.PORTRAIT.PortraitPanel),g=function(t){_inherits(DND5eDrawerButton,t);var r,a=_createSuper(DND5eDrawerButton);function DND5eDrawerButton(t,r,i){var o;return _classCallCheck(this,DND5eDrawerButton),(o=a.call(this,t)).item=r,o.type=i,o}return _createClass(DND5eDrawerButton,[{key:"hasTooltip",get:function get(){return!0}},{key:"tooltipOrientation",get:function get(){return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT}},{key:"getTooltipData",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var t;return _regeneratorRuntime().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item,this.type);case 2:return t=r.sent,r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee3,this)}))),function getTooltipData(){return r.apply(this,arguments)})}]),DND5eDrawerButton}(o.DRAWER.DrawerButton),b=function(t){_inherits(DND5eDrawerPanel,t);var r=_createSuper(DND5eDrawerPanel);function DND5eDrawerPanel(){_classCallCheck(this,DND5eDrawerPanel);for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];return r.call.apply(r,[this].concat(a))}return _createClass(DND5eDrawerPanel,[{key:"categories",get:function get(){var t=this,r=this.actor.system.abilities,a=this.actor.system.skills,i=this.actor.itemTypes.tool,o=function addSign(t){return t>=0?"+".concat(t):t};return[{gridCols:"5fr 2fr 2fr",captions:[{label:"Abilities",align:"left"},{label:"Check",align:"center"},{label:"Save",align:"center"}],align:["left","center","center"],buttons:Object.keys(r).map((function(a){var i=r[a];return new g([{label:CONFIG.DND5E.abilities[a].label,onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.mod+(i.checkBonus||0)),onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.save),onClick:function onClick(r){return t.actor.rollSavingThrow({ability:a,event:r})}}],a,"save")}))},{gridCols:"7fr 2fr",captions:[{label:"Skills"},{label:""}],buttons:Object.keys(a).map((function(r){var i=a[r];return new g([{label:getProficiencyIcon(i.proficient)+CONFIG.DND5E.skills[r].label,onClick:function onClick(a){return t.actor.rollSkill({skill:r,event:a})}},{label:"".concat(o(i.total),'<span style="margin: 0 1rem; filter: brightness(0.8)">(').concat(i.passive,")</span>"),style:"display: flex; justify-content: flex-end;"}],r,"skill")}))},{gridCols:"7fr 2fr",captions:[{label:"Tools"},{label:""}],buttons:i.map((function(a){return new g([{label:getProficiencyIcon(a.system.proficient)+a.name,onClick:function onClick(t){return a.rollToolCheck({event:t})}},{label:o(r[a.abilityMod].mod+a.system.proficiencyMultiplier*t.actor.system.attributes.prof)}],a)}))}]}},{key:"title",get:function get(){return"".concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.saves.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.skills.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.tools.name"))}}]),DND5eDrawerPanel}(o.DRAWER.DrawerPanel),_=function(i){_inherits(DND5eActionActionPanel,i);var l,c=_createSuper(DND5eActionActionPanel);function DND5eActionActionPanel(){_classCallCheck(this,DND5eActionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return c.call.apply(c,[this].concat(r))}return _createClass(DND5eActionActionPanel,[{key:"label",get:function get(){return"DND5E.Action"}},{key:"maxActions",get:function get(){var t;return null!==(t=this.actor)&&void 0!==t&&t.inCombat?1:null}},{key:"currentActions",get:function get(){var t;return null!==(t=u("action"))&&void 0!==t?t:this.isActionUsed?0:1}},{key:"_onNewRound",value:function _onNewRound(t){this.isActionUsed=!1,this.updateActionUse()}},{key:"_getButtons",value:(l=_asyncToGenerator(_regeneratorRuntime().mark((function _callee4(){var i,l,c,u,p,y,v,g;return _regeneratorRuntime().wrap((function _callee4$(b){for(;;)switch(b.prev=b.next){case 0:return i=this.actor.items.filter((function(r){var a;return m.spell.includes(r.type)&&h.action.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)})),l=this.actor.items.filter((function(r){var a;return m.feat.includes(r.type)&&h.action.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)})),c=this.actor.items.filter((function(r){var a;return m.consumable.includes(r.type)&&h.action.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)})),u=i.length?[new T({type:"spell",items:i,color:0})].filter((function(t){return t.hasContents})):[],p=Object.values(r),y=game.settings.get(a,"showSpecialActions"),v=[],y?v.push.apply(v,[new C({item:null,isWeaponSet:!0,isPrimary:!0}),new o.MAIN.BUTTONS.SplitButton(new x(p[0]),new x(p[1]))].concat(_toConsumableArray(u),[new T({type:"feat",items:l,color:0}),new o.MAIN.BUTTONS.SplitButton(new x(p[2]),new x(p[3])),new o.MAIN.BUTTONS.SplitButton(new x(p[4]),new x(p[5])),new T({type:"consumable",items:c,color:0})])):v.push.apply(v,[new C({item:null,isWeaponSet:!0,isPrimary:!0})].concat(_toConsumableArray(u),[new T({type:"feat",items:l,color:0}),new T({type:"consumable",items:c,color:0})])),g=this.actor.items.filter((function(r){var a;return t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)&&h.action.includes(d(r))})),v.push.apply(v,_toConsumableArray(condenseItemButtons(g))),b.abrupt("return",v.filter((function(t){return t.hasContents||null==t.items||t.items.length})));case 11:case"end":return b.stop()}}),_callee4,this)}))),function _getButtons(){return l.apply(this,arguments)})}]),DND5eActionActionPanel}(o.MAIN.ActionPanel),D=function(r){_inherits(DND5eBonusActionPanel,r);var a,i=_createSuper(DND5eBonusActionPanel);function DND5eBonusActionPanel(){_classCallCheck(this,DND5eBonusActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return i.call.apply(i,[this].concat(r))}return _createClass(DND5eBonusActionPanel,[{key:"label",get:function get(){return"DND5E.BonusAction"}},{key:"maxActions",get:function get(){var t;return null!==(t=this.actor)&&void 0!==t&&t.inCombat?1:null}},{key:"currentActions",get:function get(){var t;return null!==(t=u("bonus"))&&void 0!==t?t:this.isActionUsed?0:1}},{key:"_onNewRound",value:function _onNewRound(t){this.isActionUsed=!1,this.updateActionUse()}},{key:"_getButtons",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee5(){var r,a,i,o,l,c=this;return _regeneratorRuntime().wrap((function _callee5$(u){for(;;)switch(u.prev=u.next){case 0:r=[new C({item:null,isWeaponSet:!0,isPrimary:!1})],a=_regeneratorRuntime().mark((function _loop(){var a,l,u,p,m;return _regeneratorRuntime().wrap((function _loop$(y){for(;;)switch(y.prev=y.next){case 0:if(a=_slicedToArray(o[i],2),l=a[0],u=a[1],(p=c.actor.items.filter((function(r){var a;return u.includes(r.type)&&h.bonus.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)}))).length){y.next=4;break}return y.abrupt("return","continue");case 4:(m=new T({type:l,items:p,color:1})).hasContents&&r.push(m);case 6:case"end":return y.stop()}}),_loop)})),i=0,o=Object.entries(m);case 3:if(!(i<o.length)){u.next=11;break}return u.delegateYield(a(),"t0",5);case 5:if("continue"!==u.t0){u.next=8;break}return u.abrupt("continue",8);case 8:i++,u.next=3;break;case 11:return l=this.actor.items.filter((function(r){var a;return t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)&&h.bonus.includes(d(r))})),r.push.apply(r,_toConsumableArray(condenseItemButtons(l))),u.abrupt("return",r);case 14:case"end":return u.stop()}}),_callee5,this)}))),function _getButtons(){return a.apply(this,arguments)})}]),DND5eBonusActionPanel}(o.MAIN.ActionPanel),w=function(r){_inherits(DND5eReactionActionPanel,r);var a,i=_createSuper(DND5eReactionActionPanel);function DND5eReactionActionPanel(){_classCallCheck(this,DND5eReactionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return i.call.apply(i,[this].concat(r))}return _createClass(DND5eReactionActionPanel,[{key:"label",get:function get(){return"DND5E.Reaction"}},{key:"maxActions",get:function get(){var t;return null!==(t=this.actor)&&void 0!==t&&t.inCombat?1:null}},{key:"currentActions",get:function get(){var t;return null!==(t=u("reaction"))&&void 0!==t?t:this.isActionUsed?0:1}},{key:"_onNewRound",value:function _onNewRound(t){this.isActionUsed=!1,this.updateActionUse()}},{key:"_getButtons",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee6(){var r,a,i,o,l,c=this;return _regeneratorRuntime().wrap((function _callee6$(u){for(;;)switch(u.prev=u.next){case 0:r=[new C({item:null,isWeaponSet:!0,isPrimary:!0})],a=_regeneratorRuntime().mark((function _loop2(){var a,l,u,p,m;return _regeneratorRuntime().wrap((function _loop2$(y){for(;;)switch(y.prev=y.next){case 0:if(a=_slicedToArray(o[i],2),l=a[0],u=a[1],(p=c.actor.items.filter((function(r){var a;return u.includes(r.type)&&h.reaction.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)}))).length){y.next=4;break}return y.abrupt("return","continue");case 4:(m=new T({type:l,items:p,color:3})).hasContents&&r.push(m);case 6:case"end":return y.stop()}}),_loop2)})),i=0,o=Object.entries(m);case 3:if(!(i<o.length)){u.next=11;break}return u.delegateYield(a(),"t0",5);case 5:if("continue"!==u.t0){u.next=8;break}return u.abrupt("continue",8);case 8:i++,u.next=3;break;case 11:return l=this.actor.items.filter((function(r){var a;return t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)&&h.reaction.includes(d(r))})),r.push.apply(r,_toConsumableArray(condenseItemButtons(l))),u.abrupt("return",r);case 14:case"end":return u.stop()}}),_callee6,this)}))),function _getButtons(){return a.apply(this,arguments)})}]),DND5eReactionActionPanel}(o.MAIN.ActionPanel),A=function(r){_inherits(DND5eFreeActionPanel,r);var a,i=_createSuper(DND5eFreeActionPanel);function DND5eFreeActionPanel(){_classCallCheck(this,DND5eFreeActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return i.call.apply(i,[this].concat(r))}return _createClass(DND5eFreeActionPanel,[{key:"label",get:function get(){return"DND5E.Special"}},{key:"maxActions",get:function get(){var t;return null!==(t=this.actor)&&void 0!==t&&t.inCombat?1:null}},{key:"currentActions",get:function get(){return this.isActionUsed?0:1}},{key:"_onNewRound",value:function _onNewRound(t){this.isActionUsed=!1,this.updateActionUse()}},{key:"_getButtons",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee7(){var r,a,i,o,l,c=this;return _regeneratorRuntime().wrap((function _callee7$(u){for(;;)switch(u.prev=u.next){case 0:r=[],a=_regeneratorRuntime().mark((function _loop3(){var a,l,u,p,m;return _regeneratorRuntime().wrap((function _loop3$(y){for(;;)switch(y.prev=y.next){case 0:if(a=_slicedToArray(o[i],2),l=a[0],u=a[1],(p=c.actor.items.filter((function(r){var a;return u.includes(r.type)&&h.free.includes(d(r))&&!t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)}))).length){y.next=4;break}return y.abrupt("return","continue");case 4:(m=new T({type:l,items:p,color:2})).hasContents&&r.push(m);case 6:case"end":return y.stop()}}),_loop3)})),i=0,o=Object.entries(m);case 3:if(!(i<o.length)){u.next=11;break}return u.delegateYield(a(),"t0",5);case 5:if("continue"!==u.t0){u.next=8;break}return u.abrupt("continue",8);case 8:i++,u.next=3;break;case 11:return l=this.actor.items.filter((function(r){var a;return t.DND5E.mainBarFeatures.includes(null===(a=r.system.type)||void 0===a?void 0:a.value)&&h.free.includes(d(r))})),r.push.apply(r,_toConsumableArray(condenseItemButtons(l))),u.abrupt("return",r);case 14:case"end":return u.stop()}}),_callee7,this)}))),function _getButtons(){return a.apply(this,arguments)})}]),DND5eFreeActionPanel}(o.MAIN.ActionPanel),k=function(t){_inherits(DND5eLegActionPanel,t);var r,a=_createSuper(DND5eLegActionPanel);function DND5eLegActionPanel(){_classCallCheck(this,DND5eLegActionPanel);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return a.call.apply(a,[this].concat(r))}return _createClass(DND5eLegActionPanel,[{key:"label",get:function get(){return"DND5E.LegendaryActionLabel"}},{key:"maxActions",get:function get(){var t,r,a;return null!==(t=this.actor)&&void 0!==t&&t.inCombat&&null!==(r=null===(a=this.actor.system.resources)||void 0===a||null===(a=a.legact)||void 0===a?void 0:a.max)&&void 0!==r?r:null}},{key:"currentActions",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.resources)||void 0===r||null===(r=r.legact)||void 0===r?void 0:r.value)&&void 0!==t?t:null}},{key:"_getButtons",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee8(){var t;return _regeneratorRuntime().wrap((function _callee8$(r){for(;;)switch(r.prev=r.next){case 0:return t=[],this.actor.items.filter((function(t){return"legendary"===d(t)})).forEach((function(r){t.push(new C({item:r,inActionPanel:!0}))})),r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee8,this)}))),function _getButtons(){return r.apply(this,arguments)})}]),DND5eLegActionPanel}(o.MAIN.ActionPanel),N=function(t){_inherits(DND5eLairActionPanel,t);var r,a=_createSuper(DND5eLairActionPanel);function DND5eLairActionPanel(){_classCallCheck(this,DND5eLairActionPanel);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return a.call.apply(a,[this].concat(r))}return _createClass(DND5eLairActionPanel,[{key:"label",get:function get(){return"DND5E.LairActionLabel"}},{key:"maxActions",get:function get(){var t;return null!==(t=this.actor)&&void 0!==t&&t.inCombat?1:null}},{key:"currentActions",get:function get(){var t;return 1*(null===(t=this.actor.system.resources.lair)||void 0===t?void 0:t.value)}},{key:"_getButtons",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee9(){var t;return _regeneratorRuntime().wrap((function _callee9$(r){for(;;)switch(r.prev=r.next){case 0:return t=[],this.actor.items.filter((function(t){return"lair"===d(t)})).forEach((function(r){t.push(new C({item:r,inActionPanel:!0}))})),r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee9,this)}))),function _getButtons(){return r.apply(this,arguments)})}]),DND5eLairActionPanel}(o.MAIN.ActionPanel),P=function(t){_inherits(DND5eMythicActionPanel,t);var r,a=_createSuper(DND5eMythicActionPanel);function DND5eMythicActionPanel(){_classCallCheck(this,DND5eMythicActionPanel);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return a.call.apply(a,[this].concat(r))}return _createClass(DND5eMythicActionPanel,[{key:"label",get:function get(){return"DND5E.MythicActionLabel"}},{key:"maxActions",get:function get(){return null}},{key:"currentActions",get:function get(){return null}},{key:"_getButtons",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee10(){var t;return _regeneratorRuntime().wrap((function _callee10$(r){for(;;)switch(r.prev=r.next){case 0:return t=[],this.actor.items.filter((function(t){return"mythic"===d(t)})).forEach((function(r){t.push(new C({item:r,inActionPanel:!0}))})),r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee10,this)}))),function _getButtons(){return r.apply(this,arguments)})}]),DND5eMythicActionPanel}(o.MAIN.ActionPanel),C=function(t){_inherits(DND5eItemButton,t);var r,a,i,o,l=_createSuper(DND5eItemButton);function DND5eItemButton(){_classCallCheck(this,DND5eItemButton);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return l.call.apply(l,[this].concat(r))}return _createClass(DND5eItemButton,[{key:"activity",get:function get(){var t;if(null!==(t=this.item)&&void 0!==t&&null!==(t=t.system)&&void 0!==t&&t.activities)return Array.from(this.item.system.activities)[0]}},{key:"hasTooltip",get:function get(){return!0}},{key:"ranges",get:function get(){var t,r,a,i,o,l=this.activity,c="touch"==l.range.units?null===(t=canvas)||void 0===t||null===(t=t.scene)||void 0===t||null===(t=t.grid)||void 0===t?void 0:t.distance:null;return{normal:null!==(r=null==l||null===(a=l.range)||void 0===a?void 0:a.value)&&void 0!==r?r:c,long:null!==(i=null==l||null===(o=l.range)||void 0===o?void 0:o.long)&&void 0!==i?i:null}}},{key:"targets",get:function get(){var t,r,a,i,o=this.activity,l=o.actionType,c=null!==(t=null===(r=o.target)||void 0===r?void 0:r.affects)&&void 0!==t?t:{},u=c.type;return null!==(a=o.target)&&void 0!==a&&null!==(a=a.template)&&void 0!==a&&a.units||!["creature","ally","enemy"].includes(u)?"mwak"===l||"rwak"===l?c.count||1:null:null!==(i=c.count)&&void 0!==i?i:1}},{key:"visible",get:function get(){var t,r;if(!this._isWeaponSet)return _get(_getPrototypeOf(DND5eItemButton.prototype),"visible",this);var a=this.parent instanceof w,i="mwak"===(null===(t=this.activity)||void 0===t?void 0:t.actionType);return!(a&&!i)&&((this._isPrimary||"shield"!==(null===(r=this.activity)||void 0===r||null===(r=r.type)||void 0===r?void 0:r.value))&&_get(_getPrototypeOf(DND5eItemButton.prototype),"visible",this))}},{key:"getTooltipData",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function _callee11(){var t;return _regeneratorRuntime().wrap((function _callee11$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item);case 2:return(t=r.sent).propertiesLabel="enhancedcombathud-dnd5e.tooltip.properties.name",r.abrupt("return",t);case 5:case"end":return r.stop()}}),_callee11,this)}))),function getTooltipData(){return o.apply(this,arguments)})},{key:"_onLeftClick",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function _callee12(t){return _regeneratorRuntime().wrap((function _callee12$(r){for(;;)switch(r.prev=r.next){case 0:return ui.ARGON.interceptNextDialog(t.currentTarget),r.next=3,this.item.use({event:t,legacy:!1},{event:t});case 3:r.sent&&DND5eItemButton.consumeActionEconomy(this.activity);case 5:case"end":return r.stop()}}),_callee12,this)}))),function _onLeftClick(t){return i.apply(this,arguments)})},{key:"_onRightClick",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee13(t){var r;return _regeneratorRuntime().wrap((function _callee13$(t){for(;;)switch(t.prev=t.next){case 0:null===(r=this.activity)||void 0===r||null===(r=r.sheet)||void 0===r||r.render(!0);case 1:case"end":return t.stop()}}),_callee13,this)}))),function _onRightClick(t){return a.apply(this,arguments)})},{key:"render",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee14(){var t,r,a,i,o,l=this,c=arguments;return _regeneratorRuntime().wrap((function _callee14$(u){for(;;)switch(u.prev=u.next){case 0:for(r=c.length,a=new Array(r),i=0;i<r;i++)a[i]=c[i];return u.next=3,(t=_get(_getPrototypeOf(DND5eItemButton.prototype),"render",this)).call.apply(t,[this].concat(a));case 3:this.activity&&(o=this.actor.items.filter((function(t){var r;return(null===(r=t.consume)||void 0===r?void 0:r.target)===l.activity.id})),ui.ARGON.updateItemButtons(o));case 4:case"end":return u.stop()}}),_callee14,this)}))),function render(){return r.apply(this,arguments)})},{key:"quantity",get:function get(){var t;if(!this.activity)return null;var r,a,i=null===(t=this.activity.consume)||void 0===t?void 0:t.type;if("ammo"===i){var o,l=this.actor.items.get(this.activity.consume.target);return l?Math.floor((null!==(o=l.quantity)&&void 0!==o?o:0)/this.activity.consume.amount):null}if("attribute"===i)return Math.floor(getProperty(this.actor,this.activity.consume.target)/this.activity.consume.amount);if("charges"===i){var c,u,d=this.actor.items.get(this.activity.consume.target);return d?Math.floor((null!==(c=null===(u=d.uses)||void 0===u?void 0:u.value)&&void 0!==c?c:0)/this.activity.consume.amount):null}return["consumable"].includes(this.activity.type)?null!==(r=null===(a=this.activity.uses)||void 0===a?void 0:a.value)&&void 0!==r?r:this.activity.quantity:null!==this.activity.uses.value&&null!==this.activity.uses.per&&this.activity.uses.max?this.activity.uses.value:null}}],[{key:"consumeActionEconomy",value:function consumeActionEconomy(t){for(var r,a=d(t),i=null,o=0,l=Object.entries(h);o<l.length;o++){var c=_slicedToArray(l[o],2),u=c[0];c[1].includes(a)&&(i=u)}i&&((null===(r=game.combat)||void 0===r||null===(r=r.combatant)||void 0===r?void 0:r.actor)!==t.parent&&(i="reaction"),"action"===i?(ui.ARGON.components.main[0].isActionUsed=!0,ui.ARGON.components.main[0].updateActionUse()):"bonus"===i?(ui.ARGON.components.main[1].isActionUsed=!0,ui.ARGON.components.main[1].updateActionUse()):"reaction"===i?(ui.ARGON.components.main[2].isActionUsed=!0,ui.ARGON.components.main[2].updateActionUse()):"free"===i?(ui.ARGON.components.main[3].isActionUsed=!0,ui.ARGON.components.main[3].updateActionUse()):"legendary"===i&&(ui.ARGON.components.main[4].isActionUsed=!0))}}]),DND5eItemButton}(o.MAIN.BUTTONS.ItemButton),T=function(t){_inherits(DND5eButtonPanelButton,t);var r,i=_createSuper(DND5eButtonPanelButton);function DND5eButtonPanelButton(t){var r,a=t.type,o=t.items,l=t.color;return _classCallCheck(this,DND5eButtonPanelButton),(r=i.call(this)).type=a,r.items=o,r.color=l,r.itemsWithSpells=[],r._spells=r.prePrepareSpells(),r}return _createClass(DND5eButtonPanelButton,[{key:"hasContents",get:function get(){return this._spells?!!this._spells.length||!!this.itemsWithSpells.length:!!this.items.length}},{key:"colorScheme",get:function get(){return this.color}},{key:"id",get:function get(){return"".concat(this.type,"-").concat(this.color)}},{key:"label",get:function get(){switch(this.type){case"spell":return"enhancedcombathud-dnd5e.hud.castspell.name";case"feat":return"enhancedcombathud-dnd5e.hud.usepower.name";case"consumable":return"enhancedcombathud-dnd5e.hud.useitem.name"}}},{key:"icon",get:function get(){switch(this.type){case"spell":return"modules/enhancedcombathud/icons/spell-book.webp";case"feat":return"modules/enhancedcombathud/icons/mighty-force.webp";case"consumable":return"modules/enhancedcombathud/icons/drink-me.webp"}}},{key:"showPreparedOnly",get:function get(){if("character"!==this.actor.type)return!1;var t=this.actor.getFlag(a,"showPrepared");if("all"===t)return!1;if("preparedOnly"===t)return!0;var r=Object.keys(this.actor.classes);return["cleric","druid","paladin","wizard","artificer"].some((function(t){return r.includes(t)}))}},{key:"prePrepareSpells",value:function prePrepareSpells(){var t,r=this;if("spell"===this.type){var a=CONFIG.DND5E.spellLevels,i=[];if(null!==(t=game.modules.get("items-with-spells-5e"))&&void 0!==t&&t.active){var o,l,c=game.modules.get("items-with-spells-5e").api,u=null===(o=this.items[0].system.activation)||void 0===o?void 0:o.type,p=_createForOfIteratorHelper(this.actor.items.filter((function(t){var r;return null===(r=t.flags["items-with-spells-5e"])||void 0===r||null===(r=r["item-spells"])||void 0===r?void 0:r.length})));try{var h=function _loop4(){var t=l.value,a=t.flags["items-with-spells-5e"]["item-spells"].map((function(t){return r.actor.items.get(t.id)})).filter((function(t){return t&&d(t)===u}));return a.length?(i.push.apply(i,_toConsumableArray(a)),c.isUsableItem(t)?void r.itemsWithSpells.push({label:t.name,buttons:a.map((function(t){return new C({item:t})})),uses:function uses(){var r,a;return{max:null===(r=t.system.uses)||void 0===r?void 0:r.max,value:null===(a=t.system.uses)||void 0===a?void 0:a.value}}}):"continue"):"continue"};for(p.s();!(l=p.n()).done;)h()}catch(t){p.e(t)}finally{p.f()}this.items=this.items.filter((function(t){return!i.includes(t)}))}if(this.showPreparedOnly){var m=["atwill","innate","pact","always"];this.items=this.items.filter((function(t){return!!m.includes(t.system.preparation.mode)||(0==t.system.level||t.system.preparation.prepared)}))}for(var y=[].concat(_toConsumableArray(this.itemsWithSpells),[{label:"DND5E.SpellPrepAtWill",buttons:this.items.filter((function(t){return"atwill"===t.system.preparation.mode})).map((function(t){return new C({item:t})})),uses:{max:1/0,value:1/0}},{label:"DND5E.SpellPrepInnate",buttons:this.items.filter((function(t){return"innate"===t.system.preparation.mode})).map((function(t){return new C({item:t})})),uses:{max:1/0,value:1/0}},{label:Object.values(a)[0],buttons:this.items.filter((function(t){return 0==t.system.level})).map((function(t){return new C({item:t})})),uses:{max:1/0,value:1/0}},{label:"DND5E.PactMagic",buttons:this.items.filter((function(t){return"pact"===t.system.preparation.mode})).map((function(t){return new C({item:t})})),uses:function uses(){return r.actor.system.spells.pact}}]),v=function _loop5(){var t=_slicedToArray(b[g],2),a=t[0],i=t[1],o=r.items.filter((function(t){return t.system.level==a&&("prepared"===t.system.preparation.mode||"always"===t.system.preparation.mode)}));if(!o.length||0==a)return"continue";y.push({label:i,buttons:o.map((function(t){return new C({item:t})})),uses:function uses(){return r.actor.system.spells["spell".concat(a)]}})},g=0,b=Object.entries(a);g<b.length;g++)v();return y.filter((function(t){return t.buttons.length}))}}},{key:"_getPanel",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee15(){return _regeneratorRuntime().wrap((function _callee15$(t){for(;;)switch(t.prev=t.next){case 0:if("spell"!==this.type){t.next=4;break}return t.abrupt("return",new o.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanel({id:this.id,accordionPanelCategories:this._spells.map((function(t){var r=t.label,a=t.buttons,i=t.uses;return new o.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanelCategory({label:r,buttons:a,uses:i})}))}));case 4:return t.abrupt("return",new o.MAIN.BUTTON_PANELS.ButtonPanel({id:this.id,buttons:this.items.map((function(t){return new C({item:t})}))}));case 5:case"end":return t.stop()}}),_callee15,this)}))),function _getPanel(){return r.apply(this,arguments)})}]),DND5eButtonPanelButton}(o.MAIN.BUTTONS.ButtonPanelButton),x=function(t){_inherits(DND5eSpecialActionButton,t);var r,a,i,o=_createSuper(DND5eSpecialActionButton);function DND5eSpecialActionButton(t){var r;_classCallCheck(this,DND5eSpecialActionButton);var a=(r=o.call(this)).actor.items.getName(t.name);return r.actorItem=a,r.item=null!=a?a:new CONFIG.Item.documentClass(t,{parent:r.actor}),r}return _createClass(DND5eSpecialActionButton,[{key:"label",get:function get(){return this.item.name}},{key:"icon",get:function get(){return this.item.img}},{key:"hasTooltip",get:function get(){return!0}},{key:"activity",get:function get(){var t;if(null!==(t=this.item)&&void 0!==t&&null!==(t=t.system)&&void 0!==t&&t.activities)return Array.from(this.item.system.activities)[0]}},{key:"getTooltipData",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function _callee16(){var t;return _regeneratorRuntime().wrap((function _callee16$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item);case 2:return(t=r.sent).propertiesLabel="enhancedcombathud-dnd5e.tooltip.properties.name",r.abrupt("return",t);case 5:case"end":return r.stop()}}),_callee16,this)}))),function getTooltipData(){return i.apply(this,arguments)})},{key:"_onLeftClick",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee17(t){var r,a,i;return _regeneratorRuntime().wrap((function _callee17$(o){for(;;)switch(o.prev=o.next){case 0:if(a=(null===(r=game.modules.get("dfreds-convenient-effects"))||void 0===r?void 0:r.active)&&game.dfreds.effectInterface.findEffect({effectName:this.label}),i=!1,!a){o.next=8;break}return i=!0,o.next=6,game.dfreds.effectInterface.toggleEffect({effectName:this.label,overlay:!1,uuids:[this.actor.uuid]});case 6:o.next=18;break;case 8:if(!this.actorItem){o.next=14;break}return o.next=11,this.activity.use({event:t},{event:t});case 11:o.t0=o.sent,o.next=17;break;case 14:return o.next=16,this.createChatMessage();case 16:o.t0=o.sent;case 17:i=o.t0;case 18:i&&C.consumeActionEconomy(this.item);case 19:case"end":return o.stop()}}),_callee17,this)}))),function _onLeftClick(t){return a.apply(this,arguments)})},{key:"createChatMessage",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee18(){return _regeneratorRuntime().wrap((function _callee18$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ChatMessage.create({user:game.user,speaker:{actor:this.actor,token:this.actor.token,alias:this.actor.name},content:'\n <div class="dnd5e2 chat-card item-card" data-display-challenge="">\n\n <section class="card-header description collapsible">\n\n <header class="summary">\n <img class="gold-icon" src="'.concat(this.icon,'">\n <div class="name-stacked border">\n <span class="title">').concat(this.label,'</span>\n <span class="subtitle">\n Feature\n </span>\n </div>\n <i class="fas fa-chevron-down fa-fw"></i>\n </header>\n\n <section class="details collapsible-content card-content">\n <div class="wrapper">\n ').concat(this.item.system.description.value,"\n </div>\n </section>\n </section>\n\n\n</div>\n ")});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),_callee18,this)}))),function createChatMessage(){return r.apply(this,arguments)})}]),DND5eSpecialActionButton}(o.MAIN.BUTTONS.ActionButton),O=function(t){_inherits(DND5eMovementHud,t);var r=_createSuper(DND5eMovementHud);function DND5eMovementHud(){var t,a;_classCallCheck(this,DND5eMovementHud);for(var i=arguments.length,o=new Array(i),l=0;l<i;l++)o[l]=arguments[l];return(a=r.call.apply(r,[this].concat(o))).getMovementMode=null===(t=game.modules.get("elevation-drag-ruler"))||void 0===t||null===(t=t.api)||void 0===t?void 0:t.getMovementMode,a}return _createClass(DND5eMovementHud,[{key:"visible",get:function get(){var t;return null===(t=game.combat)||void 0===t?void 0:t.started}},{key:"movementMode",get:function get(){return this.getMovementMode?this.getMovementMode(this.token):"walk"}},{key:"movementMax",get:function get(){return this.actor?this.actor.system.attributes.movement[this.movementMode]/canvas.scene.dimensions.distance:0}}]),DND5eMovementHud}(o.MovementHud),R=function(t){_inherits(DND5eButtonHud,t);var r,a=_createSuper(DND5eButtonHud);function DND5eButtonHud(){_classCallCheck(this,DND5eButtonHud);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return a.call.apply(a,[this].concat(r))}return _createClass(DND5eButtonHud,[{key:"visible",get:function get(){var t;return!(null!==(t=game.combat)&&void 0!==t&&t.started)}},{key:"_getButtons",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee19(){var t=this;return _regeneratorRuntime().wrap((function _callee19$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",[{label:"DND5E.LongRest",onClick:function onClick(r){return t.actor.longRest()},icon:"fas fa-bed"},{label:"DND5E.ShortRest",onClick:function onClick(r){return t.actor.shortRest()},icon:"fas fa-coffee"}]);case 1:case"end":return r.stop()}}),_callee19)}))),function _getButtons(){return r.apply(this,arguments)})}]),DND5eButtonHud}(o.ButtonHud),S=function(t){_inherits(DND5eWeaponSets,t);var r,a,i,o=_createSuper(DND5eWeaponSets);function DND5eWeaponSets(){return _classCallCheck(this,DND5eWeaponSets),o.apply(this,arguments)}return _createClass(DND5eWeaponSets,[{key:"getDefaultSets",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function _callee20(){var t,r,a,i,o,l,c,u,p,h,m,y,v,g,b,_,D;return _regeneratorRuntime().wrap((function _callee20$(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,_get(_getPrototypeOf(DND5eWeaponSets.prototype),"getDefaultSets",this).call(this);case 2:if(g=w.sent,b=null===(t=this.actor.flags)||void 0===t||null===(t=t.dnd5e)||void 0===t?void 0:t.isPolymorphed,"npc"===this.actor.type||b){w.next=6;break}return w.abrupt("return",g);case 6:return _=this.actor.items.filter((function(t){return"weapon"===t.type&&"action"===d(t)})),D=this.actor.items.filter((function(t){return"weapon"===t.type&&"bonus"===d(t)})),w.abrupt("return",{1:{primary:null!==(r=null===(a=_[0])||void 0===a?void 0:a.uuid)&&void 0!==r?r:null,secondary:null!==(i=null===(o=D[0])||void 0===o?void 0:o.uuid)&&void 0!==i?i:null},2:{primary:null!==(l=null===(c=_[1])||void 0===c?void 0:c.uuid)&&void 0!==l?l:null,secondary:null!==(u=null===(p=D[1])||void 0===p?void 0:p.uuid)&&void 0!==u?u:null},3:{primary:null!==(h=null===(m=_[2])||void 0===m?void 0:m.uuid)&&void 0!==h?h:null,secondary:null!==(y=null===(v=D[2])||void 0===v?void 0:v.uuid)&&void 0!==y?y:null}});case 9:case"end":return w.stop()}}),_callee20,this)}))),function getDefaultSets(){return i.apply(this,arguments)})},{key:"_getSets",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee21(){var t,r,a,i,o,l;return _regeneratorRuntime().wrap((function _callee21$(c){for(;;)switch(c.prev=c.next){case 0:if(!(null===(t=this.actor.flags)||void 0===t||null===(t=t.dnd5e)||void 0===t?void 0:t.isPolymorphed)){c.next=7;break}return c.next=4,this.getDefaultSets();case 4:c.t0=c.sent,c.next=13;break;case 7:return c.t1=foundry.utils,c.next=10,this.getDefaultSets();case 10:c.t2=c.sent,c.t3=foundry.utils.deepClone(this.actor.getFlag("enhancedcombathud","weaponSets")||{}),c.t0=c.t1.mergeObject.call(c.t1,c.t2,c.t3);case 13:r=c.t0,a=0,i=Object.entries(r);case 15:if(!(a<i.length)){c.next=36;break}if((o=_slicedToArray(i[a],2))[0],!(l=o[1]).primary){c.next=23;break}return c.next=20,fromUuid(l.primary);case 20:c.t4=c.sent,c.next=24;break;case 23:c.t4=null;case 24:if(l.primary=c.t4,!l.secondary){c.next=31;break}return c.next=28,fromUuid(l.secondary);case 28:c.t5=c.sent,c.next=32;break;case 31:c.t5=null;case 32:l.secondary=c.t5;case 33:a++,c.next=15;break;case 36:return c.abrupt("return",r);case 37:case"end":return c.stop()}}),_callee21,this)}))),function _getSets(){return a.apply(this,arguments)})},{key:"_onSetChange",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee22(t){var r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee22$(d){for(;;)switch(d.prev=d.next){case 0:if(r=t.sets,a=t.active,game.settings.get("enhancedcombathud-dnd5e","switchEquip")){d.next=4;break}return d.abrupt("return");case 4:return i=[],o=r[a],l=Object.values(o).filter((function(t){return t})),c=Object.values(r).filter((function(t){return t!==o})),u=c.flatMap((function(t){return Object.values(t)})).filter((function(t){return t})).filter((function(t){return!l.includes(t)})),l.forEach((function(t){var r;null!==(r=t.system)&&void 0!==r&&r.equipped||i.push({_id:t.id,"system.equipped":!0})})),u.forEach((function(t){var r;null!==(r=t.system)&&void 0!==r&&r.equipped&&i.push({_id:t.id,"system.equipped":!1})})),d.next=13,this.actor.updateEmbeddedDocuments("Item",i);case 13:return d.abrupt("return",d.sent);case 14:case"end":return d.stop()}}),_callee22,this)}))),function _onSetChange(t){return r.apply(this,arguments)})}]),DND5eWeaponSets}(o.WeaponSets),B=game.settings.get(a,"macroPanel"),I=[_,D,w,A,k,N,P];B&&I.push(o.PREFAB.MacroPanel),I.push(o.PREFAB.PassTurnPanel),t.definePortraitPanel(v),t.defineDrawerPanel(b),t.defineMainPanels(I),t.defineMovementHud(O),t.defineButtonHud(R),t.defineWeaponSets(S),t.defineTooltip(l),t.defineSupportedActorTypes(["character","npc"])}function getTooltipDetails(t,r){return _getTooltipDetails.apply(this,arguments)}function _getTooltipDetails(){return(_getTooltipDetails=_asyncToGenerator(_regeneratorRuntime().mark((function _callee23(t,r){var a,i,o,l,c,u,d,h,m,y,v,g,b,_,D,w,A,k,N,P,C,T,x,O,R,S,B,I,E,G;return _regeneratorRuntime().wrap((function _callee23$(M){for(;;)switch(M.prev=M.next){case 0:if(g=[],b=[],_="","skill"!=r){M.next=8;break}c=CONFIG.DND5E.skills[t].label,u=game.i18n.localize("enhancedcombathud-dnd5e.skills.".concat(t,".tooltip")),M.next=45;break;case 8:if("save"!=r){M.next=13;break}c=CONFIG.DND5E.abilities[t].label,u=game.i18n.localize("enhancedcombathud-dnd5e.abilities.".concat(t,".tooltip")),M.next=45;break;case 13:if(t&&t.system){M.next=15;break}return M.abrupt("return");case 15:c=t.name,u=t.system.identified?t.system.description.value:null!==(D=t.system.description.unidentified)&&void 0!==D?D:t.system.description.value,d=t.type,m=(null===(w=t.labels)||void 0===w?void 0:w.target)||"-",y=(null===(A=t.labels)||void 0===A?void 0:A.range)||"-",b=[],v=null===(k=t.labels)||void 0===k||null===(k=k.damageTypes)||void 0===k?void 0:k.split(", "),g=v&&v.length?v:[],_="",M.t0=d,M.next="weapon"===M.t0?27:"spell"===M.t0?31:"consumable"===M.t0?39:"feat"===M.t0?42:45;break;case 27:for(h=CONFIG.DND5E.weaponTypes[t.system.weaponType],b.push(CONFIG.DND5E.itemActionTypes[p(t)]),N=0,P=Object.entries(t.system.properties);N<P.length;N++)C=_slicedToArray(P[N],2),T=C[0],x=C[1],(O=x&&CONFIG.DND5E.weaponProperties[T]?CONFIG.DND5E.weaponProperties[T]:void 0)&&b.push(O);return M.abrupt("break",45);case 31:h="".concat(t.labels.level," ").concat(t.labels.school),b.push(CONFIG.DND5E.spellSchools[t.system.school]),b.push(t.labels.duration),b.push(t.labels.save),R=_createForOfIteratorHelper(t.labels.components.all);try{for(R.s();!(S=R.n()).done;)B=S.value,b.push(B.abbr)}catch(t){R.e(t)}finally{R.f()}return t.labels.materials&&(_=t.labels.materials),M.abrupt("break",45);case 39:return h=CONFIG.DND5E.consumableTypes[t.system.consumableType],b.push(CONFIG.DND5E.itemActionTypes[p(t)]),M.abrupt("break",45);case 42:return h=t.system.requirements,b.push(CONFIG.DND5E.itemActionTypes[p(t)]),M.abrupt("break",45);case 45:if(!u){M.next=49;break}return M.next=48,TextEditor.enrichHTML(u,{async:!0,relativeTo:t.parent});case 48:u=M.sent;case 49:return I=[],(m||y)&&(I=[{label:"enhancedcombathud-dnd5e.tooltip.target.name",value:m},{label:"enhancedcombathud-dnd5e.tooltip.range.name",value:y}]),null!=t&&null!==(a=t.labels)&&void 0!==a&&a.toHit&&I.push({label:"enhancedcombathud-dnd5e.tooltip.toHit.name",value:t.labels.toHit}),null!=t&&null!==(i=t.labels)&&void 0!==i&&null!==(i=i.derivedDamage)&&void 0!==i&&i.length&&(E="",t.labels.derivedDamage.forEach((function(t){E+=t.formula+" "+getDamageTypeIcon(t.damageType)+" "})),I.push({label:"enhancedcombathud-dnd5e.tooltip.damage.name",value:E})),G=[],null!==(o=g)&&void 0!==o&&o.length&&g.forEach((function(t){return G.push({label:t,primary:!0})})),null!==(l=b)&&void 0!==l&&l.length&&b.forEach((function(t){var r;return G.push({label:null!==(r=null==t?void 0:t.label)&&void 0!==r?r:t,secondary:!0})})),M.abrupt("return",{title:c,description:u,subtitle:h,details:I,properties:G,footerText:_});case 57:case"end":return M.stop()}}),_callee23)})))).apply(this,arguments)}function getDamageTypeIcon(t){switch(t.toLowerCase()){case"acid":return'<i class="fas fa-flask"></i>';case"bludgeoning":return'<i class="fas fa-hammer"></i>';case"cold":return'<i class="fas fa-snowflake"></i>';case"fire":return'<i class="fas fa-fire"></i>';case"force":return'<i class="fas fa-hand-sparkles"></i>';case"lightning":return'<i class="fas fa-bolt"></i>';case"necrotic":return'<i class="fas fa-skull"></i>';case"piercing":return'<i class="fas fa-crosshairs"></i>';case"poison":return'<i class="fas fa-skull-crossbones"></i>';case"psychic":return'<i class="fas fa-brain"></i>';case"radiant":return'<i class="fas fa-sun"></i>';case"slashing":return'<i class="fas fa-cut"></i>';case"thunder":return'<i class="fas fa-bell"></i>';case"healing":return'<i class="fas fa-heart"></i>';default:return""}}function getProficiencyIcon(t){return 0==t?'<i style="margin-right: 1ch; pointer-events: none" class="far fa-circle"> </i>':1==t?'<i style="margin-right: 1ch; pointer-events: none" class="fas fa-check"> </i>':2==t?'<i style="margin-right: 1ch; pointer-events: none" class="fas fa-check-double"> </i>':.5==t?'<i style="margin-right: 1ch; pointer-events: none" class="fas fa-adjust"> </i>':'<i style="margin-right: 1ch; pointer-events: none" class="far fa-circle"> </i>'}function condenseItemButtons(t){if(!game.settings.get(a,"condenseClassActions"))return t.map((function(t){return new C({item:t,inActionPanel:!0})}));for(var r=[],i=t.length,l=i-i%2,c=null,u=0;u<i;u++){var d=u<l,p=t[u];if(d)if(c){var h=new C({item:p,inActionPanel:!1});r.push(new o.MAIN.BUTTONS.SplitButton(c,h)),c=null}else c=new C({item:p,inActionPanel:!1});else r.push(new C({item:p,inActionPanel:!0}))}return r}}))}function settings_slicedToArray(t,r){return function settings_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function settings_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||function settings_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return settings_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return settings_arrayLikeToArray(t,r)}(t,r)||function settings_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function settings_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function registerSettings(){!function registerSettingsArray(t){for(var r=0,i=Object.entries(t);r<i.length;r++){var o=settings_slicedToArray(i[r],2),l=o[0],c=o[1];game.settings.register(a,l,c)}}({showWeaponsItems:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.showWeaponsItems.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.showWeaponsItems.hint"),scope:"world",config:!0,type:Boolean,default:!1,onChange:function onChange(t){ui.ARGON.constructor.DND5E.itemTypes.consumable=ui.ARGON.constructor.DND5E.itemTypes.consumable.filter((function(t){return"weapon"!==t})),t&&ui.ARGON.constructor.DND5E.itemTypes.consumable.push("weapon"),ui.ARGON.refresh()}},showClassActions:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.showClassActions.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.showClassActions.hint"),scope:"world",config:!0,type:Boolean,default:!0,onChange:function onChange(t){ui.ARGON.constructor.DND5E.mainBarFeatures=ui.ARGON.constructor.DND5E.mainBarFeatures.filter((function(t){return"class"!==t})),t&&ui.ARGON.constructor.DND5E.mainBarFeatures.push("class"),ui.ARGON.refresh()}},condenseClassActions:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.condenseClassActions.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.condenseClassActions.hint"),scope:"world",config:!0,type:Boolean,default:!0,onChange:function onChange(){return ui.ARGON.refresh()}},macroPanel:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.macroPanel.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.macroPanel.hint"),scope:"world",config:!0,type:Boolean,default:!1,requiresReload:!0,onChange:function onChange(){return ui.ARGON.refresh()}},switchEquip:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.switchEquip.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.switchEquip.hint"),scope:"world",config:!0,type:Boolean,default:!0,onChange:function onChange(){return ui.ARGON.refresh()}},showSpecialActions:{name:game.i18n.localize("enhancedcombathud-dnd5e.settings.showSpecialActions.name"),hint:game.i18n.localize("enhancedcombathud-dnd5e.settings.showSpecialActions.hint"),scope:"world",config:!0,type:Boolean,default:!0,onChange:function onChange(){return ui.ARGON.refresh()}}})}var a="enhancedcombathud-dnd5e";Hooks.on("setup",(function(){registerSettings(),initConfig()}))})();
//# sourceMappingURL=index.js.map