No forces available. Check your data/forces/ folder.
++ BattleTech Forces Manager +
++ No forces available +
++ Check data/forces/ directory +
>>5]),this.htrees=new Uint32Array(t)}function Q(e,t){var n,r,i={num_htrees:null,context_map:null},a=0;t.readMoreInput();var s=i.num_htrees=y(t)+1,l=i.context_map=new Uint8Array(e);if(s<=1)return i;for(t.readBits(1)&&(a=t.readBits(4)+1),n=[],r=0;r=e)throw new Error("[DecodeContextMap] i >= context_map_size");l[r]=0,++r}else l[r]=c-a,++r}return t.readBits(1)&&function(e,t){var n,r=new Uint8Array(256);for(n=0;n<256;++n)r[n]=n;for(n=0;n >9&1,n.head.done=!0),e.adler=n.check=0,n.mode=c;break;case 10:for(;b<32;){if(0===p)break e;p--,y+=A[f++]<>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===p)break e;p--,y+=A[f++]<>>=1)){case 0:n.mode=14;break;case 1:if(v(n),n.mode=20,6===t){y>>>=2,b-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=u}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===p)break e;p--,y+=A[f++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=u;break}if(n.length=65535&y,y=0,b=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(C=n.length){if(C>p&&(C=p),C>m&&(C=m),0===C)break e;r.arraySet(h,A,f,C,g),p-=C,f+=C,m-=C,g+=C,n.length-=C;break}n.mode=c;break;case 17:for(;b<14;){if(0===p)break e;p--,y+=A[f++]<>>=5,b-=5,n.ndist=1+(31&y),y>>>=5,b-=5,n.ncode=4+(15&y),y>>>=4,b-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=u;break}n.have=0,n.mode=18;case 18:for(;n.have >>0?1:0),x=d.low=x+z,d.high=B+U+(x>>>00&&(0===e||1!==Q))return-1;for(F[1]=0,C=1;C852||2===e&&N>592)return 1;for(;;){v=C-D,A[B]b?(w=M[O+A[B]],I=T[j+A[B]]):(w=96,I=0),f=1<
852||2===e&&N>592)return 1;u[p=R&m]=k<<24|S<<16|y-d}}return 0!==R&&(u[y+R]=C-D<<24|64<<16),h.bits=k,0}},5592:e=>{"use strict";var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,n,r,i){var a=t,s=i+r;e^=-1;for(var o=i;o
>>8^a[255&(e^n[o])];return-1^e}},5886:(e,t)=>{"use strict";var n="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;aa(l,n))ca(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(ca(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,A=null,h=3,f=!1,g=!1,p=!1,m="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function v(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(p=!1,v(e),!g)if(null!==r(c))g=!0,R(I);else{var t=r(u);null!==t&&T(w,t.startTime-e)}}function I(e,n){g=!1,p&&(p=!1,y(x),x=-1),f=!0;var a=h;try{for(v(n),A=r(c);null!==A&&(!(A.expirationTime>n)||e&&!S());){var s=A.callback;if("function"===typeof s){A.callback=null,h=A.priorityLevel;var o=s(A.expirationTime<=n);n=t.unstable_now(),"function"===typeof o?A.callback=o:A===r(c)&&i(c),v(n)}else i(c);A=r(c)}if(null!==A)var l=!0;else{var d=r(u);null!==d&&T(w,d.startTime-n),l=!1}return l}finally{A=null,h=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,C=!1,B=null,x=-1,Q=5,k=-1;function S(){return!(t.unstable_now()-ke||125
{var r=n(6329),i=n(7284).EventEmitter;function a(e){if(!(this instanceof a))return new a(e);i.call(this),e=e||{},this.concurrency=e.concurrency||1/0,this.timeout=e.timeout||0,this.autostart=e.autostart||!1,this.results=e.results||null,this.pending=0,this.session=0,this.running=!1,this.jobs=[],this.timers={}}e.exports=a,e.exports.default=a,r(a,i);["pop","shift","indexOf","lastIndexOf"].forEach(function(e){a.prototype[e]=function(){return Array.prototype[e].apply(this.jobs,arguments)}}),a.prototype.slice=function(e,t){return this.jobs=this.jobs.slice(e,t),this},a.prototype.reverse=function(){return this.jobs.reverse(),this};function s(){for(var e in this.timers){var t=this.timers[e];delete this.timers[e],clearTimeout(t)}}function o(e){var t=this;function n(e){t.end(e)}this.on("error",n),this.on("end",function r(i){t.removeListener("error",n),t.removeListener("end",r),e(i,this.results)})}function l(e){this.session++,this.running=!1,this.emit("end",e)}["push","unshift","splice"].forEach(function(e){a.prototype[e]=function(){var t=Array.prototype[e].apply(this.jobs,arguments);return this.autostart&&this.start(),t}}),Object.defineProperty(a.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),a.prototype.start=function(e){if(e&&o.call(this,e),this.running=!0,!(this.pending>=this.concurrency))if(0!==this.jobs.length){var t=this,n=this.jobs.shift(),r=!0,i=this.session,a=null,s=!1,c=null,u=n.hasOwnProperty("timeout")?n.timeout:this.timeout;u&&(a=setTimeout(function(){s=!0,t.listeners("timeout").length>0?t.emit("timeout",A,n):A()},u),this.timers[a]=a),this.results&&(c=this.results.length,this.results[c]=null),this.pending++,t.emit("start",n);var d=n(A);d&&d.then&&"function"===typeof d.then&&d.then(function(e){return A(null,e)}).catch(function(e){return A(e||!0)}),this.running&&this.jobs.length>0&&this.start()}else 0===this.pending&&l.call(this);function A(e,o){r&&t.session===i&&(r=!1,t.pending--,null!==a&&(delete t.timers[a],clearTimeout(a)),e?t.emit("error",e,n):!1===s&&(null!==c&&(t.results[c]=Array.prototype.slice.call(arguments,1)),t.emit("success",o,n)),t.session===i&&(0===t.pending&&0===t.jobs.length?l.call(t):t.running&&t.start()))}},a.prototype.stop=function(){this.running=!1},a.prototype.end=function(e){s.call(this),this.jobs.length=0,this.pending=0,l.call(this,e)}},7284:e=>{"use strict";var t,n="object"===typeof Reflect?Reflect:null,r=n&&"function"===typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"===typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&g(e,"error",t,n)}(e,i,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,a,s,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"===typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function A(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n
a(l,n))ca(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(ca(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,A=null,h=3,f=!1,g=!1,p=!1,m="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function v(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(p=!1,v(e),!g)if(null!==r(c))g=!0,_();else{var t=r(u);null!==t&&N(w,t.startTime-e)}}var I,E=!1,C=-1,B=5,x=-1;function Q(){return!(t.unstable_now()-xe&&Q());){var s=A.callback;if("function"===typeof s){A.callback=null,h=A.priorityLevel;var o=s(A.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof o){A.callback=o,v(e),n=!0;break t}A===r(c)&&i(c),v(e)}else i(c);A=r(c)}if(null!==A)n=!0;else{var l=r(u);null!==l&&N(w,l.startTime-e),n=!1}}break e}finally{A=null,h=a,f=!1}n=void 0}}finally{n?I():E=!1}}}if("function"===typeof b)I=function(){b(k)};else if("undefined"!==typeof MessageChannel){var S=new MessageChannel,D=S.port2;S.port1.onmessage=k,I=function(){D.postMessage(null)}}else I=function(){m(k,0)};function _(){E||(E=!0,I())}function N(e,n){C=m(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,_())},t.unstable_forceFrameRate=function(e){0>e||125e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==I&&4!==I||(i.status=f),1===I||3===I)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===I&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),y(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(v(i,255&e.adler),v(i,e.adler>>8&255),v(i,e.adler>>16&255),v(i,e.adler>>24&255),v(i,255&e.total_in),v(i,e.total_in>>8&255),v(i,e.total_in>>16&255),v(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),y(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==A&&t!==h&&t!==f?g(e,c):(e.state=null,t===h?g(e,-3):0):c},t.deflateSetDictionary=function(e,t){var n,r,a,o,l,u,d,A,h=t.length;if(!e||!e.state)return c;if(2===(o=(n=e.state).wrap)||1===o&&42!==n.status||n.lookahead)return c;for(1===o&&(e.adler=s(e.adler,t,h,0)),n.wrap=0,h>=n.w_size&&(0===o&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),A=new i.Buf8(n.w_size),i.arraySet(A,t,h-n.w_size,n.w_size,0),t=A,h=n.w_size),l=e.avail_in,u=e.next_in,d=e.input,e.avail_in=h,e.next_in=0,e.input=t,C(n);n.lookahead>=3;){r=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<{"use strict";e.exports=function(e,t){var n,r,i,a,s,o,l,c,u,d,A,h,f,g,p,m,y,b,v,w,I,E,C,B,x;n=e.state,r=e.next_in,B=e.input,i=r+(e.avail_in-5),a=e.next_out,x=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,A=n.window,h=n.hold,f=n.bits,g=n.lencode,p=n.distcode,m=(1<s?"asc"===d.direction?1:-1:0}),C=function(e,t){const n=e.pilots||[],r=e.mechs||[],i=new Set;return r.forEach(e=>{t&&e.id===t.id||e.pilotId&&i.add(e.pilotId)}),n.filter(e=>!i.has(e.id))}(n,s),B=e=>{let{column:t}=e;return d.key!==t?null:"asc"===d.direction?(0,we.jsx)(Ge,{className:"w-3 h-3 ml-1"}):(0,we.jsx)(He,{className:"w-3 h-3 ml-1"})};return(0,we.jsxs)("div",{className:"tactical-panel",children:[(0,we.jsx)("div",{className:"tactical-header",children:(0,we.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[(0,we.jsxs)("h3",{className:"text-sm font-semibold uppercase tracking-wider flex items-center gap-2",children:[(0,we.jsx)(h,{className:"w-4 h-4"}),"Mech Roster"]}),(0,we.jsxs)("div",{className:"flex items-center gap-4 flex-1 justify-end",children:[(0,we.jsx)(Re,{placeholder:"Filter by mech or pilot...",value:c,onChange:e=>u(e.target.value),className:"max-w-xs h-8 text-xs"}),(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.mechs.length," Units"]}),(0,we.jsxs)(_e,{size:"sm",onClick:()=>a(!0),children:[(0,we.jsx)(f,{className:"w-4 h-4"}),"Add Mech"]})]})]})]})}),(0,we.jsx)("div",{className:"overflow-x-auto",children:(0,we.jsxs)("table",{className:"data-table",children:[(0,we.jsx)("thead",{children:(0,we.jsxs)("tr",{children:[(0,we.jsx)("th",{onClick:()=>I("name"),className:"cursor-pointer hover:bg-muted/80 select-none",children:(0,we.jsxs)("div",{className:"flex items-center",children:["Mech ",(0,we.jsx)(B,{column:"name"})]})}),(0,we.jsx)("th",{onClick:()=>I("status"),className:"cursor-pointer hover:bg-muted/80 select-none",children:(0,we.jsxs)("div",{className:"flex items-center",children:["Status ",(0,we.jsx)(B,{column:"status"})]})}),(0,we.jsx)("th",{onClick:()=>I("pilot"),className:"cursor-pointer hover:bg-muted/80 select-none",children:(0,we.jsxs)("div",{className:"flex items-center",children:["Pilot ",(0,we.jsx)(B,{column:"pilot"})]})}),(0,we.jsx)("th",{onClick:()=>I("bv"),className:"text-right cursor-pointer hover:bg-muted/80 select-none",children:(0,we.jsxs)("div",{className:"flex items-center justify-end",children:["BV ",(0,we.jsx)(B,{column:"bv"})]})}),(0,we.jsx)("th",{onClick:()=>I("weight"),className:"text-right cursor-pointer hover:bg-muted/80 select-none",children:(0,we.jsxs)("div",{className:"flex items-center justify-end",children:["Weight ",(0,we.jsx)(B,{column:"weight"})]})}),(0,we.jsx)("th",{children:"Recent Activity"})]})}),(0,we.jsx)("tbody",{children:0===E.length?(0,we.jsx)("tr",{children:(0,we.jsx)("td",{colSpan:"6",className:"text-center py-8 text-muted-foreground",children:0===n.mechs.length?"No mechs in roster. Add mechs via Data Editor.":"No mechs match your filter."})}):E.map(e=>{const t=Ze(n,e);return(0,we.jsxs)("tr",{onClick:()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){o(e),v({name:e.name,status:e.status||et.OPERATIONAL,pilotId:e.pilotId||"",bv:e.bv,weight:e.weight,image:e.image||"",history:e.history||"",warchestCost:e.warchestCost||0});const t=function(e,t){if(!e||!t)return null;const n=t.toLowerCase().trim();return e.find(e=>e.name.toLowerCase()===n)||null}(g,e.name);y(w(t))}else o(null),v({name:"",status:et.OPERATIONAL,pilotId:"",bv:0,weight:0,image:"",history:"",warchestCost:0}),y(null);a(!0)}(e),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[(0,we.jsx)("td",{children:(0,we.jsxs)("div",{className:"flex items-center gap-3",children:[e.image&&(0,we.jsx)("img",{src:e.image,alt:e.name,className:"max-h-10 max-w-10 rounded object-contain"}),(0,we.jsx)("span",{className:"font-medium",children:e.name})]})}),(0,we.jsx)("td",{children:(0,we.jsx)(ze,{variant:nt(e.status),children:e.status})}),(0,we.jsx)("td",{className:"text-muted-foreground",children:t?6===t.injuries?"".concat($e(t)," - KIA"):"".concat($e(t)," - G:").concat(t.gunnery," / P:").concat(t.piloting):"Missing Pilot"}),(0,we.jsx)("td",{className:"text-right font-mono",children:be(Ve(n,e))}),(0,we.jsxs)("td",{className:"text-right font-mono",children:[e.weight,"t"]}),(0,we.jsx)("td",{className:"text-xs text-muted-foreground",children:e.activityLog&&e.activityLog.length>0?(0,we.jsx)("div",{className:"max-w-xs truncate",children:e.activityLog[e.activityLog.length-1].action}):(0,we.jsx)("span",{className:"text-muted-foreground/50",children:"No activity"})})]},e.id)})})]})}),(0,we.jsx)(Fe,{open:i,onOpenChange:a,children:(0,we.jsxs)(Me,{onClose:()=>a(!1),className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,we.jsx)(Oe,{children:(0,we.jsx)(Pe,{children:s?"Edit Mech":"Add New Mech"})}),(0,we.jsxs)("div",{className:"space-y-4",children:[(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Mech Name *"}),(0,we.jsx)(pt,{value:b.name,onChange:e=>{v(l(l({},b),{},{name:e})),y(null)},onSelect:e=>{v(l(l({},b),{},{name:e.name,bv:e.bv||b.bv,weight:e.weight||b.weight})),y({walk:e.walk,maxWalk:e.maxWalk,jump:e.jump,maxJump:e.maxJump,heat:e.heat,dissipation:e.dissipation,dissipationEfficiency:e.dissipationEfficiency,components:e.components})},placeholder:"Search mech catalog..."}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Type at least 2 characters to search. Select a mech to auto-fill BV and weight."})]}),m&&(0,we.jsxs)("div",{className:"border border-border rounded-lg p-4 bg-muted/30 space-y-4",children:[(0,we.jsxs)("div",{className:"flex flex-wrap gap-6",children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsx)(We,{className:"w-4 h-4 text-muted-foreground"}),(0,we.jsx)("span",{className:"text-sm font-medium",children:"Movement:"}),(0,we.jsxs)("span",{className:"text-sm font-mono",children:[m.walk,"/",1.5*m.walk|0,m.maxWalk>m.walk&&(0,we.jsxs)("span",{className:"text-blue-400",children:[" [",m.maxWalk,"/",1.5*m.maxWalk|0,"]"]}),m.jump>0&&(0,we.jsxs)(we.Fragment,{children:["/",m.jump,m.maxJump>m.jump&&(0,we.jsxs)("span",{className:"text-blue-400",children:[" [",m.maxJump,"]"]})]})]})]}),(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsx)(Ye,{className:"w-4 h-4 text-orange-500"}),(0,we.jsx)("span",{className:"text-sm font-medium",children:"Heat:"}),(0,we.jsxs)("span",{className:"text-sm",children:[(0,we.jsx)("span",{className:"text-orange-400",children:m.heat}),(0,we.jsx)("span",{className:"text-muted-foreground",children:" gen"}),(0,we.jsx)("span",{className:"mx-1",children:"/"}),(0,we.jsx)("span",{className:"text-cyan-400",children:m.dissipation}),(0,we.jsx)("span",{className:"text-muted-foreground",children:" sink"})]})]})]}),m.components&&(()=>{const{weapons:e,equipment:t}=function(e){if(!e)return{weapons:[],equipment:[]};const t=e.split(",").map(e=>e.trim()).filter(Boolean),n=[],r=[],i=[/armor/i,/structure/i,/engine/i,/gyro/i,/cockpit/i,/\bammo\b/i,/ferro.*fibrous/i,/endo.*steel/i,/endo.*composite/i],a=[/ecm/i,/bap/i,/\bc3\b/i,/\btag\b/i,/\bnarc\b/i,/\bams\b/i,/\bcase\b/i,/targeting/i,/probe/i,/supercharger/i,/\btsm\b/i,/\bmasc\b/i,/jump jet/i,/partial wing/i,/void signature/i,/stealth/i,/heat sink/i,/capacitor/i,/apollo/i,/artemis/i,/streak/i],s=[/laser/i,/ppc/i,/\bac[\s/-]*\d/i,/autocannon/i,/gauss/i,/\blrm/i,/\bsrm/i,/\bmrm/i,/\batm\b/i,/machine gun/i,/\bmg\b/i,/flamer/i,/plasma/i,/\bhag\b/i,/lb.*ac/i,/\bultra\b/i,/rotary/i,/thunderbolt/i,/arrow/i,/\bmml/i,/rocket/i];for(const l of t){var o;const e=l.match(/^(\d+)x(.+?)(?::(.+))?$/);if(!e)continue;const t=parseInt(e[1],10),c=e[2].trim(),u=(null===(o=e[3])||void 0===o?void 0:o.trim())||"";if(["Armor","Structure","Engine"].includes(u))continue;if(i.some(e=>e.test(c)))continue;const d=a.some(e=>e.test(c)),A=s.some(e=>e.test(c)),h={count:t,name:c,location:u};A&&!d?n.push(h):r.push(h)}return{weapons:n,equipment:r}}(m.components);return e.length>0||t.length>0?(0,we.jsxs)("div",{children:[(0,we.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,we.jsx)(Ke,{className:"w-4 h-4 text-muted-foreground"}),(0,we.jsx)("span",{className:"text-sm font-medium",children:"Equipment"})]}),(0,we.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.map((e,t)=>(0,we.jsxs)("div",{className:"px-2 py-1 text-xs font-medium border-l-4 ".concat(mt(e.name)),children:[e.count,"\xd7 ",e.name]},"weapon-".concat(t))),t.map((e,t)=>(0,we.jsxs)("div",{className:"px-2 py-1 text-xs font-medium border-l-4 ".concat(mt(e.name)),children:[e.count,"\xd7 ",e.name]},"equip-".concat(t)))]})]}):null})()]}),(0,we.jsxs)("div",{className:"grid grid-cols-4 gap-4",children:[(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Status"}),(0,we.jsxs)(Se,{value:b.status,onChange:e=>v(l(l({},b),{},{status:e.target.value})),children:[(0,we.jsx)("option",{value:et.OPERATIONAL,children:et.OPERATIONAL}),(0,we.jsx)("option",{value:et.DAMAGED,children:et.DAMAGED}),(0,we.jsx)("option",{value:et.DISABLED,children:et.DISABLED}),(0,we.jsx)("option",{value:et.DESTROYED,children:et.DESTROYED}),(0,we.jsx)("option",{value:et.REPAIRING,children:et.REPAIRING}),(0,we.jsx)("option",{value:et.UNAVAILABLE,children:et.UNAVAILABLE})]})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"BV (Battle Value) *"}),(0,we.jsx)(Re,{type:"number",value:b.bv,onChange:e=>v(l(l({},b),{},{bv:e.target.value})),placeholder:"0",min:"0"})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Weight (tons) *"}),(0,we.jsx)(Re,{type:"number",value:b.weight,onChange:e=>v(l(l({},b),{},{weight:e.target.value})),placeholder:"0",min:"0",max:"100"})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Warchest Cost (WP)"}),(0,we.jsx)(Re,{type:"number",value:b.warchestCost,onChange:e=>v(l(l({},b),{},{warchestCost:e.target.value})),placeholder:"0",min:"0"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Cost in WP to acquire this mech. This will be subtracted from the current Warchest."})]})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Pilot"}),(0,we.jsxs)(Se,{value:b.pilotId,onChange:e=>v(l(l({},b),{},{pilotId:e.target.value})),children:[(0,we.jsx)("option",{value:"",children:"No pilot"}),C.map(e=>(0,we.jsxs)("option",{value:e.id,children:[$e(e)," - G:",e.gunnery," / P:",e.piloting]},e.id))]}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only pilots not currently assigned to a mech are listed."})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Image URL (optional)"}),(0,we.jsx)(Re,{value:b.image,onChange:e=>v(l(l({},b),{},{image:e.target.value})),placeholder:"https://example.com/mech-image.jpg"})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("label",{className:"block text-sm font-medium mb-2",children:"History"}),(0,we.jsx)(je,{value:b.history,onChange:e=>v(l(l({},b),{},{history:e.target.value})),placeholder:"Mech history, notable battles, previous pilots...",rows:4})]}),(0,we.jsxs)("div",{className:"flex justify-end gap-2 pt-4",children:[(0,we.jsx)(_e,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,we.jsx)(_e,{onClick:()=>{if(b.name&&b.bv&&b.weight){if(s){const e=n.mechs.map(e=>e.id===s.id?l(l({},e),{},{name:b.name,status:b.status,pilotId:b.pilotId,bv:parseInt(b.bv,10)||0,weight:parseInt(b.weight,10)||0,image:b.image,history:b.history,warchestCost:parseInt(b.warchestCost,10)||0}):e),t=s.warchestCost||0,i=(parseInt(b.warchestCost,10)||0)-t,a=n.currentWarchest-i;r({mechs:e,currentWarchest:a})}else{const e=parseInt(b.warchestCost,10)||0,t=n.currentDate,i={id:"mech-".concat(Date.now()),name:b.name,status:b.status,pilotId:b.pilotId,bv:parseInt(b.bv,10)||0,weight:parseInt(b.weight,10)||0,image:b.image,history:b.history,warchestCost:e,activityLog:[{timestamp:t,action:"Purchased mech for ".concat(e," WP"),mission:null,cost:e}]},a=[...n.mechs,i],s=n.currentWarchest-e;r({mechs:a,currentWarchest:s})}a(!1)}else alert("Name, BV, and Weight are required")},disabled:!b.name||!b.bv||!b.weight,children:s?"Update Mech":"Add Mech"})]})]})]})})]})}const bt=A("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);function vt(e){var n,r;let{force:i,onUpdate:a}=e;const[s,o]=(0,t.useState)(!1),[c,u]=(0,t.useState)(null),[d,A]=(0,t.useState)(""),[h,g]=(0,t.useState)({key:"name",direction:"asc"}),[m,y]=(0,t.useState)({name:"",commander:"",gunnery:3,antimech:4,suitsDestroyed:0,suitsDamaged:0,bv:0,status:et.OPERATIONAL,image:"",history:"",warchestCost:0}),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e?(u(e),y({name:e.name,commander:e.commander||"",gunnery:e.gunnery,antimech:e.antimech,suitsDestroyed:e.suitsDestroyed,suitsDamaged:e.suitsDamaged,bv:e.bv,status:e.status||et.OPERATIONAL,image:e.image||"",history:e.history||"",warchestCost:e.warchestCost||0})):(u(null),y({name:"",commander:"",gunnery:3,antimech:4,suitsDestroyed:0,suitsDamaged:0,bv:0,status:et.OPERATIONAL,image:"",history:"",warchestCost:0})),o(!0)},v=(e,t,n)=>{const r=i.elementals.map(r=>{if(r.id===e){const e=5,i=r[t],a=Math.max(0,Math.min(e,i+n));return l(l({},r),{},{[t]:a})}return r});a({elementals:r})},w=(e,t)=>e>=3?"disabled":e>=1||t>=3?"damaged":"operational",I=e=>{let t="asc";h.key===e&&"asc"===h.direction&&(t="desc"),g({key:e,direction:t})},E=[...(i.elementals||[]).filter(e=>{const t=d.toLowerCase();return e.name.toLowerCase().includes(t)||e.commander&&e.commander.toLowerCase().includes(t)})].sort((e,t)=>{let n,r;switch(h.key){case"name":n=e.name,r=t.name;break;case"status":n=e.status,r=t.status;break;case"commander":n=e.commander||"",r=t.commander||"";break;case"gunnery":n=e.gunnery,r=t.gunnery;break;case"antimech":n=e.antimech,r=t.antimech;break;case"bv":n=e.bv,r=t.bv;break;default:return 0}return n