From eee922ee7fe81dc7d9110f587671274d54429a85 Mon Sep 17 00:00:00 2001
From: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Date: Mon, 6 Jul 2020 04:37:06 -0400
Subject: [PATCH] Updates vend-a-trays to have a unique UI, improves
accessibility. (#51931)
* Initial commit, updates trays into 2020
* Adds vend-a-trays as a service machine, without it being a machine.
* Replaced the mapped vend-a-trays with service unique versions.
* "YoUr BuIlD DiFfErS fRoM mAsTeR"
* Removes {}s from img, workin on the other part
* All my homies recompile on merge conflict
* Fixes end of line because honestly there must be no god on this green earth
* hopefully this isn't too excessive.
* How's this?
* Applies Anturk's Confirm suggestion.
* Shipped, workshopped with style a bit
* Alright that's probably enough fiddling for now
* Rebuilds.
---
_maps/map_files/BoxStation/BoxStation.dmm | 4 +-
.../map_files/Deltastation/DeltaStation2.dmm | 4 +-
.../map_files/IceBoxStation/IceBoxStation.dmm | 4 +-
_maps/map_files/MetaStation/MetaStation.dmm | 2 +-
_maps/map_files/PubbyStation/PubbyStation.dmm | 4 +-
.../circuitboards/machine_circuitboards.dm | 7 +
code/game/objects/structures/displaycase.dm | 196 ++++++++++++------
tgui/packages/tgui/interfaces/Vendatray.js | 97 +++++++++
tgui/packages/tgui/public/tgui.bundle.js | 2 +-
9 files changed, 246 insertions(+), 74 deletions(-)
create mode 100644 tgui/packages/tgui/interfaces/Vendatray.js
diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm
index ecc325f6260..746f49e0d17 100644
--- a/_maps/map_files/BoxStation/BoxStation.dmm
+++ b/_maps/map_files/BoxStation/BoxStation.dmm
@@ -53241,7 +53241,7 @@
id = "kitchen";
name = "kitchen shutters"
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel/cafeteria,
/area/crew_quarters/kitchen)
"tYi" = (
@@ -54602,7 +54602,7 @@
/obj/effect/turf_decal/tile/bar{
dir = 1
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel,
/area/crew_quarters/bar)
"wlL" = (
diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm
index 828d687ee2e..57a52c6580b 100644
--- a/_maps/map_files/Deltastation/DeltaStation2.dmm
+++ b/_maps/map_files/Deltastation/DeltaStation2.dmm
@@ -113279,7 +113279,7 @@
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel/dark,
/area/crew_quarters/bar)
"kEN" = (
@@ -114755,7 +114755,7 @@
name = "Kitchen Counter Shutters"
},
/obj/effect/turf_decal/delivery,
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel,
/area/crew_quarters/kitchen)
"qkG" = (
diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm
index ffc4b3d7ea8..8c19363a3b0 100644
--- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm
+++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm
@@ -27477,7 +27477,7 @@
/obj/effect/turf_decal/tile/bar{
dir = 1
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel,
/area/crew_quarters/bar)
"bne" = (
@@ -27514,7 +27514,7 @@
id = "kitchen";
name = "kitchen shutters"
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel/cafeteria,
/area/crew_quarters/kitchen)
"bni" = (
diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm
index f062c79726a..2883c58ce83 100644
--- a/_maps/map_files/MetaStation/MetaStation.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.dmm
@@ -74566,7 +74566,7 @@
/obj/effect/turf_decal/tile/bar{
dir = 1
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel,
/area/crew_quarters/bar)
"pAv" = (
diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm
index f5c361d3395..7f16f57179b 100644
--- a/_maps/map_files/PubbyStation/PubbyStation.dmm
+++ b/_maps/map_files/PubbyStation/PubbyStation.dmm
@@ -55223,7 +55223,7 @@
/obj/effect/turf_decal/tile/red{
dir = 4
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel/dark,
/area/crew_quarters/bar)
"pVD" = (
@@ -56172,7 +56172,7 @@
/obj/effect/turf_decal/tile/red{
dir = 8
},
-/obj/structure/displaycase/forsale,
+/obj/structure/displaycase/forsale/kitchen,
/turf/open/floor/plasteel/dark,
/area/crew_quarters/kitchen)
"sbY" = (
diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm
index 3637611e795..c9831e80647 100644
--- a/code/game/objects/items/circuitboards/machine_circuitboards.dm
+++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm
@@ -1117,6 +1117,13 @@
icon_state = "service"
build_path = /obj/machinery/rnd/production/techfab/department/service
+/obj/item/circuitboard/machine/vendatray
+ name = "Vend-A-Tray (Machine Board)"
+ icon_state = "service"
+ build_path = /obj/structure/displaycase/forsale
+ req_components = list(
+ /obj/item/stock_parts/card_reader = 1)
+
//Supply
/obj/item/circuitboard/machine/mining_equipment_vendor
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 5cb23a757f3..55adb23602b 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -370,7 +370,7 @@
desc = "A display case with an ID-card swiper. Use your ID to purchase the contents."
density = FALSE
max_integrity = 100
- req_access = list(ACCESS_KITCHEN)
+ req_access = null
showpiece_type = /obj/item/reagent_containers/food
alert = FALSE //No, we're not calling the fire department because someone stole your cookie.
glass_fix = FALSE //Fixable with tools instead.
@@ -378,6 +378,8 @@
var/sale_price = 20
///The Account which will receive payment for purchases. Set by the first ID to swipe the tray.
var/datum/bank_account/payments_acc = null
+ ///We're using the same trick as paper does in order to cache the image, and only load the UI when messed with.
+ var/list/viewing_ui = list()
/obj/structure/displaycase/forsale/update_icon() //remind me to fix my shitcode later
var/icon/I
@@ -396,6 +398,109 @@
src.icon = I
return
+/obj/structure/displaycase/forsale/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
+ . = ..()
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "Vendatray", name, 300, 270, master_ui, state)
+ ui.set_autoupdate(FALSE)
+ viewing_ui[user] = ui
+ ui.open()
+
+/obj/structure/displaycase/forsale/ui_data(mob/user)
+ var/list/data = list()
+ var/register = FALSE
+ if(payments_acc)
+ register = TRUE
+ data["owner_name"] = payments_acc.account_holder
+ if(showpiece)
+ data["product_name"] = capitalize(showpiece.name)
+ var/base64 = icon2base64(icon(showpiece.icon, showpiece.icon_state))
+ data["product_icon"] = base64
+ data["registered"] = register
+ data["product_cost"] = sale_price
+ data["tray_open"] = open
+ return data
+
+/obj/structure/displaycase/forsale/ui_act(action, params)
+ if(..())
+ return
+ var/obj/item/card/id/potential_acc = usr.get_idcard(hand_first = TRUE)
+ switch(action)
+ if("Buy")
+ if(!showpiece)
+ to_chat(usr, "There's nothing for sale.")
+ return TRUE
+ if(broken)
+ to_chat(usr, "[src] appears to be broken.")
+ return TRUE
+ if(!payments_acc)
+ to_chat(usr, "[src] hasn't been registered yet.")
+ return TRUE
+ if(!usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
+ return TRUE
+ if(!potential_acc)
+ to_chat(usr, "No ID card detected.")
+ return
+ var/datum/bank_account/account = potential_acc.registered_account
+ if(!account)
+ to_chat(usr, "[potential_acc] has no account registered!")
+ return
+ if(!account.has_money(sale_price))
+ to_chat(usr, "You do not possess the funds to purchase this.")
+ return TRUE
+ else
+ account.adjust_money(-sale_price)
+ if(payments_acc)
+ payments_acc.adjust_money(sale_price)
+ usr.put_in_hands(showpiece)
+ to_chat(usr, "You purchase [showpiece] for [sale_price] credits.")
+ playsound(src, 'sound/effects/cashregister.ogg', 40, TRUE)
+ icon = 'icons/obj/stationobjs.dmi'
+ flick("laserbox_vend", src)
+ showpiece = null
+ update_icon()
+ SStgui.update_uis(src)
+ return TRUE
+ if("Open")
+ if(!payments_acc)
+ to_chat(usr, "[src] hasn't been registered yet.")
+ return TRUE
+ if(!potential_acc || !potential_acc.registered_account)
+ return
+ if(!check_access(potential_acc))
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
+ return
+ toggle_lock()
+ SStgui.update_uis(src)
+ if("Register")
+ if(payments_acc)
+ return
+ if(!potential_acc || !potential_acc.registered_account)
+ return
+ if(!check_access(potential_acc))
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
+ return
+ payments_acc = potential_acc.registered_account
+ playsound(src, 'sound/machines/click.ogg', 20, TRUE)
+ if("Adjust")
+ if(!check_access(potential_acc) || potential_acc.registered_account != payments_acc)
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
+ return
+
+ var/new_price_input = input(usr,"Set the sale price for this vend-a-tray.","new price",0) as num|null
+ if(isnull(new_price_input) || (payments_acc != potential_acc.registered_account))
+ to_chat(usr, "[src] rejects your new price.")
+ return
+ if(!usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) )
+ to_chat(usr, "You need to get closer!")
+ return
+ new_price_input = clamp(round(new_price_input, 1), 10, 1000)
+ sale_price = new_price_input
+ to_chat(usr, "The cost is now set to [sale_price].")
+ SStgui.update_uis(src)
+ return TRUE
+ . = TRUE
/obj/structure/displaycase/forsale/attackby(obj/item/I, mob/living/user, params)
if(isidcard(I))
//Card Registration
@@ -403,57 +508,29 @@
if(!potential_acc.registered_account)
to_chat(user, "This ID card has no account registered!")
return
- if(!payments_acc && potential_acc.registered_account)
- payments_acc = potential_acc.registered_account
+ if(payments_acc == potential_acc.registered_account)
playsound(src, 'sound/machines/click.ogg', 20, TRUE)
- to_chat(user, "Vend-a-tray registered. Use your ID on grab intent to change the sale price, or disarm intent to open the tray.")
+ toggle_lock()
return
- //Buying the contained item with the ID.
- switch(user.a_intent)
- if(INTENT_HELP)
- if(!showpiece)
- to_chat(user, "There's nothing for sale.")
- return TRUE
- if(broken)
- to_chat(user, "[src] appears to be broken.")
- return TRUE
- var/confirm = alert(user, "Purchase [showpiece] for [sale_price]?", "Purchase?", "Confirm", "Cancel")
- if(confirm == "Cancel" || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
- return TRUE
- var/datum/bank_account/account = potential_acc.registered_account
- if(!account.has_money(sale_price))
- to_chat(user, "You do not possess the funds to purchase this.")
- return TRUE
- else
- account.adjust_money(-sale_price)
- if(payments_acc)
- payments_acc.adjust_money(sale_price)
- user.put_in_hands(showpiece)
- to_chat(user, "You purchase [showpiece] for [sale_price] credits.")
- playsound(src, 'sound/effects/cashregister.ogg', 40, TRUE)
- icon = 'icons/obj/stationobjs.dmi'
- flick("laserbox_vend", src)
- showpiece = null
- update_icon()
- return TRUE
- //Setting the object's price.
- if(INTENT_GRAB)
- var/new_price_input = input(user,"Set the sale price for this vend-a-tray.","new price",0) as num|null
- if(isnull(new_price_input) || (payments_acc != potential_acc.registered_account))
- to_chat(user, "The vend-a-tray rejects your new price.")
- return
- if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) )
- to_chat(user, "You need to get closer!")
- return
- new_price_input = clamp(round(new_price_input, 1), 10, 1000)
- sale_price = new_price_input
- to_chat(user, "The cost is now set to [sale_price].")
- return TRUE
- if(INTENT_DISARM || INTENT_HARM)
- if(payments_acc && payments_acc != potential_acc.registered_account)
- to_chat(user, "This Vend-a-tray is already registered!")
- return
- if(I.tool_behaviour == TOOL_WRENCH && open && user.a_intent == INTENT_HELP )
+ if(istype(I, /obj/item/pda))
+ return TRUE
+ SStgui.update_uis(src)
+ . = ..()
+
+
+/obj/structure/displaycase/forsale/multitool_act(mob/living/user, obj/item/I)
+ . = ..()
+ if(obj_integrity <= (integrity_failure * max_integrity))
+ to_chat(user, "You start recalibrating [src]'s hover field...")
+ if(do_after(user, 20, target = src))
+ broken = 0
+ obj_integrity = max_integrity
+ update_icon()
+ return TRUE
+
+/obj/structure/displaycase/forsale/wrench_act(mob/living/user, obj/item/I)
+ . = ..()
+ if(open && user.a_intent == INTENT_HELP )
if(anchored)
to_chat(user, "You start unsecuring [src]...")
else
@@ -467,22 +544,9 @@
to_chat(user, "You secure [src].")
anchored = !anchored
return
- else if(I.tool_behaviour == TOOL_WRENCH && !open && user.a_intent == INTENT_HELP)
+ else if(!open && user.a_intent == INTENT_HELP)
to_chat(user, "[src] must be open to move it.")
return
- if(istype(I, /obj/item/pda))
- return TRUE
- . = ..()
-
-/obj/structure/displaycase/forsale/multitool_act(mob/living/user, obj/item/I)
- . = ..()
- if(obj_integrity <= (integrity_failure * max_integrity))
- to_chat(user, "You start recalibrating [src]'s hover field...")
- if(do_after(user, 20, target = src))
- broken = 0
- obj_integrity = max_integrity
- update_icon()
- return TRUE
/obj/structure/displaycase/forsale/emag_act(mob/user)
. = ..()
@@ -503,3 +567,7 @@
playsound(src, "shatter", 70, TRUE)
update_icon()
trigger_alarm() //In case it's given an alarm anyway.
+
+/obj/structure/displaycase/forsale/kitchen
+ desc = "A display case with an ID-card swiper. Use your ID to purchase the contents. Meant for the bartender and chef."
+ req_access = list(ACCESS_KITCHEN)
diff --git a/tgui/packages/tgui/interfaces/Vendatray.js b/tgui/packages/tgui/interfaces/Vendatray.js
new file mode 100644
index 00000000000..fbf2cc9a3e6
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/Vendatray.js
@@ -0,0 +1,97 @@
+import { useBackend } from '../backend';
+import { Fragment } from 'inferno';
+import { Button, LabeledList, Section, Flex, Box } from '../components';
+import { Window } from '../layouts';
+import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox';
+
+export const Vendatray = (props, context) => {
+ const { act, data } = useBackend(context);
+ const locked = data.locked && !data.siliconUser;
+ const {
+ product_name,
+ product_cost,
+ tray_open,
+ registered,
+ owner_name,
+ } = data;
+ return (
+ "+e+"
/gi,"\n").replace(/<\/?[a-z0-9-_]+[^>]*>/gi,"").replace(/&(nbsp|amp|quot|lt|gt|apos);/g,(function(e,n){return t[n]})).replace(/?([0-9]+);/gi,(function(e,t){var n=parseInt(t,10);return String.fromCharCode(n)})).replace(/?([0-9a-f]+);/gi,(function(e,t){var n=parseInt(t,16);return String.fromCharCode(n)}))};t.buildQueryString=function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}},function(e,t,n){"use strict";var o=n(53),r=n(62),a=n(16),i=n(12),c=n(68),l=[].push,d=function(e){var t=1==e,n=2==e,d=3==e,u=4==e,s=6==e,p=5==e||s;return function(m,f,h,C){for(var g,b,N=a(m),v=r(N),V=o(f,h,3),y=i(v.length),k=0,x=C||c,_=t?x(m,y):n?x(m,0):undefined;y>k;k++)if((p||k in v)&&(b=V(g=v[k],k,N),e))if(t)_[k]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return k;case 2:l.call(_,g)}else if(u)return!1;return s?-1:d||u?u:_}};e.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6)}},function(e,t,n){"use strict";var o=n(9),r=n(74),a=n(51),i=n(27),c=n(35),l=n(19),d=n(128),u=Object.getOwnPropertyDescriptor;t.f=o?u:function(e,t){if(e=i(e),t=c(t,!0),d)try{return u(e,t)}catch(n){}if(l(e,t))return a(!r.f.call(e,t),e[t])}},function(e,t,n){"use strict";e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";var o=n(7),r=n(31),a=n(19),i=n(91),c=n(92),l=n(36),d=l.get,u=l.enforce,s=String(String).split("String");(e.exports=function(e,t,n,c){var l=!!c&&!!c.unsafe,d=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||r(n,"name",t),u(n).source=s.join("string"==typeof t?t:"")),e!==o?(l?!p&&e[t]&&(d=!0):delete e[t],d?e[t]=n:r(e,t,n)):d?e[t]=n:i(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&d(this).source||c(this)}))},function(e,t,n){"use strict";var o=n(9),r=n(5),a=n(19),i=Object.defineProperty,c={},l=function(e){throw e};e.exports=function(e,t){if(a(c,e))return c[e];t||(t={});var n=[][e],d=!!a(t,"ACCESSORS")&&t.ACCESSORS,u=a(t,0)?t[0]:l,s=a(t,1)?t[1]:undefined;return c[e]=!!n&&!r((function(){if(d&&!o)return!0;var e={length:-1};d?i(e,1,{enumerable:!0,get:l}):e[1]=1,n.call(e,u,s)}))}},function(e,t,n){"use strict";function o(e,t,n,o,r,a,i){try{var c=e[a](i),l=c.value}catch(d){return void n(d)}c.done?t(l):Promise.resolve(l).then(o,r)}t.__esModule=!0,t.winset=t.winget=t.runCommand=t.callByondAsync=t.callByond=t.IS_IE8=void 0;var r=window.Byond,a=function(){var e=navigator.userAgent.match(/Trident\/(\d+).+?;/i);if(!e)return null;var t=e[1];return t?parseInt(t,10):null}(),i=null!==a&&a<=6;t.IS_IE8=i;var c=function(e,t){void 0===t&&(t={}),r.call(e,t)};t.callByond=c;var l=function(e,t){void 0===t&&(t={}),window.__callbacks__=window.__callbacks__||[];var n=window.__callbacks__.length,o=new Promise((function(e){window.__callbacks__.push(e)}));return r.call(e,Object.assign(Object.assign({},t),{},{callback:"__callbacks__["+n+"]"})),o};t.callByondAsync=l;t.runCommand=function(e){return c("winset",{command:e})};var d=function(){var e,t=(e=regeneratorRuntime.mark((function n(e,t){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l("winget",{id:e,property:t});case 2:return o=n.sent,n.abrupt("return",o[t]);case 4:case"end":return n.stop()}}),n)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function c(e){o(i,r,a,c,l,"next",e)}function l(e){o(i,r,a,c,l,"throw",e)}c(undefined)}))});return function(e,n){return t.apply(this,arguments)}}();t.winget=d;t.winset=function(e,t,n){var o;return c("winset",((o={})[e+"."+t]=n,o))}},function(e,t,n){"use strict";var o=n(62),r=n(23);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var o=n(132),r=n(19),a=n(138),i=n(14).f;e.exports=function(e){var t=o.Symbol||(o.Symbol={});r(t,e)||i(t,e,{value:a.f(e)})}},function(e,t,n){"use strict";var o=n(23),r=/"/g;e.exports=function(e,t,n,a){var i=String(o(e)),c="<"+t;return""!==n&&(c+=" "+n+'="'+String(a).replace(r,""")+'"'),c+">"+i+""+t+">"}},function(e,t,n){"use strict";var o=n(5);e.exports=function(e){return o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},function(e,t,n){"use strict";var o=n(9),r=n(14),a=n(51);e.exports=o?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var o=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:o)(e)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){"use strict";var o={}.toString;e.exports=function(e){return o.call(e).slice(8,-1)}},function(e,t,n){"use strict";var o=n(8);e.exports=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var o,r,a,i=n(130),c=n(7),l=n(8),d=n(31),u=n(19),s=n(75),p=n(64),m=c.WeakMap;if(i){var f=new m,h=f.get,C=f.has,g=f.set;o=function(e,t){return g.call(f,e,t),t},r=function(e){return h.call(f,e)||{}},a=function(e){return C.call(f,e)}}else{var b=s("state");p[b]=!0,o=function(e,t){return d(e,b,t),t},r=function(e){return u(e,b)?e[b]:{}},a=function(e){return u(e,b)}}e.exports={set:o,get:r,has:a,enforce:function(e){return a(e)?r(e):o(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){"use strict";var o=n(19),r=n(16),a=n(75),i=n(104),c=a("IE_PROTO"),l=Object.prototype;e.exports=i?Object.getPrototypeOf:function(e){return e=r(e),o(e,c)?e[c]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,n){"use strict";t.__esModule=!0,t.getGasColor=t.getGasLabel=t.RADIO_CHANNELS=t.CSS_COLORS=t.COLORS=t.UI_CLOSE=t.UI_DISABLED=t.UI_UPDATE=t.UI_INTERACTIVE=void 0;t.UI_INTERACTIVE=2;t.UI_UPDATE=1;t.UI_DISABLED=0;t.UI_CLOSE=-1;t.COLORS={department:{captain:"#c06616",security:"#e74c3c",medbay:"#3498db",science:"#9b59b6",engineering:"#f1c40f",cargo:"#f39c12",centcom:"#00c100",other:"#c38312"},damageType:{oxy:"#3498db",toxin:"#2ecc71",burn:"#e67e22",brute:"#e74c3c"}};t.CSS_COLORS=["black","white","red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","good","average","bad","label"];t.RADIO_CHANNELS=[{name:"Syndicate",freq:1213,color:"#a52a2a"},{name:"Red Team",freq:1215,color:"#ff4444"},{name:"Blue Team",freq:1217,color:"#3434fd"},{name:"CentCom",freq:1337,color:"#2681a5"},{name:"Supply",freq:1347,color:"#b88646"},{name:"Service",freq:1349,color:"#6ca729"},{name:"Science",freq:1351,color:"#c68cfa"},{name:"Command",freq:1353,color:"#5177ff"},{name:"Medical",freq:1355,color:"#57b8f0"},{name:"Engineering",freq:1357,color:"#f37746"},{name:"Security",freq:1359,color:"#dd3535"},{name:"AI Private",freq:1447,color:"#d65d95"},{name:"Common",freq:1459,color:"#1ecc43"}];var o=[{id:"o2",name:"Oxygen",label:"O\u2082",color:"blue"},{id:"n2",name:"Nitrogen",label:"N\u2082",color:"red"},{id:"co2",name:"Carbon Dioxide",label:"CO\u2082",color:"grey"},{id:"plasma",name:"Plasma",label:"Plasma",color:"pink"},{id:"water_vapor",name:"Water Vapor",label:"H\u2082O",color:"grey"},{id:"nob",name:"Hyper-noblium",label:"Hyper-nob",color:"teal"},{id:"n2o",name:"Nitrous Oxide",label:"N\u2082O",color:"red"},{id:"no2",name:"Nitryl",label:"NO\u2082",color:"brown"},{id:"tritium",name:"Tritium",label:"Tritium",color:"green"},{id:"bz",name:"BZ",label:"BZ",color:"purple"},{id:"stim",name:"Stimulum",label:"Stimulum",color:"purple"},{id:"pluox",name:"Pluoxium",label:"Pluoxium",color:"blue"},{id:"miasma",name:"Miasma",label:"Miasma",color:"olive"},{id:"hydrogen",name:"Hydrogen",label:"H\u2082",color:"white"}];t.getGasLabel=function(e,t){var n=String(e).toLowerCase(),r=o.find((function(e){return e.id===n||e.name.toLowerCase()===n}));return r&&r.label||t||e};t.getGasColor=function(e){var t=String(e).toLowerCase(),n=o.find((function(e){return e.id===t||e.name.toLowerCase()===t}));return n&&n.color}},function(e,t,n){"use strict";function o(e){var t=0;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n0;for(var c in i&&(a=Ce(n))&&he(t,o,n),n)_e(c,null,n[c],o,r,a,null);i&&fe(t,e,o,n,!0,a)}function Be(e,t,n){var o=O(e.render(t,e.state,n)),r=n;return c(e.getChildContext)&&(r=u(n,e.getChildContext())),e.$CX=r,o}function Le(e,t,n,o,r,a){var i=new t(n,o),l=i.$N=Boolean(t.getDerivedStateFromProps||i.getSnapshotBeforeUpdate);if(i.$SVG=r,i.$L=a,e.children=i,i.$BS=!1,i.context=o,i.props===p&&(i.props=n),l)i.state=y(i,n,i.state);else if(c(i.componentWillMount)){i.$BR=!0,i.componentWillMount();var u=i.$PS;if(!d(u)){var s=i.state;if(d(s))i.state=u;else for(var m in u)s[m]=u[m];i.$PS=null}i.$BR=!1}return i.$LI=Be(i,n,o),i}function Se(e,t,n,o,r,a){var i=e.flags|=16384;481&i?Te(e,t,n,o,r,a):4&i?function(e,t,n,o,r,a){var i=Le(e,e.type,e.props||p,n,o,a);Se(i.$LI,t,i.$CX,o,r,a),Ee(e.ref,i,a)}(e,t,n,o,r,a):8&i?(!function(e,t,n,o,r,a){Se(e.children=O(function(e,t){return 32768&e.flags?e.type.render(e.props||p,e.ref,t):e.type(e.props||p,t)}(e,n)),t,n,o,r,a)}(e,t,n,o,r,a),Me(e,a)):512&i||16&i?Ie(e,t,r):8192&i?function(e,t,n,o,r,a){var i=e.children,c=e.childFlags;12&c&&0===i.length&&(c=e.childFlags=2,i=e.children=M());2===c?Se(i,n,r,o,r,a):Ae(i,n,t,o,r,a)}(e,n,t,o,r,a):1024&i&&function(e,t,n,o,r){Se(e.children,e.ref,t,!1,null,r);var a=M();Ie(a,n,o),e.dom=a.dom}(e,n,t,r,a)}function Ie(e,t,n){var o=e.dom=document.createTextNode(e.children);d(t)||h(t,o,n)}function Te(e,t,n,o,r,i){var c=e.flags,l=e.props,u=e.className,s=e.children,p=e.childFlags,m=e.dom=function(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}(e.type,o=o||(32&c)>0);if(a(u)||""===u||(o?m.setAttribute("class",u):m.className=u),16===p)_(m,s);else if(1!==p){var f=o&&"foreignObject"!==e.type;2===p?(16384&s.flags&&(e.children=s=E(s)),Se(s,m,n,f,null,i)):8!==p&&4!==p||Ae(s,m,n,f,null,i)}d(t)||h(t,m,r),d(l)||we(e,c,l,m,o),be(e.ref,m,i)}function Ae(e,t,n,o,r,a){for(var i=0;ii)for(p=s;p=0;--r){var a=this.tryEntries[r],i=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev'+(n?e:H(e,!0))+"\n":"
\n"},t.blockquote=function(e){return""+(n?e:H(e,!0))+"\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,o){return this.options.headerIds?"
\n":"
\n"},t.list=function(e,t,n){var o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+""+o+">\n"},t.listitem=function(e){return"\n\n"+e+"\n"+t+"
\n"},t.tablerow=function(e){return"\n"+e+" \n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+""+n+">\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
":"
"},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=W(this.options.sanitize,this.options.baseUrl,e)))return n;var o='"+n+""},t.image=function(e,t,n){if(null===(e=W(this.options.sanitize,this.options.baseUrl,e)))return n;var o='":">"},t.text=function(e){return e},e}(),G=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),K=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),q=o.defaults,$=V.unescape,Y=function(){function e(e){this.options=e||q,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new G,this.slugger=new K}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,o,r,a,i,c,l,d,u,s,p,m,f,h,C,g,b,N,v="",V=e.length;for(n=0;n
"+Z(l.message+"",!0)+"";throw l}}return ne.options=ne.setOptions=function(e){return X(ne.defaults,e),ee(ne.defaults),ne},ne.getDefaults=J,ne.defaults=te,ne.use=function(e){var t=X({},e);if(e.renderer&&function(){var n=ne.defaults.renderer||new U,o=function(t){var o=n[t];n[t]=function(){for(var r=arguments.length,a=new Array(r),i=0;i
'+(n?e:H(e,!0))+"\n":""+(n?e:H(e,!0))+"\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,n,o){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return t&&(t=""+t+""),""+e+""},t.br=function(){return this.options.xhtml?""+Z(l.message+"",!0)+"";throw l}}return ne.options=ne.setOptions=function(e){return X(ne.defaults,e),ee(ne.defaults),ne},ne.getDefaults=J,ne.defaults=te,ne.use=function(e){var t=X({},e);if(e.renderer&&function(){var n=ne.defaults.renderer||new U,o=function(t){var o=n[t];n[t]=function(){for(var r=arguments.length,a=new Array(r),i=0;i