From e570aa56db624fa9d7c83cf3f9638723e92306b5 Mon Sep 17 00:00:00 2001 From: chrisinajar Date: Tue, 6 Aug 2024 20:28:37 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20chrisina?= =?UTF-8?q?jar/proofofcombat@cc3e69c9fc74b8debfdff158efc27b3a6f250a4c=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 4 ++-- _next/static/5ceJlVAP-l5bYBLRUoScy/_buildManifest.js | 1 - .../{536-049947d5383b6ea7.js => 536-85f336bb0ca7d953.js} | 2 +- _next/static/nV971nPxM4f1akqkY9Rtx/_buildManifest.js | 1 + .../_middlewareManifest.js | 0 .../_ssgManifest.js | 0 index.html | 2 +- map.html | 2 +- play.html | 2 +- play/admin.html | 2 +- play/combat.html | 2 +- play/inventory.html | 2 +- play/map.html | 2 +- play/quests.html | 2 +- play/settings.html | 2 +- play/shop.html | 2 +- 16 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 _next/static/5ceJlVAP-l5bYBLRUoScy/_buildManifest.js rename _next/static/chunks/{536-049947d5383b6ea7.js => 536-85f336bb0ca7d953.js} (98%) create mode 100644 _next/static/nV971nPxM4f1akqkY9Rtx/_buildManifest.js rename _next/static/{5ceJlVAP-l5bYBLRUoScy => nV971nPxM4f1akqkY9Rtx}/_middlewareManifest.js (100%) rename _next/static/{5ceJlVAP-l5bYBLRUoScy => nV971nPxM4f1akqkY9Rtx}/_ssgManifest.js (100%) diff --git a/404.html b/404.html index 6a7f541..eb44563 100644 --- a/404.html +++ b/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/5ceJlVAP-l5bYBLRUoScy/_buildManifest.js b/_next/static/5ceJlVAP-l5bYBLRUoScy/_buildManifest.js deleted file mode 100644 index b0f7fb8..0000000 --- a/_next/static/5ceJlVAP-l5bYBLRUoScy/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST=function(a,s,c,t,e){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,s,c,"static/chunks/pages/index-86b6ad0225ab5fd5.js"],"/_error":["static/chunks/pages/_error-0a004b8b8498208d.js"],"/map":[a,"static/chunks/pages/map-e29aa493b081ff8b.js"],"/play":[a,s,t,c,e,"static/chunks/pages/play-3f3e10b32e0d5239.js"],"/play/admin":[a,s,t,c,e,"static/chunks/pages/play/admin-3dd5b720cd1cc776.js"],"/play/combat":[a,s,t,c,e,"static/chunks/pages/play/combat-079cee989a4e5acf.js"],"/play/inventory":[a,s,t,c,e,"static/chunks/pages/play/inventory-fa262c1619ef4b57.js"],"/play/map":[a,s,t,c,e,"static/chunks/pages/play/map-0c334b7cc27fb3b8.js"],"/play/quests":[a,s,t,c,e,"static/chunks/pages/play/quests-94d8bf8f1b358105.js"],"/play/settings":[a,s,t,c,e,"static/chunks/pages/play/settings-850fe9a55081b6f4.js"],"/play/shop":[a,s,t,c,e,"static/chunks/pages/play/shop-e6c188525f8253ce.js"],sortedPages:["/","/_app","/_error","/map","/play","/play/admin","/play/combat","/play/inventory","/play/map","/play/quests","/play/settings","/play/shop"]}}("static/chunks/806-f6f4d391dc92d342.js","static/chunks/432-45e5c3f10246e293.js","static/chunks/998-2ab40a18050e2ffe.js","static/chunks/688-20c0f4d0ce5a4a1f.js","static/chunks/536-049947d5383b6ea7.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/chunks/536-049947d5383b6ea7.js b/_next/static/chunks/536-85f336bb0ca7d953.js similarity index 98% rename from _next/static/chunks/536-049947d5383b6ea7.js rename to _next/static/chunks/536-85f336bb0ca7d953.js index 441784d..5c39101 100644 --- a/_next/static/chunks/536-049947d5383b6ea7.js +++ b/_next/static/chunks/536-85f336bb0ca7d953.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{7536:function(e,n,t){t.d(n,{Z:function(){return pi}});var r=t(5893),i=t(7294),o=t(1163),a=t(5152),l=t.n(a),s=t(5616),c=t(7720),u=t(1458),d=t(44),h=t(5861),m=t(6886),f=t(9200),v=t(4373),x=t(5670),p=t(5511),g=t(5023),y=t(375),b=t(7998),j=t(4051),Z=t.n(j),S=t(3920),w=t(8445),k=t(5739),A=t(9496),P=t(5662),C=t(7109),I=t(3946),L=t(4054),E=t(3841),O=t(7058),F=t(1292),T=t(6664),M=t(6824),W=t(622),G=t(4510),q=t(7952);function D(){var e,n,t,r=(0,q.UE)({fetchPolicy:"cache-only"}).data;return null!==(t=null===r||void 0===r||null===(e=r.me)||void 0===e||null===(n=e.account)||void 0===n?void 0:n.hero)&&void 0!==t?t:void 0}var B=t(9238),$=t(5018),z=t(3599),R=t(1903);function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Received offers:",(0,r.jsx)(s.Z,{children:F.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["From: ",(0,r.jsx)("b",{children:e.fromName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"success",disabled:I||e.gold>o.gold,onClick:function(){return function(e){return Q.apply(this,arguments)}(e.id)},children:"Accept Trade"}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"error",disabled:I,onClick:function(){return D(e.id)},children:"Reject Trade"})]})},e.id)}))})]}),T.length>0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Sent offers:",(0,r.jsx)(s.Z,{children:T.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["To: ",(0,r.jsx)("b",{children:e.toName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{variant:"contained",color:"error",disabled:I,onClick:function(){return D(e.id)},children:"Cancel Trade"})]})},e.id)}))})]})]})]})}function Y(e){var n=e.artifact,t=e.title,o=e.affixes,a=e.sx,l=e.children;if(!n||!t)return null;var s=(0,B.Vy)(n),c=function(e,n){return(0,r.jsx)(h.Z,{variant:"body1",sx:a,children:(0,r.jsx)("b",{children:e})},n)};return"function"===typeof l&&(c=l),(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:t}),s.map((function(e){return o&&!o.includes(e.type)?null:c((0,B.xq)(e),e.type)}))]})}function K(e){var n=e.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h4",children:n.name}),"A mysterious magical item with the following properties:",(0,r.jsx)(Y,{artifact:n})]})}function V(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t200&&$(j.slice(0,200))}),[j.length]),(0,i.useEffect)((function(){var e;if(!ce.current&&(null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token)){var n={drop:"error",artifact:"warning",quest:"success",settlement:"info"};return ce.current=(0,S.io)(te,{withCredentials:!0,auth:{token:m.chat.token}}),ce.current.on("hello",(function(e){$(e.chat)})),ce.current.on("chat",(function(e){console.log("Got chat event!",e),$((function(n){return[e].concat(ne(n))}))})),ce.current.on("notification",(function(e){var t,r;e.item&&(e.message=e.message.replace("{{item}}",(0,B.GJ)(e.item))),"drop"===e.type||"artifact"===e.type?e.item?c("You found ".concat((0,B.GJ)(e.item)),{variant:"success"}):e.artifactItem?(c("You found ".concat(e.artifactItem.name),{variant:"success"}),se(e.artifactItem)):c(e.message,{variant:"success"}):"settlement"!==e.type&&c(e.message,{variant:"info"}),$((function(i){return[{type:null!==(t=e.type)&&void 0!==t?t:"notification",id:Math.random(),time:Date.now()/1e3,message:"",from:e.message,color:null!==(r=n[e.type])&&void 0!==r?r:"secondary",variant:"body1"}].concat(ne(i))}))})),ce.current.on("system-message",(function(e){c(e.message,{variant:"warning"}),$((function(n){return[{type:"system",id:Math.random(),time:Date.now()/1e3,message:e.message,from:"",color:e.color,variant:"h6"}].concat(ne(n))}))})),function(){ce.current&&(ce.current.disconnect(),ce.current=void 0)}}}),[null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token]);var ue=a(H);function de(){return he.apply(this,arguments)}function he(){return(he=X(Z().mark((function e(){var n;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ce.current){e.next=2;break}return e.abrupt("return");case 2:if("private"!==(n=ie[V]).type){e.next=7;break}return ce.current.emit("private-chat",{to:n.heroId,message:H},(function(e){console.log("Got a confirmation!",e),$((function(n){return[e].concat(ne(n))}))})),U(""),e.abrupt("return");case 7:ce.current.emit("chat",{message:H},(function(e){console.log("Got a reply!",e),$((function(n){return[e].concat(ne(n))}))})),U("");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me,fe=j.filter((function(e){if("all"===V)return!0;if("chat"===V)return"chat"===e.type||"private"===e.type||"system"===e.type;if("notifications"===V)return"notification"===e.type||"drop"===e.type||"quest"===e.type||"system"===e.type;var n=ie[V];return!n||"private"===n.type&&("private"===e.type&&(e.heroId===n.heroId||e.to===n.heroId))})),ve=R?"Max message: ".concat(140-ue.length,"/").concat(140):"Type here...";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(T.Z,{open:!(null===u||void 0===u?void 0:u.currentQuest)&&!!le,onClose:function(){return se(!1)},children:(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},children:le&&(0,r.jsx)(K,{artifact:le})})}),(0,r.jsx)(x.ZP,{value:V,children:(0,r.jsx)(p.Z,{onChange:function(e,n){v&&g(!1),_(n)},"aria-label":"navigation tabs",variant:"scrollable",children:Object.keys(ie).map((function(e){return(0,r.jsx)(d.Z,{label:e,value:e},e)}))})}),"notifications"!==V&&(0,r.jsxs)(L.Z,{sx:{marginTop:1},fullWidth:!0,variant:"outlined",children:[(0,r.jsx)(E.Z,{htmlFor:"chat-input",children:ve}),(0,r.jsx)(O.Z,{disabled:!(null===(n=ce.current)||void 0===n?void 0:n.connected),value:H,id:"chat-input",name:"Chat input",label:ve,placeholder:"Type here...",onChange:function(e){var n=e.target.value;a(n).length<=140&&U(n)},onFocus:function(){return N(!0)},onBlur:function(){return N(!1)},autoComplete:"off",onKeyPress:function(e){"Enter"!==e.key||de()},endAdornment:(0,r.jsxs)(C.Z,{position:"end",children:[(0,r.jsx)(F.Z,{title:"Send message",children:(0,r.jsx)(I.Z,{"aria-label":"send chat",onClick:de,children:(0,r.jsx)(M.Z,{})})}),"private"===(null===(t=ie[V])||void 0===t?void 0:t.type)&&(0,r.jsx)(F.Z,{title:v?"Cancel trade":"Trade with player",children:(0,r.jsxs)(I.Z,{onClick:function(){return g(!v)},children:[v&&(0,r.jsx)(G.Z,{}),!v&&(0,r.jsx)(W.Z,{})]})})]})})]}),v&&u&&(null===(o=ie[V])||void 0===o?void 0:o.heroId)&&(0,r.jsx)(J,{hero:u,to:null!==(me=ie[V].heroId)&&void 0!==me?me:""}),(0,r.jsx)(s.Z,{sx:{padding:1,minHeight:"600px",bgcolor:"background.paper"},children:fe.map((function(e){return(0,r.jsxs)(h.Z,{variant:e.variant||"body1",sx:{color:"".concat("private"===e.type?"secondary":e.color||"text",".main")},children:[e.time&&(0,r.jsxs)(h.Z,{variant:"caption","aria-hidden":"true",children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]}),e.heroId&&(0,r.jsx)(P.Z,{onClick:function(){e.heroId&&l(e.from,e.heroId)},sx:{color:"inherit",textTransform:"none",paddingTop:0,paddingBottom:0,paddingLeft:1,paddingRight:.5,margin:0},children:(0,r.jsxs)("b",{children:[e.from,":"]})}),!e.heroId&&(0,r.jsx)("b",{children:e.from})," ",(0,w.emojify)(e.message)," ",e.time&&(0,r.jsxs)(h.Z,{variant:"caption",sx:y.Z,children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]})]},e.id)}))}),(0,r.jsx)("br",{})]})}var ie=t(1409),oe=t(737);function ae(){var e,n=D(),t=(0,q.W1)({variables:(null===n||void 0===n?void 0:n.location)?{location:{x:n.location.x,y:n.location.y,map:n.location.map}}:void 0,skip:!(null===n||void 0===n?void 0:n.location)}).data;return null!==(e=null===t||void 0===t?void 0:t.locationDetails)&&void 0!==e?e:null}function le(){var e=ae(),n=(null===e||void 0===e?void 0:e.specialLocations)||[];return n.length?n[0]:null}var se,ce=t(2734),ue=t(6012),de=t(5499),he=t(8698),me=t(7600),fe=t(5826);function ve(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var xe,pe=(ve(se={},q.zP.Fire,"Fireball"),ve(se,q.zP.Ice,"Blizzard"),ve(se,q.zP.Lightning,"Lightning Bolt"),se),ge=(ve(xe={},q.zP.Normal,"Normal stance with no pros or cons."),ve(xe,q.zP.Reckless,"Double accuracy but makes you twice as easy to hit."),ve(xe,q.zP.Fire,"Converts 20% of magic damage into Fire damage."),ve(xe,q.zP.Ice,"Converts 20% of magic damage into Ice damage."),ve(xe,q.zP.Lightning,"Converts 20% of magic damage into Lightning damage."),xe);function ye(e){var n,t=D(),o=(0,i.useState)((null===t||void 0===t?void 0:t.activeStance)||q.zP.Normal),a=o[0],l=o[1];if(!t)return null;var s=t.availableStances.map((function(e){return{name:null!==(n=pe[e])&&void 0!==n?n:e,stance:e,tooltip:ge[e]}}));return s.length<2?null:(0,r.jsx)(m.ZP,{item:!0,xs:12,children:(0,r.jsxs)(m.ZP,{container:!0,sx:{textAlign:"center"},columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h5",children:"Select Combat Style"})}),s.map((function(n){return(0,r.jsx)(m.ZP,{item:!0,lg:1,md:2,sm:3,xs:6,children:(0,r.jsx)(F.Z,{title:n.tooltip,children:(0,r.jsx)(P.Z,{variant:a===n.name?"outlined":"text",sx:{fontSize:"1rem",padding:2},size:"large",id:"set-stance-".concat(n.name.toLowerCase()),onClick:function(){return function(n){l(n),e.onChange&&e.onChange(n)}(n.stance)},"aria-label":"set stance ".concat(n.name),children:n.name})})},n.name)}))]})})}function be(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(l?"Auto-Battling":"Battling"),D<=0&&"Dead"," ",f.name]}),(0,r.jsx)(u.Z,{variant:"determinate",value:D,color:"error"})]}),D>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your melee weapons, uses strength and dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-melee",onClick:function(){return _(q.hK.Melee)},"aria-label":"melee attack",startIcon:(0,r.jsx)(ue.Z,{}),children:"Melee attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your ranged weapons, uses dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-ranged",onClick:function(){return _(q.hK.Ranged)},"aria-label":"ranged attack",startIcon:(0,r.jsx)(de.Z,{}),children:"Ranged attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Cast spells using your wisdom and intelligence",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-cast",onClick:function(){return _(q.hK.Cast)},"aria-label":"cast spell",startIcon:(0,r.jsx)(he.Z,{}),children:"Cast Spell"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Smite your foe using wisdom and willpower",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-holy",onClick:function(){return _(q.hK.Smite)},"aria-label":"holy attack",startIcon:(0,r.jsx)(me.Z,{}),children:"Smite"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:6,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Damage yourself to damage the enemy, uses constitution",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-blood",onClick:function(){return _(q.hK.Blood)},"aria-label":"blood magic",startIcon:(0,r.jsx)(fe.Z,{}),children:"Blood magic"})})})]})]}),S&&"This enemy was killed by another player",Q&&Q.log.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[e.damage<0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," heals"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-heal"),children:(0-e.damage).toLocaleString()})," ","health from their enchantments"]}),e.damage>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," dealt"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-damage"),children:e.damage.toLocaleString()})," ","enchantment damage to ",(0,r.jsx)("b",{children:e.to})]})]}),!e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," ".concat(Ae(e.attackType,e.success,e.critical)," "),(0,r.jsx)("b",{children:e.to}),e.success?" for ".concat(e.damage.toLocaleString()," ").concat(e.damageType?e.damageType.toLowerCase():""," damage!"):"."]})]})},"".concat(e.from,"-").concat(n))})),Q&&Q.victory&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"fight-did-win",children:[f.name," has been killed!",(Q.experience||Q.gold)&&" You gain ",Q.gold&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-gold",children:Q.gold.toLocaleString()})," ","gold"]}),Q.gold&&Q.experience&&" and",Q.experience&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-experience",children:Q.experience.toLocaleString()})," ","experience"]}),(Q.experience||Q.gold)&&"!! ",Q.didLevel&&(0,r.jsx)("b",{id:"fight-level-up",children:"You leveled up!!"})]}),Q.drop&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{id:"fight-got-drop",variant:"h5",children:["You find an enchanted item on the monster's corpse!",(0,r.jsx)("br",{}),(0,B.GJ)(Q.drop)]})]}),(0,r.jsx)("br",{}),V&&(0,r.jsx)(P.Z,{fullWidth:!0,color:"secondary",variant:"contained",onClick:function(){p&&p(f.id,R)},children:"Auto-Battle this enemy"})]})]})]})}function Ae(e,n,t){switch(e){case q.hK.Blood:return n?t?"surges with blood magic against":"lets blood and casts forth towards":"attempts to cast a spell against";case q.hK.Smite:return n?t?"summons powers beyond this world against":"smites":"attempts to smite";case q.hK.Cast:return n?t?"carefully casts a spell at":"blasts a beam of necrotic energy into":"attempts to cast a spell against";case q.hK.Ranged:return n?t?"lands a sneak attack from the shadows, critically damaging":"fires an arrow at":"shoots an arrow but it misses";case q.hK.Melee:default:return n?t?"lands a crippling blow against":"struck":"missed"}}function Pe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t.5?100*Math.random():y[0],Math.random()>.5?100*Math.random():y[1],Math.random()>.5?100*Math.random():y[2]]),0===x){e.next=4;break}return e.abrupt("return");case 4:if(!(Fe||N>0)){e.next=6;break}return e.abrupt("return");case 6:if(0!==(null===ye||void 0===ye?void 0:ye.combat.health)){e.next=9;break}return console.log("[AutoBattler] Healing!"),e.abrupt("return",Te());case 9:if(Pe&&0!==Pe.monster.combat.health&&Pe.monster.id===C){e.next=13;break}return console.log("[AutoBattler] Challenging new mob!"),qe(C),e.abrupt("return");case 13:if(!Pe||!Se.current){e.next=17;break}return console.log("[AutoBattler] Fighting ".concat(l,"!")),Se.current(l),e.abrupt("return");case 17:console.log("[AutoBattler] Doing nothing...");case 18:case"end":return e.stop()}}),e)}))),(0,i.useEffect)((function(){if(w&&C.length){var e=(0,ie.Zi)((function(){j.current()}),500);return function(){(0,ie.cv)(e)}}}),[w,Oe]),(0,i.useEffect)((function(){var e;if(null===se||void 0===se||null===(e=se.monsters)||void 0===e?void 0:e.length){var n=se.monsters.concat().sort((function(e,n){return e.monster.level-n.monster.level}));if(""===K)V(n[0].id);else se.monsters.find((function(e){return e.id===K}))||V(n[0].id)}}),[K,null===se||void 0===se||null===(n=se.monsters)||void 0===n?void 0:n.length]);var ze=null===se||void 0===se||null===(t=se.monsters)||void 0===t?void 0:t.find((function(e){return e.id===K}));ze||(K="");var Re=Ae.find((function(e){return e.id===te}));if(Ae.find((function(e){return e.id===X}))||(X=""),!ye)return null;ye.levelCap>100||(ge=ge.slice(0,ye.level)),Ae=Ae.filter((function(e){return e.combat.health>0}));var Ne="Select a new monster to challenge",Qe="Fight an existing monster!",He="Duel with a nearby player!";return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:4,children:[!w&&ye&&ye.combat.health>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"challenge-monster-select-label",children:Ne}),(0,r.jsx)($.Z,{id:"challenge-select",labelId:"challenge-monster-select-label",value:U,label:Ne,disabled:w,onChange:function(e){return J(e.target.value)},children:ge.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[e.name,"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Tier ",e.level]})]},e.id)}))}),(0,r.jsx)(P.Z,{id:"challenge-button",disabled:!U||N>0||fe||w,onClick:function(){return Ge.apply(this,arguments)},variant:"contained",children:"Challenge!"})]})}),(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"fight-monster-select-label",children:Qe}),(0,r.jsx)($.Z,{id:"fight-select",labelId:"fight-monster-select-label",value:K,label:Qe,disabled:w,onChange:function(e){return V(e.target.value)},children:(null===se||void 0===se?void 0:se.monsters)&&Ee(null===se||void 0===se?void 0:se.monsters).sort((function(e,n){return e.monster.level-n.monster.level})).map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:0===e.monster.combat.health,children:[0===e.monster.combat.health&&"Dead ",e.monster.name]},e.id)}))}),(0,r.jsx)(P.Z,{id:"fight-button",disabled:!K||N>0||fe||ze&&0===ze.monster.combat.health||w,onClick:function(){return We.apply(this,arguments)},variant:"contained",children:"Fight!"})]})}),Ae.length>1&&(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"duel-select-label",children:He}),(0,r.jsx)($.Z,{id:"duel-select",labelId:"duel-select-label",value:X,label:He,disabled:w,onChange:function(e){return ee(e.target.value)},children:Ae.filter((function(e){return e.id!==ye.id})).sort((function(e,n){return e.level-n.level})).map((function(e){return(0,r.jsx)(z.Z,{value:e.id,children:e.name},e.id)}))}),(0,r.jsx)(P.Z,{id:"duel-button",disabled:!X.length||N>0||fe||w,onClick:function(){return $e.apply(this,arguments)},variant:"contained",children:"Duel Player!"})]})})]}),w&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[(0,r.jsx)(u.Z,{sx:{margin:1,color:"#f00"},variant:"determinate",value:y[0],color:"inherit"}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#0f0"},variant:"determinate",value:y[1]}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#00f"},variant:"determinate",value:y[2]}),(0,r.jsx)(P.Z,{fullWidth:!0,variant:"contained",color:"error",size:"large",onClick:function(){return k(!1)},children:"Disable Auto-Battle"})]}),ye&&ye.combat.health<=0&&(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(h.Z,{id:"you-are-dead",children:"You are dead."})}),Pe&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(ke,{hero:ye,fight:Pe,onError:function(){ue(),G(null)},autoBattle:w,canAutoBattle:Ce,onAutoBattle:function(e,n){return Be.apply(this,arguments)},fightMutationRef:Se,onVictory:function(){return f(d+1)}},"".concat(Pe.id,"-").concat(F))}),Re&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(ke,{hero:ye,fight:{id:Re.id,monster:Re},onError:function(){ue(),G(null)},duel:!0,autoBattle:!1,canAutoBattle:!1},"".concat(Re.id,"-").concat(F))}),(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(P.Z,{id:"heal-button",fullWidth:!0,onClick:Te,variant:"contained",disabled:N>0||fe||ye&&ye.combat.health===ye.combat.maxHealth,children:"Heal"})})]})})}var Te=t(1514);function Me(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(h.Z,{sx:{mb:2},variant:"body1",color:o?"success.main":"error.main",children:s}),n.trades.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(Ve,{trade:e}),(0,r.jsx)(P.Z,{disabled:f,onClick:function(){return function(e){return v.apply(this,arguments)}(e.id)},sx:{ml:1},children:"Trade"})]})},"npc shop items ".concat(n))}))]})}function Ve(e){var n=e.trade;return(0,r.jsxs)(i.Fragment,{children:["For the price of ",(0,r.jsx)(_e,{price:n.price}),", I'll give you"," ",(0,r.jsx)(_e,{price:n.offer})]})}function _e(e){var n=e.price;return(0,r.jsx)(F.Z,{title:Xe(n),describeChild:!0,children:(0,r.jsx)(Qe.Z,{style:{background:"none",border:"none"},"aria-label":Xe(n),children:n.description})})}function Xe(e){var n,t,r,i=[];return e.gold&&i.push("".concat(e.gold.toLocaleString()," gold")),e.dust&&i.push("".concat(e.dust.toLocaleString()," dust")),(null===(n=e.baseItems)||void 0===n?void 0:n.length)&&e.baseItems.forEach((function(e){i.push("".concat(e))})),(null===(t=e.enchantments)||void 0===t?void 0:t.length)&&e.enchantments.forEach((function(e){i.push("".concat((0,B.uD)(e)))})),(null===(r=e.questItems)||void 0===r?void 0:r.length)&&e.questItems.forEach((function(e){i.push("".concat(e))})),i.length?i.join(", "):"???"}var en=t(3020),nn=t(6242),tn=t(2023),rn=t(9748),on=t(4267),an=t(657),ln=t(1425),sn=t(6580),cn=t(8951),un=t(3090),dn=t(1812),hn=t(7855),mn=t(3707),fn=t(5843),vn=t(1233);function xn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);to?"error":"",component:"span","aria-label":"Upkeep: ".concat(l),children:[" ","-",l.toLocaleString()]})]},i)}))})}function In(e){var n,t=e.hero,i=e.camp,o=function(e){var n,t;return null!==(t=null===(n=e.find((function(e){return"gold"===e.name})))||void 0===n?void 0:n.value)&&void 0!==t?t:0},a=wn((0,q.Th)(),2),l=a[0],c=a[1].loading,u=(0,q.Hk)(),d=u.data,f=u.refetch,v=null!==(n=null===d||void 0===d?void 0:d.availableUpgrades)&&void 0!==n?n:[],x=wn((0,oe.gZ)(),1)[0]>0;if(!v.length)return null;function p(){return(p=Sn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l({variables:{upgrade:n}});case 3:return e.next=5,f();case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var g=!!i.upgrades.find((function(e){return e===q.gT.Settlement}));return(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{variant:"h6",children:[g?"Settlement":"Camp"," Upgrades"]}),(0,r.jsx)(m.ZP,{container:!0,columns:6,spacing:2,children:v.map((function(e){return(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsxs)(nn.Z,{variant:"outlined",children:[(0,r.jsx)(rn.Z,{title:e.name}),(0,r.jsx)(on.Z,{children:(0,r.jsxs)(h.Z,{variant:"body2",color:"text.secondary",children:["Cost:"," ",e.cost.map((function(e){return"".concat(e.value.toLocaleString()," ").concat((0,en.words)(e.name))})).join(", ")]})}),(0,r.jsx)(tn.Z,{children:(0,r.jsx)(dn.Z,{disabled:x,loading:c,sx:{m:1},variant:"outlined",color:o(e.cost)>t.gold?"error":"success",onClick:function(){return function(e){return p.apply(this,arguments)}(e.type)},children:"Purchase"})})]})},e.type)}))})]})}function Ln(e){e.hero,e.camp;return null}var En=t(1730),On=t(2613),Fn=t(3054),Tn=t(7563),Mn=t(6398),Wn=t(6667),Gn=t(3898),qn=t(1733),Dn=t(1671),Bn=t(1749),$n=t(4231);function zn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Rn(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t=s||d.find((function(e){return e.x===t&&e.y===o}))?null:d.find((function(e){return e.x===t+1&&e.y===o||e.x===t-1&&e.y===o||e.x===t&&e.y===o+1||e.x===t&&e.y===o-1}))?{x:t,y:o,map:a.location.map}:null}),[d.length,t,o,s]);function m(){return(m=Yn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u({variables:{location:n,type:l}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return h?(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Hn,{onClick:function(){return function(e){return m.apply(this,arguments)}(h)},hover:!0,color:"rgb(10, 120, 10)",cellSize:n,boundingBox:c,location:h,tooltip:"Build here",icon:(0,r.jsx)(Fn.Z,{})},"".concat(h.x,"-").concat(h.y))}):null}function _n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0?(0,r.jsx)("li",{children:(0,r.jsx)(rt,{name:(0,en.words)(e.name),"aria-label":"".concat(e.value.toLocaleString()," out of ").concat((null!==(o=e.maximum)&&void 0!==o?o:0).toLocaleString()),value:"".concat(e.value.toLocaleString()," / ").concat((null!==(a=e.maximum)&&void 0!==a?a:0).toLocaleString())})},e.name):null}))]}),l.id===(null===(n=s.home)||void 0===n?void 0:n.id)&&(0,r.jsx)(In,{camp:l,hero:s}),l.type===q.oS.Settlement&&l.id!==(null===(t=s.home)||void 0===t?void 0:t.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This settlement is a former capital that has fallen. You can destroy this location and reclaim most of the resources."}),(0,r.jsx)(P.Z,{onClick:function(){return c(l)},variant:"contained",color:"error",children:"Destroy former settlement"})]}),l.type===q.oS.Barracks&&(0,r.jsx)(it,{location:l,action:"Recruit",unit:"troops",cost:1e6,loading:m,onPurchase:function(e){d({variables:e})}}),l.type===q.oS.Treasury&&(0,r.jsx)(it,{location:l,action:"Purchase",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:e})}}),l.type===q.oS.Treasury&&(0,r.jsx)(it,{location:l,action:"Sell",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:et({},e,{amount:0-e.amount})})}}),l.type===q.oS.Treasury&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(dn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!1}})},children:"Craft Element of Gold (1,000,000 bonds)"}),(0,r.jsx)(dn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!0}})},children:"Craft Greater Element of Gold (250,000,000 bonds)"})]}),l.type===q.oS.Garrison&&(0,r.jsx)(it,{location:l,action:"Build",unit:"fortifications",cost:1e6,loading:b,onPurchase:function(e){y({variables:e})}})]}):null}function rt(e){var n=e.name,t=e.value,i=e["aria-label"];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{style:{fontWeight:"bold"},htmlFor:"building-details-value-".concat(n),children:[n,":"]})," ",(0,r.jsx)("span",{"aria-label":i,children:t})]})}function it(e){var n=e.location,t=e.action,o=e.unit,a=e.cost,l=e.loading,s=void 0!==l&&l,c=e.onPurchase,u=(0,i.useState)(0),d=u[0],h=u[1],m=(nt((0,q.Up)(),1)[0],(0,oe.mu)()),f=Number.isFinite(d)&&!isNaN(d)&&d>0;return(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(R.Z,{onChange:function(e){return h(parseInt(e.target.value))},id:"".concat(t,"-input"),label:"Amount of ".concat(o," to ").concat(t.toLowerCase())}),(0,r.jsxs)(dn.Z,{loading:s,variant:"contained",disabled:!f||m,onClick:function(){Number.isFinite(d)&&!isNaN(d)&&c({location:{x:n.location.x,y:n.location.y,map:n.location.map},amount:d})},children:[!f&&"".concat(t," ").concat(o),f&&"".concat(t," ").concat(d.toLocaleString()," ").concat(o," for ").concat((d*a).toLocaleString()," gold")]})]})}var ot=t(89),at=t(6656),lt=t(8456);function st(e){var n,t,i,o=e.open,a=e.onClose,l=e.loading,c=e.attackResults,u=e.hero;return(0,r.jsx)(T.Z,{open:o,onClose:a,children:(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},"aria-labelledby":"attack-results-modal-title","aria-describedby":"modal-modal-description",children:[l&&(0,r.jsx)(lt.Z,{}),c&&(0,r.jsxs)(r.Fragment,{children:[c.target.owner===u.id&&(0,r.jsx)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:"Your troops have claimed this location in your name, it now belongs to your settlement."}),c.target.owner!==u.id&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:["Attack results for ",c.target.location.x,","," ",c.target.location.y]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",children:["Owner:"," ",(0,r.jsx)("strong",{children:null!==(i=null===c||void 0===c||null===(n=c.target)||void 0===n||null===(t=n.publicOwner)||void 0===t?void 0:t.name)&&void 0!==i?i:"Unknown"})]})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{children:["You lost ",ct(c.attackerCasualties)]}),(0,r.jsxs)(h.Z,{children:["Your opponent lost"," ",ct(c.targetCasualties)]}),c.totalDamage>0&&(0,r.jsxs)(h.Z,{children:["Your troops dealt ",c.totalDamage.toLocaleString()," ","damage"]}),c.damage>0&&(0,r.jsxs)(h.Z,{children:["The target location received"," ",c.damage.toLocaleString()," damage",c.totalDamage>c.damage&&", the rest was absorbed by garrisons."]}),0===c.damage&&(0,r.jsx)(h.Z,{children:"All damage was absorbed by garrisons."})]})]})})}function ct(e){var n=Object.keys(e).map((function(n){var t=e[n];return!!(t&&t>0)&&"".concat(t.toLocaleString()," ").concat(n)})).filter((function(e){return!!e}));return n.length?n.join(", "):"nothing"}function ut(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(I=null===(f=Oe.ghost)||void 0===f?void 0:f.value)&&void 0!==I?I:0).toLocaleString()})]})]}),ne&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h5",children:"Troups in this location"}),(0,r.jsxs)("ul",{children:[(null!==(L=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==L?L:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-enlisted",children:"Enlisted:"})," ",(0,r.jsx)("span",{id:"military-target-enlisted",children:(null!==(E=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==E?E:0).toLocaleString()})]}),(null!==(O=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==O?O:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-soldier",children:"Soldier:"})," ",(0,r.jsx)("span",{id:"military-target-soldier",children:(null!==(F=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==F?F:0).toLocaleString()})]}),(null!==(T=null===Le||void 0===Le?void 0:Le.value)&&void 0!==T?T:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-veteran",children:"Veteran:"})," ",(0,r.jsx)("span",{id:"military-target-veteran",children:(null!==(M=null===Le||void 0===Le?void 0:Le.value)&&void 0!==M?M:0).toLocaleString()})]}),(null!==(W=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==W?W:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(G=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==G?G:0).toLocaleString()})]})]}),(0,r.jsx)(h.Z,{mb:2,component:"h6",variant:"h5",children:"Troops to send"}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(vt,{name:"enlisted",value:le,onChange:se,max:Pe?null!==(D=null===(v=Oe.enlisted)||void 0===v?void 0:v.value)&&void 0!==D?D:0:Math.min(null!==(B=null===(x=Oe.enlisted)||void 0===x?void 0:x.value)&&void 0!==B?B:0,(null!==($=null===Ce||void 0===Ce?void 0:Ce.maximum)&&void 0!==$?$:0)-(null!==(z=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==z?z:0))}),(0,r.jsx)(vt,{name:"soldier",value:ue,onChange:de,max:Pe?null!==(R=null===(p=Oe.soldier)||void 0===p?void 0:p.value)&&void 0!==R?R:0:Math.min(null!==(N=null===(g=Oe.soldier)||void 0===g?void 0:g.value)&&void 0!==N?N:0,(null!==(Q=null===Ie||void 0===Ie?void 0:Ie.maximum)&&void 0!==Q?Q:0)-(null!==(H=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==H?H:0))}),(0,r.jsx)(vt,{name:"veteran",value:me,onChange:fe,max:Pe?null!==(U=null===(y=Oe.veteran)||void 0===y?void 0:y.value)&&void 0!==U?U:0:Math.min(null!==(J=null===(b=Oe.veteran)||void 0===b?void 0:b.value)&&void 0!==J?J:0,(null!==(Y=null===Le||void 0===Le?void 0:Le.maximum)&&void 0!==Y?Y:0)-(null!==(K=null===Le||void 0===Le?void 0:Le.value)&&void 0!==K?K:0))}),(0,r.jsx)(vt,{name:"ghost",value:xe,onChange:pe,max:Pe?null!==(V=null===(j=Oe.ghost)||void 0===j?void 0:j.value)&&void 0!==V?V:0:Math.min(null!==(_=null===(S=Oe.ghost)||void 0===S?void 0:S.value)&&void 0!==_?_:0,(null!==(X=null===Ee||void 0===Ee?void 0:Ee.maximum)&&void 0!==X?X:0)-(null!==(ee=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==ee?ee:0))})]}),Pe&&(0,r.jsx)(P.Z,{onClick:function(){return Fe.apply(this,arguments)},children:"Attack target"}),!Pe&&(0,r.jsx)(P.Z,{onClick:function(){ne&&je({variables:{target:{x:ne.location.x,y:ne.location.y,map:ne.location.map},units:{enlisted:le,soldier:ue,veteran:me,ghost:xe}}})},children:"Move troops"})]})]})}function vt(e){var n=e.name,t=e.onChange,i=e.value,o=e.max;return 0===o?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:1,children:(0,r.jsxs)("label",{id:"military-slider-".concat(n,"-label"),children:[(0,en.words)(n),":"]})}),(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(at.ZP,{value:i,onChange:function(e,n){return t(n)},min:0,max:o,valueLabelDisplay:"auto",getAriaValueText:function(e){return e.toLocaleString()},"aria-labelledby":"military-slider-".concat(n,"-label")})})}),(0,r.jsx)(m.ZP,{item:!0,xs:2,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(ot.Z,{value:i,size:"small",onChange:function(e){return t(""===e.target.value?0:Number(e.target.value))},onBlur:function(){i<0?t(0):i>o&&t(o)},inputProps:{step:1,min:0,max:o,type:"number","aria-labelledby":"input-slider"}})})})]})}var xt,pt=t(947);function gt(e){var n=e.cellSize,t=e.x,i=e.y,o=e.boundingBox,a=e.onClick,l=e.adjacentTiles.find((function(e){return e.location.x===t&&e.location.y===i}));return l?(0,r.jsx)(Hn,{onClick:function(){return a(l)},hover:!0,cellSize:n,boundingBox:o,location:{x:t,y:i},tooltip:"Attack here",color:"rgb(140, 0, 0)",icon:(0,r.jsx)(pt.Z,{})},"".concat(t,"-").concat(i)):null}function yt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]})},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,en.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())," ",re.upkeep[e.name]>0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,en.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())]},e.name)})),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(p.Z,{"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",onChange:function(e,n){I&&L(null),H(n)},sx:{flexShrink:0,flexGrow:1},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Dn.Z,{}),label:"Building Details",value:"info",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Fn.Z,{}),label:"Build Buildings",value:"build",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(qn.Z,{}),label:"Destroy Buildings",value:"destroy",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Tn.Z,{}),label:"Resource Market",value:"market",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Bn.Z,{}),label:"Military",value:"military",wrapped:!0})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,lg:3,children:(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,r.jsx)(h.Z,{variant:"h6",style:y.Z,children:"Buildings"}),(0,r.jsx)(De,{location:re.location,minimapSize:[se,ue],cellSize:he,renderCell:function(e){var n,t,i,o,a,l,s,u,d,h,m,f,v,x,p,g,y,b,j,Z,S,w,k,A,P,C,L,E,O,F,T,M,W,G,D,B,$,z,R,N,H,U,J,Y,K,V,_,X,ee,ie,oe,ae,se=e.x,ce=e.y,ue=!1,de=!1;(null===(n=fe[se])||void 0===n||null===(t=n[ce])||void 0===t?void 0:t.type)!==q.oS.Garrison&&(null===(i=fe[se-1])||void 0===i||null===(o=i[ce+1])||void 0===o?void 0:o.type)!==q.oS.Garrison&&(null===(a=fe[se+1])||void 0===a||null===(l=a[ce+1])||void 0===l?void 0:l.type)!==q.oS.Garrison&&(null===(s=fe[se-1])||void 0===s||null===(u=s[ce])||void 0===u?void 0:u.type)!==q.oS.Garrison&&(null===(d=fe[se+1])||void 0===d||null===(h=d[ce])||void 0===h?void 0:h.type)!==q.oS.Garrison&&(null===(m=fe[se-1])||void 0===m||null===(f=m[ce-1])||void 0===f?void 0:f.type)!==q.oS.Garrison&&(null===(v=fe[se+1])||void 0===v||null===(x=v[ce-1])||void 0===x?void 0:x.type)!==q.oS.Garrison&&(null===(p=fe[se])||void 0===p||null===(g=p[ce+1])||void 0===g?void 0:g.type)!==q.oS.Garrison&&(null===(y=fe[se])||void 0===y||null===(b=y[ce-1])||void 0===b?void 0:b.type)!==q.oS.Garrison&&(null===(j=fe[se])||void 0===j||null===(Z=j[ce+2])||void 0===Z?void 0:Z.type)!==q.oS.Garrison&&(null===(S=fe[se])||void 0===S||null===(w=S[ce-2])||void 0===w?void 0:w.type)!==q.oS.Garrison&&(null===(k=fe[se+2])||void 0===k||null===(A=k[ce])||void 0===A?void 0:A.type)!==q.oS.Garrison&&(null===(P=fe[se-2])||void 0===P||null===(C=P[ce])||void 0===C?void 0:C.type)!==q.oS.Garrison||(ue=!0),(null===(L=fe[se])||void 0===L||null===(E=L[ce])||void 0===E?void 0:E.type)!==q.oS.Barracks&&(null===(O=fe[se-1])||void 0===O||null===(F=O[ce+1])||void 0===F?void 0:F.type)!==q.oS.Barracks&&(null===(T=fe[se+1])||void 0===T||null===(M=T[ce+1])||void 0===M?void 0:M.type)!==q.oS.Barracks&&(null===(W=fe[se-1])||void 0===W||null===(G=W[ce])||void 0===G?void 0:G.type)!==q.oS.Barracks&&(null===(D=fe[se+1])||void 0===D||null===(B=D[ce])||void 0===B?void 0:B.type)!==q.oS.Barracks&&(null===($=fe[se-1])||void 0===$||null===(z=$[ce-1])||void 0===z?void 0:z.type)!==q.oS.Barracks&&(null===(R=fe[se+1])||void 0===R||null===(N=R[ce-1])||void 0===N?void 0:N.type)!==q.oS.Barracks&&(null===(H=fe[se])||void 0===H||null===(U=H[ce+1])||void 0===U?void 0:U.type)!==q.oS.Barracks&&(null===(J=fe[se])||void 0===J||null===(Y=J[ce-1])||void 0===Y?void 0:Y.type)!==q.oS.Barracks&&(null===(K=fe[se])||void 0===K||null===(V=K[ce+2])||void 0===V?void 0:V.type)!==q.oS.Barracks&&(null===(_=fe[se])||void 0===_||null===(X=_[ce-2])||void 0===X?void 0:X.type)!==q.oS.Barracks&&(null===(ee=fe[se+2])||void 0===ee||null===(ie=ee[ce])||void 0===ie?void 0:ie.type)!==q.oS.Barracks&&(null===(oe=fe[se-2])||void 0===oe||null===(ae=oe[ce])||void 0===ae?void 0:ae.type)!==q.oS.Barracks||(de=!0);var me=void 0;if(ue?(me="blue",de&&(me="green")):de&&(me="rgb(180, 200, 0)"),se===re.location.x&&ce===re.location.y)return(0,r.jsx)(Hn,{onClick:function(){return c(function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0||E;function J(e){return Y.apply(this,arguments)}function Y(){return(Y=Lt(Z().mark((function e(n){var t,r;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A({variables:{direction:n}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(t=e.t0.graphQLErrors[0])||void 0===t||null===(r=t.extensions)||void 0===r?void 0:r.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function K(){return(K=Lt(Z().mark((function e(){var n,t;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,L({variables:{x:x,y:y}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(n=e.t0.graphQLErrors[0])||void 0===n||null===(t=n.extensions)||void 0===t?void 0:t.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var V,_=Math.round(Math.pow(5*(0,B.LW)(s.location,{x:x,y:y}),1.3));return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:2,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,xs:2,sm:1,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:(0,r.jsx)(kn,{hero:s,onShowSettlement:function(){f(!0)}})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(h.Z,{variant:"h3",children:"Travel"}),s.combat.health>0&&(0,r.jsx)(h.Z,{children:"Use buttons to move around the map."}),0===s.combat.health&&(0,r.jsx)(h.Z,{component:"p",variant:"h6",children:"You cannot move while dead. Heal yourself in the Combat tab."})]}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"North terrain: ".concat(z),disabled:U,variant:"contained",onClick:function(){return J(q.p$.North)},children:"North"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"West terrain: ".concat(H),disabled:U,variant:"contained",onClick:function(){return J(q.p$.West)},children:"West"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsxs)(h.Z,{children:[s.location.x,", ",s.location.y]})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"East terrain: ".concat(Q),disabled:U,variant:"contained",onClick:function(){return J(q.p$.East)},children:"East"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"South terrain: ".concat(N),disabled:U,variant:"contained",onClick:function(){return J(q.p$.South)},children:"South"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),s.stats.intelligence>100&&(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(c.Z,{}),(0,r.jsx)(h.Z,{variant:"h5",component:"h3",color:"secondary",sx:{margin:1},children:"Teleport"}),(0,r.jsx)(R.Z,{label:"X coordinate",value:x,onChange:function(e){return l(e.target.value,y)},sx:{width:"100px",margin:1}}),(0,r.jsx)(R.Z,{label:"Y coordinate",value:y,onChange:function(e){return l(x,e.target.value)},sx:{width:"100px",margin:1}}),(0,r.jsx)("br",{}),(0,r.jsxs)(P.Z,{color:"secondary",variant:"outlined",onClick:function(){return K.apply(this,arguments)},disabled:0===_||_>s.stats.intelligence||U,children:["Teleport",(0,r.jsx)("br",{}),_>0&&"".concat(_.toLocaleString()," minimum intelligence")]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,sm:1,children:[G&&(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:G.name}),G&&(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:G.type}),$&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h6",component:"h4",children:[null!==(V=null===(t=$.publicOwner)||void 0===t?void 0:t.name)&&void 0!==V?V:"???","'s Settlement"]}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:$.type})]}),!G&&!$&&W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"Wilderness"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:W.terrain.terrain})]}),!G&&!$&&!W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"\xa0"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:"loading..."})]}),(0,r.jsx)(De,{location:s.location,renderCell:function(e){var n=e.x,t=e.y;return s.location.x===n&&s.location.y===t?(0,r.jsx)("div",{style:{borderRadius:"".concat(4,"px"),backgroundColor:"red",border:"2px solid rgba(255,255,255,0.3)",width:"".concat(8,"px"),height:"".concat(8,"px"),margin:"auto"}}):null}}),(null===G||void 0===G?void 0:G.description)&&G.description.map((function(e,n){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},"loc-desc-".concat(n))})),M.filter((function(e){return!!e})).map((function(e){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},e)}))]}),"dock"===(null===G||void 0===G?void 0:G.type)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ne,{location:G})}),(null===W||void 0===W?void 0:W.shop)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ke,{shop:null===W||void 0===W?void 0:W.shop})})]})})}var Tt,Mt=t(5582);function Wt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t2&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{id:"level-up-stat-slider-label",children:x}),(0,r.jsx)(at.ZP,{min:1,max:v.attributePoints,value:a,onChange:function(e,n){return!Array.isArray(n)&&l(n)},id:"level-up-stat-slider","aria-labelledby":"level-up-stat-slider-label",valueLabelDisplay:"auto"})]})})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:14,spacing:2,children:[(0,r.jsx)(F.Z,{title:"Strength determines your damage when attacking with melee weapons",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-strength",disabled:f||n>0,onClick:function(){return p("Strength")},variant:"contained",children:"Strength"})})})}),(0,r.jsx)(F.Z,{title:"Dexterity determines the accuracy and dodge rate for melee and ranged weapons, it also determines ranged weapons damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-dexterity",disabled:f||n>0,onClick:function(){return p("Dexterity")},variant:"contained",children:"Dexterity"})})})}),(0,r.jsx)(F.Z,{title:"Constitution determines your max health, and is used in both attacking and defending blood magic",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-constitution",disabled:f||n>0,onClick:function(){return p("Constitution")},variant:"contained",children:"Constitution"})})})}),(0,r.jsx)(F.Z,{title:"Intelligence determines your spellcasting damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-intelligence",disabled:f||n>0,onClick:function(){return p("Intelligence")},variant:"contained",children:"Intelligence"})})})}),(0,r.jsx)(F.Z,{title:"Wisdom is your accuracy and dodge stat for spellcasting and smiting",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-wisdom",disabled:f||n>0,onClick:function(){return p("Wisdom")},variant:"contained",children:"Wisdom"})})})}),(0,r.jsx)(F.Z,{title:"Willpower helps you survive attacks by reducing damage, it also helps smiters deal deal more damage.",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-willpower",disabled:f||n>0,onClick:function(){return p("Willpower")},variant:"contained",children:"Willpower"})})})}),(0,r.jsx)(F.Z,{title:"Luck helps you critically strike foes and also affects item drop rates",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-luck",disabled:f||n>0,onClick:function(){return p("Luck")},variant:"contained",children:"Luck"})})})}),(0,r.jsx)(F.Z,{title:"Places 1 in every stat for a more well rounded character",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-all",disabled:f||n>0,onClick:function(){return p("All")},variant:"contained",children:"All"})})})})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(c.Z,{})]})}function $t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);ta.gold,children:[e.cost&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{display:"inline-block",children:e.name}),"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Lvl. ",e.level]}),"\xa0",(0,r.jsxs)(h.Z,{variant:"subtitle2",display:"inline-block",sx:{color:"info.main"},children:[e.cost.toLocaleString()," Gold"]})]}),!e.cost&&e.name]},e.id)}))})]}):null}function Kt(){var e=Qt((0,oe.gZ)(),1)[0],n=(0,i.useState)(null),t=n[0],o=n[1],a=(0,i.useState)(""),l=a[0],s=a[1],u=(0,q.Cb)(),d=u.data,f=(u.loading,u.error,Qt((0,q.Nn)(),2)),v=f[0],x=f[1].loading,p=Qt((0,q.o_)(),2),g=p[0],y=p[1].loading||x||e>0;function b(){return(b=Rt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,v({variables:{baseItem:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function j(){return(j=Rt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,g({variables:{item:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var S,w="Choose which shop to visit";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{align:"center",children:["Welcome to the shop! You can buy and sell any non-enchanted items here.",(0,r.jsx)("br",{}),"The items purchasable here have a level from 1 to 32 but no enchantments or direct attribute increases."]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"shop-type-select-label",children:w}),(0,r.jsxs)($.Z,{id:"shop-type-select",labelId:"shop-type-select-label",label:w,onChange:function(e){s(e.target.value),o(null)},children:[(0,r.jsx)(z.Z,{value:"sell",children:"Sell Items"}),(0,r.jsx)(c.Z,{}),(0,r.jsxs)(z.Z,{value:q.$7.MeleeWeapon,children:[Ut(q.$7.MeleeWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.RangedWeapon,children:[Ut(q.$7.RangedWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.SpellFocus,children:[Ut(q.$7.SpellFocus)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.Shield,children:[Ut(q.$7.Shield)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.BodyArmor,children:[Ut(q.$7.BodyArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.HandArmor,children:[Ut(q.$7.HandArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.LegArmor,children:[Ut(q.$7.LegArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.HeadArmor,children:[Ut(q.$7.HeadArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.FootArmor,children:[Ut(q.$7.FootArmor)," Shop"]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,children:[""!==l&&"sell"!==l&&(0,r.jsx)(Yt,{value:t?t.id:"",type:l,items:function(e){var n;return(null===d||void 0===d||null===(n=d.shopItems)||void 0===n?void 0:n.length)?d.shopItems.filter((function(n){return n.type===e})):[]}(l),onChange:function(e){return o(e)}},l),"sell"===l&&(0,r.jsx)(Jt,{value:t?t.id:"",sellables:null!==(S=null===d||void 0===d?void 0:d.shopItems)&&void 0!==S?S:[],onChange:function(e){return o(e)}})]}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:t&&(0,r.jsxs)(P.Z,{variant:"contained",color:"sell"===l?"error":"success",fullWidth:!0,disabled:y,onClick:"sell"===l?function(){return j.apply(this,arguments)}:function(){return b.apply(this,arguments)},children:["sell"===l?"Sell":"Buy"," ",t.name," for"," ",t.cost.toLocaleString()," gold"]})})]}),(0,r.jsx)("br",{})]})}function Vt(){D();var e=ae();le();return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Item Shop"}),(0,r.jsx)(Kt,{}),(null===e||void 0===e?void 0:e.shop)&&(0,r.jsx)(Ke,{shop:null===e||void 0===e?void 0:e.shop})]})}function _t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=n.levelCap);function l(){return(l=er(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsxs)(s.Z,{sx:{padding:1,margin:1},children:[(0,r.jsx)(h.Z,{color:"secondary",variant:"h2",children:"Rebirth"}),!a&&(0,r.jsx)(h.Z,{children:"You may only be reborn when you are at level cap. Keep leveling up your character in order to be reborn!"}),a&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This will reset your character's level and attributes, however you will keep all gold and items and will receive special bonuses depending on your current level cap."}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{size:"large",variant:"outlined",color:"secondary",onClick:function(){return l.apply(this,arguments)},children:"Reset Character to Level 1"})]})]})}var rr=t(5988),ir=t(9629);function or(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t1&&"(".concat(p[e],")"),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]}),(0,r.jsxs)(P.Z,{fullWidth:!0,variant:"contained",disabled:!y||t||v||S>n.enchantingDust,color:"success",onClick:function(){return j.apply(this,arguments)},children:[y&&""!==u&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Create ",(0,r.jsx)("b",{children:(0,B.GJ)(y,u)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",S.toLocaleString()," Enchantment Dust"]})]}),!y&&"Select Item"]})]})}function pr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tn.enchantingDust,color:"error",onClick:function(){return j.apply(this,arguments)},children:[b&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Disenchant ",(0,r.jsx)("b",{children:(0,B.GJ)(b)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",w.toLocaleString()," Enchantment Dust"]})]}),!b&&"Select Item"]})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),m&&(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"filter-select-label",children:"Filter by enchantment"}),(0,r.jsx)($.Z,{id:"filter-select",labelId:"filter-select-label",value:a||"",label:"Filter by enchantment",onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.enchantment===t}))&&l(t)},children:y.map((function(e){return(0,r.jsxs)(z.Z,{value:e,children:[(0,B.uD)(e),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]})]})}var Zr=t(3457),Sr=t(480),wr=t(9368);function kr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t31)})).sort(B.v4)),v=f.find((function(e){return e.id===a}));!v&&a.length&&(f.length?(v=f[0],a=v.id):a="");var x="Select base item",p=n.equipment.artifact;if(!p)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(h.Z,{children:"You must have an artifact to imbue items with."})});var g,y=(0,B.Vy)(p);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"Imbueing an item adds parts of an artifact onto a base item. Items can only be imbued once, and there is no way to remove the imbue. You may enchant an imbued item, however only unenchanted items can receive an imbue."}),(0,r.jsx)("br",{}),(0,r.jsxs)(L.Z,{fullWidth:!0,sx:{margin:1},children:[(0,r.jsx)(E.Z,{id:"enchant-baseItem-select-label",children:x}),(0,r.jsx)($.Z,{id:"enchant-baseItem-select",labelId:"enchant-baseItem-select-label",value:a||"",label:x,onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.id===t}))&&l(t)},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,B.GJ)(e),(0,B.mQ)(n,e)&&"*EQUIPPED*"]},e.id)}))})]}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h5",children:[v.name," to be imbued with"," ",(0,r.jsx)("strong",{children:p.name})]}),(0,r.jsx)(h.Z,{variant:"subtitle1",children:"Select up to three affixes to activate on the item, each affix increases dust cost dramatically. The remaining affixes will be selected randomly from the remaining affixes."}),(0,r.jsx)(Zr.Z,{children:y.map((function(e){return(0,r.jsx)(Sr.Z,{control:(0,r.jsx)(wr.Z,{disabled:c.length>=3&&!c.includes(e.type),onChange:function(n){var t=c.filter((function(n){return n!==e.type}));n.target.checked&&t.push(e.type),u(t)}}),label:(0,B.xq)(e)},e.type)}))})]}),(0,r.jsx)(dn.Z,{variant:"contained",disabled:t||!v||0===c.length,loading:t,onClick:(g=Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t&&v&&0!==c.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,m({variables:{item:v.id,artifact:p.id,affixes:c}});case 4:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var i=g.apply(e,n);function o(e){Ar(i,t,r,o,a,"next",e)}function a(e){Ar(i,t,r,o,a,"throw",e)}o(void 0)}))}),children:"Imbue item"})]})}function Ir(e){var n=e.hero,t=e.disabled,o=(0,i.useState)("1"),a=o[0],l=o[1],u=n.inventory.some((function(e){return"pure-essence"===e.baseItem})),m=n.inventory.some((function(e){return"essence-of-void"===e.baseItem})),f=u&&m&&null!==n.equipment.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(c.Z,{sx:{margin:2}}),(0,r.jsx)(h.Z,{variant:"h2",component:"h4",color:"secondary",children:"Crafting"}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchanting Dust:"," ",(0,r.jsx)("span",{id:"hero-stats-enchanting-dust",children:n.enchantingDust.toLocaleString()})]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchantments:"," ",(0,r.jsx)("span",{id:"hero-stats-enchantments",children:n.enchantments.length.toLocaleString()})]}),(0,r.jsx)("br",{}),(0,r.jsx)(x.ZP,{value:a,children:(0,r.jsxs)(s.Z,{sx:{flexGrow:1,borderBottom:1,borderColor:"divider",display:"flex"},children:[(0,r.jsxs)(p.Z,{orientation:"vertical",onChange:function(e,n){return l(n)},"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",sx:{flexShrink:0,flexGrow:0,width:"100px"},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(qn.Z,{}),label:"Destroy",value:"1"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(ir.Z,{}),label:"Disenchant",value:"2"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(rr.Z,{}),label:"Enchant",value:"3"}),f&&(0,r.jsx)(d.Z,{icon:(0,r.jsx)(rr.Z,{}),label:"Imbue",value:"4"})]}),(0,r.jsxs)(g.Z,{value:"1",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Destroy Items"}),(0,r.jsx)(cr,{hero:n,disabled:t})]}),(0,r.jsxs)(g.Z,{value:"2",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Disenchant Items"}),(0,r.jsx)(jr,{hero:n,disabled:t})]}),(0,r.jsxs)(g.Z,{value:"3",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Enchant Items"}),(0,r.jsx)(xr,{hero:n,disabled:t})]}),f&&(0,r.jsxs)(g.Z,{value:"4",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Imbue Items"}),(0,r.jsx)(Cr,{hero:n,disabled:t})]})]})})]})}function Lr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1){var r=f.find((function(n){return(0,B.GJ)(n)===t&&n.id!==e}));r&&(x.push(r),v[t]-=1)}}})),x.sort(B.v4),(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"".concat(o,"-equip-select-label"),children:a}),(0,r.jsx)($.Z,{id:"".concat(o,"-equip-select"),labelId:"".concat(o,"-equip-select-label"),value:c||"",label:a,disabled:s,onChange:function(e){m(e.target.value),l(o,e.target.value)},children:x.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:u.indexOf(e.id)>=0,children:[e.id===c?(0,r.jsx)("b",{children:(0,B.GJ)(e)}):(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),v[(0,B.GJ)(e)]>1&&-1===u.indexOf(e.id)?" x".concat(v[(0,B.GJ)(e)]):""]}),(0,r.jsxs)(h.Z,{variant:"caption",sx:{color:"info.secondary"},children:["\xa0Lvl. ",e.level]}),e.enchantment&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"info.main"},children:["\xa0",(0,B.Lt)(e.enchantment)]})]},e.id)}))})]})})})}function Tr(e){var n=e.hero,t=e.disabled,o=e.onChange,a=(0,i.useState)(""),l=a[0],s=a[1],c=n.inventory.filter((function(e){return e.type===q.$7.Quest})).sort((function(e,n){return n.level-e.level})),u="Quest items (passive, always active)",d=n.inventory.find((function(e){return e.id===l}));(0,i.useEffect)((function(){l.length&&!d&&s("")}),[d,l]);var m={};c.forEach((function(e){var n=(0,B.GJ)(e);m[n]?m[n]+=1:m[n]=1}));var f=Object.keys(m).map((function(e){return c.find((function(n){return(0,B.GJ)(n)===e}))}));return(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"quest-item-label",children:u}),(0,r.jsx)($.Z,{id:"quest-item",labelId:"quest-item-label",value:l,label:u,disabled:t,onChange:function(e){if(s(e.target.value),o){var n=c.find((function(n){return n.id===e.target.value}));n&&o(n.baseItem)}},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),m[(0,B.GJ)(e)]>1?" x".concat(m[(0,B.GJ)(e)]):""]}),"???"!==(0,B.Lt)(e.baseItem)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e.baseItem)]})]},e.id)}))})]})})})}function Mr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0;if(!N)return null;function H(e,n){return U.apply(this,arguments)}function U(){return(U=Gr(Z().mark((function e(n,t){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W({variables:{item:t,slot:n}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h3",sx:{fontSize:"1.2rem"},children:"Equipped items"})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"leftHand",label:"Left Hand",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"rightHand",label:"Right Hand",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"bodyArmor",label:"Body Armor",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"handArmor",label:"Gauntlets",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"legArmor",label:"Leggings",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"headArmor",label:"Helmets",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"footArmor",label:"Greaves",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Tr,{hero:N,disabled:Q,onChange:R})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:!!N.buffs.blessing&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:(0,B.uD)(N.buffs.blessing)}),(0,r.jsx)(h.Z,{variant:"body1",children:(0,r.jsx)("b",{children:(0,B.Lt)(N.buffs.blessing)})})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,children:(0,r.jsx)(Y,{title:null===(e=N.equipment.artifact)||void 0===e?void 0:e.name,artifact:N.equipment.artifact})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.leftHand?(0,B.GJ)(N.equipment.leftHand,null):null,artifact:null===(n=N.equipment.leftHand)||void 0===n||null===(t=n.imbue)||void 0===t?void 0:t.artifact,affixes:null===(o=N.equipment.leftHand)||void 0===o||null===(a=o.imbue)||void 0===a?void 0:a.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.rightHand?(0,B.GJ)(N.equipment.rightHand,null):null,artifact:null===(l=N.equipment.rightHand)||void 0===l||null===(s=l.imbue)||void 0===s?void 0:s.artifact,affixes:null===(c=N.equipment.rightHand)||void 0===c||null===(u=c.imbue)||void 0===u?void 0:u.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.bodyArmor?(0,B.GJ)(N.equipment.bodyArmor,null):null,artifact:null===(d=N.equipment.bodyArmor)||void 0===d||null===(f=d.imbue)||void 0===f?void 0:f.artifact,affixes:null===(v=N.equipment.bodyArmor)||void 0===v||null===(x=v.imbue)||void 0===x?void 0:x.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.handArmor?(0,B.GJ)(N.equipment.handArmor,null):null,artifact:null===(p=N.equipment.handArmor)||void 0===p||null===(g=p.imbue)||void 0===g?void 0:g.artifact,affixes:null===(y=N.equipment.handArmor)||void 0===y||null===(b=y.imbue)||void 0===b?void 0:b.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.legArmor?(0,B.GJ)(N.equipment.legArmor,null):null,artifact:null===(j=N.equipment.legArmor)||void 0===j||null===(S=j.imbue)||void 0===S?void 0:S.artifact,affixes:null===(w=N.equipment.legArmor)||void 0===w||null===(k=w.imbue)||void 0===k?void 0:k.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.headArmor?(0,B.GJ)(N.equipment.headArmor,null):null,artifact:null===(A=N.equipment.headArmor)||void 0===A||null===(P=A.imbue)||void 0===P?void 0:P.artifact,affixes:null===(C=N.equipment.headArmor)||void 0===C||null===(I=C.imbue)||void 0===I?void 0:I.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.footArmor?(0,B.GJ)(N.equipment.footArmor,null):null,artifact:null===(L=N.equipment.footArmor)||void 0===L||null===(E=L.imbue)||void 0===E?void 0:E.artifact,affixes:null===(O=N.equipment.footArmor)||void 0===O||null===(F=O.imbue)||void 0===F?void 0:F.affixes})})]})}),N.level===N.levelCap&&(0,B.jr)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(tr,{hero:N,disabled:Q})}),(0,B.OB)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ir,{hero:N,disabled:Q})}),(0,B.jj)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Or,{hero:N,disabled:Q})})]})})}function Br(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(Bt,{}),T&&T.currentQuest&&(0,r.jsx)(zr,{event:T.currentQuest})]}),(0,r.jsxs)(s.Z,{sx:{width:"100%",typography:"body1"},children:[(0,r.jsxs)(x.ZP,{value:E,children:[(0,r.jsxs)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:[(0,r.jsx)(h.Z,{variant:"h1",sx:y.Z,children:"Navigation"}),(0,r.jsxs)(p.Z,{onChange:function(e,n){"play"===n?Z.push("/play","/play",{scroll:!1}):Z.push("/play/".concat(n),"/play/".concat(n),{scroll:!1}),O(n)},"aria-label":"navigation tabs",variant:"scrollable",children:[(0,r.jsx)(d.Z,{label:"Welcome",value:"play"}),(0,r.jsx)(d.Z,{label:"Combat",value:"combat"}),!(!(null===T||void 0===T?void 0:T.inventory.length)&&!(null===T||void 0===T?void 0:T.gold))&&(0,r.jsx)(d.Z,{label:"Shop",value:"shop"}),!!(null===T||void 0===T?void 0:T.inventory.length)&&(0,r.jsx)(d.Z,{label:"Inventory",value:"inventory"}),(0,r.jsx)(d.Z,{label:"Map",value:"map"}),T&&Object.values(T.questLog).filter((function(e){return!!e})).length>2&&(0,r.jsx)(d.Z,{label:"Quests",value:"quests"}),W&&(0,r.jsx)(d.Z,{label:"Settings",value:"settings"}),M===q.Ks.Admin&&(0,r.jsx)(d.Z,{label:"Admin",value:"admin"})]})]}),(0,r.jsx)(g.Z,{value:"play",children:(0,r.jsxs)(m.ZP,{container:!0,columns:12,spacing:4,children:[(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:7,md:8,children:[(0,r.jsxs)(h.Z,{variant:"h2",sx:{mb:2,fontSize:"1.8rem"},children:["Welcome to ",(0,r.jsx)("b",{children:"Proof of Combat"}),"!"]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",sx:y.Z,children:["This text is only available to screen readers. Thank you for trying out my game! If you find any parts of the user interface that are difficult to navigate please let me know and I would love to improve them.",(0,r.jsx)("br",{}),(0,r.jsx)(v.Z,{href:"https://github.com/chrisinajar/proofofcombat/wiki/Screen-Readers-and-Accessibility",target:"_blank",rel:"noreferrer",children:"Check this wiki page for more details on accessibility"})]}),(0,r.jsx)(h.Z,{sx:{mb:2},children:"This game is once again being developed actively. It's been a long time coming and there's a lot of major changes to the underlying engine in order to unlock cooler and more interesting mechanics for the game."}),(0,r.jsx)(h.Z,{variant:"h4",sx:y.Z,children:"Discord Server"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["If you'd like to talk more with other players, report bugs, or discuss upcoming features,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://discord.gg/t7AZSxvfJG",target:"_blank",rel:"noreferrer",children:"join the discord!"})]}),(0,r.jsx)(h.Z,{variant:"h4",sx:y.Z,children:"Game Wiki"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["A great deal of the game is undocumented, but the parts which are documented can be found,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://github.com/chrisinajar/proofofcombat/wiki/",target:"_blank",rel:"noreferrer",children:"in the wiki"}),". The game is nearly impossible to 100% without consulting the wiki."]}),(0,r.jsx)(h.Z,{variant:"h5",sx:{mb:2},children:"Combat Stats"}),(null===T||void 0===T?void 0:T.combatStats)&&(0,r.jsx)(_r,{skills:T.skills,stats:T.combatStats})]}),(null===F||void 0===F?void 0:F.leaderboard)&&(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:5,md:4,children:[(0,r.jsx)(h.Z,{variant:"h6",children:"Leaderboard"}),(0,r.jsx)("ul",{id:"leaderboard-list",children:F.leaderboard.slice(0,20).map((function(e,n){return(0,r.jsxs)("li",{id:"leaderboard-list-".concat(n),children:[(0,r.jsx)("b",{id:"leaderboard-list-".concat(n,"-name"),children:e.name})," ","(",(0,B.qh)(e.class),")"]},e.id)}))})]})]})}),(0,r.jsxs)(g.Z,{value:"combat",children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Combat"}),(0,r.jsx)(h.Z,{children:"Challenge a monster from the list, then fight it to the death. Note that other players in the same location see the same monster lists, so they may get to it first!"}),(0,r.jsx)("br",{}),(0,r.jsx)(Fe,{})]}),(0,r.jsx)(g.Z,{value:"shop",children:(0,r.jsx)(Vt,{})}),(0,r.jsx)(g.Z,{value:"inventory",children:(0,r.jsx)(Dr,{})}),(0,r.jsx)(g.Z,{value:"map",children:(0,r.jsx)(Ft,{})}),(0,r.jsx)(g.Z,{value:"quests",children:(0,r.jsx)(Kr,{})}),(0,r.jsx)(g.Z,{value:"settings",children:(0,r.jsx)(mi,{})}),(0,r.jsx)(g.Z,{value:"admin",children:(0,r.jsx)(xi,{})})]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsx)(re,{})]})]})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{7536:function(e,n,t){t.d(n,{Z:function(){return pi}});var r=t(5893),i=t(7294),o=t(1163),a=t(5152),l=t.n(a),s=t(5616),c=t(7720),u=t(1458),d=t(44),h=t(5861),m=t(6886),f=t(9200),v=t(4373),x=t(5670),p=t(5511),g=t(5023),y=t(375),b=t(7998),j=t(4051),Z=t.n(j),S=t(3920),w=t(8445),k=t(5739),A=t(9496),P=t(5662),C=t(7109),I=t(3946),L=t(4054),E=t(3841),O=t(7058),F=t(1292),T=t(6664),M=t(6824),W=t(622),G=t(4510),q=t(7952);function D(){var e,n,t,r=(0,q.UE)({fetchPolicy:"cache-only"}).data;return null!==(t=null===r||void 0===r||null===(e=r.me)||void 0===e||null===(n=e.account)||void 0===n?void 0:n.hero)&&void 0!==t?t:void 0}var B=t(9238),$=t(5018),z=t(3599),R=t(1903);function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Received offers:",(0,r.jsx)(s.Z,{children:F.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["From: ",(0,r.jsx)("b",{children:e.fromName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"success",disabled:I||e.gold>o.gold,onClick:function(){return function(e){return Q.apply(this,arguments)}(e.id)},children:"Accept Trade"}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"error",disabled:I,onClick:function(){return D(e.id)},children:"Reject Trade"})]})},e.id)}))})]}),T.length>0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Sent offers:",(0,r.jsx)(s.Z,{children:T.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["To: ",(0,r.jsx)("b",{children:e.toName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{variant:"contained",color:"error",disabled:I,onClick:function(){return D(e.id)},children:"Cancel Trade"})]})},e.id)}))})]})]})]})}function Y(e){var n=e.artifact,t=e.title,o=e.affixes,a=e.sx,l=e.children;if(!n||!t)return null;var s=(0,B.Vy)(n),c=function(e,n){return(0,r.jsx)(h.Z,{variant:"body1",sx:a,children:(0,r.jsx)("b",{children:e})},n)};return"function"===typeof l&&(c=l),(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:t}),s.map((function(e){return o&&!o.includes(e.type)?null:c((0,B.xq)(e),e.type)}))]})}function K(e){var n=e.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h4",children:n.name}),"A mysterious magical item with the following properties:",(0,r.jsx)(Y,{artifact:n})]})}function V(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t200&&$(j.slice(0,200))}),[j.length]),(0,i.useEffect)((function(){var e;if(!ce.current&&(null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token)){var n={drop:"error",artifact:"warning",quest:"success",settlement:"info"};return ce.current=(0,S.io)(te,{withCredentials:!0,auth:{token:m.chat.token}}),ce.current.on("hello",(function(e){$(e.chat)})),ce.current.on("chat",(function(e){console.log("Got chat event!",e),$((function(n){return[e].concat(ne(n))}))})),ce.current.on("notification",(function(e){var t,r;e.item&&(e.message=e.message.replace("{{item}}",(0,B.GJ)(e.item))),"drop"===e.type||"artifact"===e.type?e.item?c("You found ".concat((0,B.GJ)(e.item)),{variant:"success"}):e.artifactItem?(c("You found ".concat(e.artifactItem.name),{variant:"success"}),se(e.artifactItem)):c(e.message,{variant:"success"}):"settlement"!==e.type&&c(e.message,{variant:"info"}),$((function(i){return[{type:null!==(t=e.type)&&void 0!==t?t:"notification",id:Math.random(),time:Date.now()/1e3,message:"",from:e.message,color:null!==(r=n[e.type])&&void 0!==r?r:"secondary",variant:"body1"}].concat(ne(i))}))})),ce.current.on("system-message",(function(e){c(e.message,{variant:"warning"}),$((function(n){return[{type:"system",id:Math.random(),time:Date.now()/1e3,message:e.message,from:"",color:e.color,variant:"h6"}].concat(ne(n))}))})),function(){ce.current&&(ce.current.disconnect(),ce.current=void 0)}}}),[null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token]);var ue=a(H);function de(){return he.apply(this,arguments)}function he(){return(he=X(Z().mark((function e(){var n;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ce.current){e.next=2;break}return e.abrupt("return");case 2:if("private"!==(n=ie[V]).type){e.next=7;break}return ce.current.emit("private-chat",{to:n.heroId,message:H},(function(e){console.log("Got a confirmation!",e),$((function(n){return[e].concat(ne(n))}))})),U(""),e.abrupt("return");case 7:ce.current.emit("chat",{message:H},(function(e){console.log("Got a reply!",e),$((function(n){return[e].concat(ne(n))}))})),U("");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me,fe=j.filter((function(e){if("all"===V)return!0;if("chat"===V)return"chat"===e.type||"private"===e.type||"system"===e.type;if("notifications"===V)return"notification"===e.type||"drop"===e.type||"quest"===e.type||"system"===e.type;var n=ie[V];return!n||"private"===n.type&&("private"===e.type&&(e.heroId===n.heroId||e.to===n.heroId))})),ve=R?"Max message: ".concat(140-ue.length,"/").concat(140):"Type here...";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(T.Z,{open:!(null===u||void 0===u?void 0:u.currentQuest)&&!!le,onClose:function(){return se(!1)},children:(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},children:le&&(0,r.jsx)(K,{artifact:le})})}),(0,r.jsx)(x.ZP,{value:V,children:(0,r.jsx)(p.Z,{onChange:function(e,n){v&&g(!1),_(n)},"aria-label":"navigation tabs",variant:"scrollable",children:Object.keys(ie).map((function(e){return(0,r.jsx)(d.Z,{label:e,value:e},e)}))})}),"notifications"!==V&&(0,r.jsxs)(L.Z,{sx:{marginTop:1},fullWidth:!0,variant:"outlined",children:[(0,r.jsx)(E.Z,{htmlFor:"chat-input",children:ve}),(0,r.jsx)(O.Z,{disabled:!(null===(n=ce.current)||void 0===n?void 0:n.connected),value:H,id:"chat-input",name:"Chat input",label:ve,placeholder:"Type here...",onChange:function(e){var n=e.target.value;a(n).length<=140&&U(n)},onFocus:function(){return N(!0)},onBlur:function(){return N(!1)},autoComplete:"off",onKeyPress:function(e){"Enter"!==e.key||de()},endAdornment:(0,r.jsxs)(C.Z,{position:"end",children:[(0,r.jsx)(F.Z,{title:"Send message",children:(0,r.jsx)(I.Z,{"aria-label":"send chat",onClick:de,children:(0,r.jsx)(M.Z,{})})}),"private"===(null===(t=ie[V])||void 0===t?void 0:t.type)&&(0,r.jsx)(F.Z,{title:v?"Cancel trade":"Trade with player",children:(0,r.jsxs)(I.Z,{onClick:function(){return g(!v)},children:[v&&(0,r.jsx)(G.Z,{}),!v&&(0,r.jsx)(W.Z,{})]})})]})})]}),v&&u&&(null===(o=ie[V])||void 0===o?void 0:o.heroId)&&(0,r.jsx)(J,{hero:u,to:null!==(me=ie[V].heroId)&&void 0!==me?me:""}),(0,r.jsx)(s.Z,{sx:{padding:1,minHeight:"600px",bgcolor:"background.paper"},children:fe.map((function(e){return(0,r.jsxs)(h.Z,{variant:e.variant||"body1",sx:{color:"".concat("private"===e.type?"secondary":e.color||"text",".main")},children:[e.time&&(0,r.jsxs)(h.Z,{variant:"caption","aria-hidden":"true",children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]}),e.heroId&&(0,r.jsx)(P.Z,{onClick:function(){e.heroId&&l(e.from,e.heroId)},sx:{color:"inherit",textTransform:"none",paddingTop:0,paddingBottom:0,paddingLeft:1,paddingRight:.5,margin:0},children:(0,r.jsxs)("b",{children:[e.from,":"]})}),!e.heroId&&(0,r.jsx)("b",{children:e.from})," ",(0,w.emojify)(e.message)," ",e.time&&(0,r.jsxs)(h.Z,{variant:"caption",sx:y.Z,children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]})]},e.id)}))}),(0,r.jsx)("br",{})]})}var ie=t(1409),oe=t(737);function ae(){var e,n=D(),t=(0,q.W1)({variables:(null===n||void 0===n?void 0:n.location)?{location:{x:n.location.x,y:n.location.y,map:n.location.map}}:void 0,skip:!(null===n||void 0===n?void 0:n.location)}).data;return null!==(e=null===t||void 0===t?void 0:t.locationDetails)&&void 0!==e?e:null}function le(){var e=ae(),n=(null===e||void 0===e?void 0:e.specialLocations)||[];return n.length?n[0]:null}var se,ce=t(2734),ue=t(6012),de=t(5499),he=t(8698),me=t(7600),fe=t(5826);function ve(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var xe,pe=(ve(se={},q.zP.Fire,"Fireball"),ve(se,q.zP.Ice,"Blizzard"),ve(se,q.zP.Lightning,"Lightning Bolt"),se),ge=(ve(xe={},q.zP.Normal,"Normal stance with no pros or cons."),ve(xe,q.zP.Reckless,"Double accuracy but makes you twice as easy to hit."),ve(xe,q.zP.Fire,"Converts 20% of magic damage into Fire damage."),ve(xe,q.zP.Ice,"Converts 20% of magic damage into Ice damage."),ve(xe,q.zP.Lightning,"Converts 20% of magic damage into Lightning damage."),xe);function ye(e){var n,t=D(),o=(0,i.useState)((null===t||void 0===t?void 0:t.activeStance)||q.zP.Normal),a=o[0],l=o[1];if(!t)return null;var s=t.availableStances.map((function(e){return{name:null!==(n=pe[e])&&void 0!==n?n:e,stance:e,tooltip:ge[e]}}));return s.length<2?null:(0,r.jsx)(m.ZP,{item:!0,xs:12,children:(0,r.jsxs)(m.ZP,{container:!0,sx:{textAlign:"center"},columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h5",children:"Select Combat Style"})}),s.map((function(n){return(0,r.jsx)(m.ZP,{item:!0,lg:1,md:2,sm:3,xs:6,children:(0,r.jsx)(F.Z,{title:n.tooltip,children:(0,r.jsx)(P.Z,{variant:a===n.name?"outlined":"text",sx:{fontSize:"1rem",padding:2},size:"large",id:"set-stance-".concat(n.name.toLowerCase()),onClick:function(){return function(n){l(n),e.onChange&&e.onChange(n)}(n.stance)},"aria-label":"set stance ".concat(n.name),children:n.name})})},n.name)}))]})})}function be(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(l?"Auto-Battling":"Battling"),D<=0&&"Dead"," ",f.name]}),(0,r.jsx)(u.Z,{variant:"determinate",value:D,color:"error"})]}),D>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your melee weapons, uses strength and dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-melee",onClick:function(){return _(q.hK.Melee)},"aria-label":"melee attack",startIcon:(0,r.jsx)(ue.Z,{}),children:"Melee attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your ranged weapons, uses dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-ranged",onClick:function(){return _(q.hK.Ranged)},"aria-label":"ranged attack",startIcon:(0,r.jsx)(de.Z,{}),children:"Ranged attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Cast spells using your wisdom and intelligence",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-cast",onClick:function(){return _(q.hK.Cast)},"aria-label":"cast spell",startIcon:(0,r.jsx)(he.Z,{}),children:"Cast Spell"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Smite your foe using wisdom and willpower",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-holy",onClick:function(){return _(q.hK.Smite)},"aria-label":"holy attack",startIcon:(0,r.jsx)(me.Z,{}),children:"Smite"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:6,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Damage yourself to damage the enemy, uses constitution",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-blood",onClick:function(){return _(q.hK.Blood)},"aria-label":"blood magic",startIcon:(0,r.jsx)(fe.Z,{}),children:"Blood magic"})})})]})]}),S&&"This enemy was killed by another player",Q&&Q.log.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[e.damage<0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," heals"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-heal"),children:(0-e.damage).toLocaleString()})," ","health from their enchantments"]}),e.damage>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," dealt"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-damage"),children:e.damage.toLocaleString()})," ","enchantment damage to ",(0,r.jsx)("b",{children:e.to})]})]}),!e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," ".concat(Ae(e.attackType,e.success,e.critical)," "),(0,r.jsx)("b",{children:e.to}),e.success?" for ".concat(e.damage.toLocaleString()," ").concat(e.damageType?e.damageType.toLowerCase():""," damage!"):"."]})]})},"".concat(e.from,"-").concat(n))})),Q&&Q.victory&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"fight-did-win",children:[f.name," has been killed!",(Q.experience||Q.gold)&&" You gain ",Q.gold&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-gold",children:Q.gold.toLocaleString()})," ","gold"]}),Q.gold&&Q.experience&&" and",Q.experience&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-experience",children:Q.experience.toLocaleString()})," ","experience"]}),(Q.experience||Q.gold)&&"!! ",Q.didLevel&&(0,r.jsx)("b",{id:"fight-level-up",children:"You leveled up!!"})]}),Q.drop&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{id:"fight-got-drop",variant:"h5",children:["You find an enchanted item on the monster's corpse!",(0,r.jsx)("br",{}),(0,B.GJ)(Q.drop)]})]}),(0,r.jsx)("br",{}),V&&(0,r.jsx)(P.Z,{fullWidth:!0,color:"secondary",variant:"contained",onClick:function(){p&&p(f.id,R)},children:"Auto-Battle this enemy"})]})]})]})}function Ae(e,n,t){switch(e){case q.hK.Blood:return n?t?"surges with blood magic against":"lets blood and casts forth towards":"attempts to cast a spell against";case q.hK.Smite:return n?t?"summons powers beyond this world against":"smites":"attempts to smite";case q.hK.Cast:return n?t?"carefully casts a spell at":"blasts a beam of necrotic energy into":"attempts to cast a spell against";case q.hK.Ranged:return n?t?"lands a sneak attack from the shadows, critically damaging":"fires an arrow at":"shoots an arrow but it misses";case q.hK.Melee:default:return n?t?"lands a crippling blow against":"struck":"missed"}}function Pe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t.5?100*Math.random():y[0],Math.random()>.5?100*Math.random():y[1],Math.random()>.5?100*Math.random():y[2]]),0===x){e.next=4;break}return e.abrupt("return");case 4:if(!(Fe||N>0)){e.next=6;break}return e.abrupt("return");case 6:if(0!==(null===ye||void 0===ye?void 0:ye.combat.health)){e.next=9;break}return console.log("[AutoBattler] Healing!"),e.abrupt("return",Te());case 9:if(Pe&&0!==Pe.monster.combat.health&&Pe.monster.id===C){e.next=13;break}return console.log("[AutoBattler] Challenging new mob!"),qe(C),e.abrupt("return");case 13:if(!Pe||!Se.current){e.next=17;break}return console.log("[AutoBattler] Fighting ".concat(l,"!")),Se.current(l),e.abrupt("return");case 17:console.log("[AutoBattler] Doing nothing...");case 18:case"end":return e.stop()}}),e)}))),(0,i.useEffect)((function(){if(w&&C.length){var e=(0,ie.Zi)((function(){j.current()}),500);return function(){(0,ie.cv)(e)}}}),[w,Oe]),(0,i.useEffect)((function(){var e;if(null===se||void 0===se||null===(e=se.monsters)||void 0===e?void 0:e.length){var n=se.monsters.concat().sort((function(e,n){return e.monster.level-n.monster.level}));if(""===K)V(n[0].id);else se.monsters.find((function(e){return e.id===K}))||V(n[0].id)}}),[K,null===se||void 0===se||null===(n=se.monsters)||void 0===n?void 0:n.length]);var ze=null===se||void 0===se||null===(t=se.monsters)||void 0===t?void 0:t.find((function(e){return e.id===K}));ze||(K="");var Re=Ae.find((function(e){return e.id===te}));if(Ae.find((function(e){return e.id===X}))||(X=""),!ye)return null;ye.levelCap>100||(ge=ge.slice(0,ye.level)),Ae=Ae.filter((function(e){return e.combat.health>0}));var Ne="Select a new monster to challenge",Qe="Fight an existing monster!",He="Duel with a nearby player!";return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:4,children:[!w&&ye&&ye.combat.health>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"challenge-monster-select-label",children:Ne}),(0,r.jsx)($.Z,{id:"challenge-select",labelId:"challenge-monster-select-label",value:U,label:Ne,disabled:w,onChange:function(e){return J(e.target.value)},children:ge.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[e.name,"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Tier ",e.level]})]},e.id)}))}),(0,r.jsx)(P.Z,{id:"challenge-button",disabled:!U||N>0||fe||w,onClick:function(){return Ge.apply(this,arguments)},variant:"contained",children:"Challenge!"})]})}),(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"fight-monster-select-label",children:Qe}),(0,r.jsx)($.Z,{id:"fight-select",labelId:"fight-monster-select-label",value:K,label:Qe,disabled:w,onChange:function(e){return V(e.target.value)},children:(null===se||void 0===se?void 0:se.monsters)&&Ee(null===se||void 0===se?void 0:se.monsters).sort((function(e,n){return e.monster.level-n.monster.level})).map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:0===e.monster.combat.health,children:[0===e.monster.combat.health&&"Dead ",e.monster.name]},e.id)}))}),(0,r.jsx)(P.Z,{id:"fight-button",disabled:!K||N>0||fe||ze&&0===ze.monster.combat.health||w,onClick:function(){return We.apply(this,arguments)},variant:"contained",children:"Fight!"})]})}),Ae.length>1&&(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"duel-select-label",children:He}),(0,r.jsx)($.Z,{id:"duel-select",labelId:"duel-select-label",value:X,label:He,disabled:w,onChange:function(e){return ee(e.target.value)},children:Ae.filter((function(e){return e.id!==ye.id})).sort((function(e,n){return e.level-n.level})).map((function(e){return(0,r.jsx)(z.Z,{value:e.id,children:e.name},e.id)}))}),(0,r.jsx)(P.Z,{id:"duel-button",disabled:!X.length||N>0||fe||w,onClick:function(){return $e.apply(this,arguments)},variant:"contained",children:"Duel Player!"})]})})]}),w&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[(0,r.jsx)(u.Z,{sx:{margin:1,color:"#f00"},variant:"determinate",value:y[0],color:"inherit"}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#0f0"},variant:"determinate",value:y[1]}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#00f"},variant:"determinate",value:y[2]}),(0,r.jsx)(P.Z,{fullWidth:!0,variant:"contained",color:"error",size:"large",onClick:function(){return k(!1)},children:"Disable Auto-Battle"})]}),ye&&ye.combat.health<=0&&(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(h.Z,{id:"you-are-dead",children:"You are dead."})}),Pe&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(ke,{hero:ye,fight:Pe,onError:function(){ue(),G(null)},autoBattle:w,canAutoBattle:Ce,onAutoBattle:function(e,n){return Be.apply(this,arguments)},fightMutationRef:Se,onVictory:function(){return f(d+1)}},"".concat(Pe.id,"-").concat(F))}),Re&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(ke,{hero:ye,fight:{id:Re.id,monster:Re},onError:function(){ue(),G(null)},duel:!0,autoBattle:!1,canAutoBattle:!1},"".concat(Re.id,"-").concat(F))}),(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(P.Z,{id:"heal-button",fullWidth:!0,onClick:Te,variant:"contained",disabled:N>0||fe||ye&&ye.combat.health===ye.combat.maxHealth,children:"Heal"})})]})})}var Te=t(1514);function Me(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(h.Z,{sx:{mb:2},variant:"body1",color:o?"success.main":"error.main",children:s}),n.trades.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(Ve,{trade:e}),(0,r.jsx)(P.Z,{disabled:f,onClick:function(){return function(e){return v.apply(this,arguments)}(e.id)},sx:{ml:1},children:"Trade"})]})},"npc shop items ".concat(n))}))]})}function Ve(e){var n=e.trade;return(0,r.jsxs)(i.Fragment,{children:["For the price of ",(0,r.jsx)(_e,{price:n.price}),", I'll give you"," ",(0,r.jsx)(_e,{price:n.offer})]})}function _e(e){var n=e.price;return(0,r.jsx)(F.Z,{title:Xe(n),describeChild:!0,children:(0,r.jsx)(Qe.Z,{style:{background:"none",border:"none"},"aria-label":Xe(n),children:n.description})})}function Xe(e){var n,t,r,i=[];return e.gold&&i.push("".concat(e.gold.toLocaleString()," gold")),e.dust&&i.push("".concat(e.dust.toLocaleString()," dust")),(null===(n=e.baseItems)||void 0===n?void 0:n.length)&&e.baseItems.forEach((function(e){i.push("".concat(e))})),(null===(t=e.enchantments)||void 0===t?void 0:t.length)&&e.enchantments.forEach((function(e){i.push("".concat((0,B.uD)(e)))})),(null===(r=e.questItems)||void 0===r?void 0:r.length)&&e.questItems.forEach((function(e){i.push("".concat(e))})),i.length?i.join(", "):"???"}var en=t(3020),nn=t(6242),tn=t(2023),rn=t(9748),on=t(4267),an=t(657),ln=t(1425),sn=t(6580),cn=t(8951),un=t(3090),dn=t(1812),hn=t(7855),mn=t(3707),fn=t(5843),vn=t(1233);function xn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);to?"error":"",component:"span","aria-label":"Upkeep: ".concat(l),children:[" ","-",l.toLocaleString()]})]},i)}))})}function In(e){var n,t=e.hero,i=e.camp,o=function(e){var n,t;return null!==(t=null===(n=e.find((function(e){return"gold"===e.name})))||void 0===n?void 0:n.value)&&void 0!==t?t:0},a=wn((0,q.Th)(),2),l=a[0],c=a[1].loading,u=(0,q.Hk)(),d=u.data,f=u.refetch,v=null!==(n=null===d||void 0===d?void 0:d.availableUpgrades)&&void 0!==n?n:[],x=wn((0,oe.gZ)(),1)[0]>0;if(!v.length)return null;function p(){return(p=Sn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l({variables:{upgrade:n}});case 3:return e.next=5,f();case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var g=!!i.upgrades.find((function(e){return e===q.gT.Settlement}));return(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{variant:"h6",children:[g?"Settlement":"Camp"," Upgrades"]}),(0,r.jsx)(m.ZP,{container:!0,columns:6,spacing:2,children:v.map((function(e){return(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsxs)(nn.Z,{variant:"outlined",children:[(0,r.jsx)(rn.Z,{title:e.name}),(0,r.jsx)(on.Z,{children:(0,r.jsxs)(h.Z,{variant:"body2",color:"text.secondary",children:["Cost:"," ",e.cost.map((function(e){return"".concat(e.value.toLocaleString()," ").concat((0,en.words)(e.name))})).join(", ")]})}),(0,r.jsx)(tn.Z,{children:(0,r.jsx)(dn.Z,{disabled:x,loading:c,sx:{m:1},variant:"outlined",color:o(e.cost)>t.gold?"error":"success",onClick:function(){return function(e){return p.apply(this,arguments)}(e.type)},children:"Purchase"})})]})},e.type)}))})]})}function Ln(e){e.hero,e.camp;return null}var En=t(1730),On=t(2613),Fn=t(3054),Tn=t(7563),Mn=t(6398),Wn=t(6667),Gn=t(3898),qn=t(1733),Dn=t(1671),Bn=t(1749),$n=t(4231);function zn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Rn(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t=s||d.find((function(e){return e.x===t&&e.y===o}))?null:d.find((function(e){return e.x===t+1&&e.y===o||e.x===t-1&&e.y===o||e.x===t&&e.y===o+1||e.x===t&&e.y===o-1}))?{x:t,y:o,map:a.location.map}:null}),[d.length,t,o,s]);function m(){return(m=Yn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u({variables:{location:n,type:l}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return h?(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Hn,{onClick:function(){return function(e){return m.apply(this,arguments)}(h)},hover:!0,color:"rgb(10, 120, 10)",cellSize:n,boundingBox:c,location:h,tooltip:"Build here",icon:(0,r.jsx)(Fn.Z,{})},"".concat(h.x,"-").concat(h.y))}):null}function _n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0?(0,r.jsx)("li",{children:(0,r.jsx)(rt,{name:(0,en.words)(e.name),"aria-label":"".concat(e.value.toLocaleString()," out of ").concat((null!==(o=e.maximum)&&void 0!==o?o:0).toLocaleString()),value:"".concat(e.value.toLocaleString()," / ").concat((null!==(a=e.maximum)&&void 0!==a?a:0).toLocaleString())})},e.name):null}))]}),l.id===(null===(n=s.home)||void 0===n?void 0:n.id)&&(0,r.jsx)(In,{camp:l,hero:s}),l.type===q.oS.Settlement&&l.id!==(null===(t=s.home)||void 0===t?void 0:t.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This settlement is a former capital that has fallen. You can destroy this location and reclaim most of the resources."}),(0,r.jsx)(P.Z,{onClick:function(){return c(l)},variant:"contained",color:"error",children:"Destroy former settlement"})]}),l.type===q.oS.Barracks&&(0,r.jsx)(it,{location:l,action:"Recruit",unit:"troops",cost:1e6,loading:m,onPurchase:function(e){d({variables:e})}}),l.type===q.oS.Treasury&&(0,r.jsx)(it,{location:l,action:"Purchase",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:e})}}),l.type===q.oS.Treasury&&(0,r.jsx)(it,{location:l,action:"Sell",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:et({},e,{amount:0-e.amount})})}}),l.type===q.oS.Treasury&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(dn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!1}})},children:"Craft Element of Gold (1,000,000 bonds)"}),(0,r.jsx)(dn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!0}})},children:"Craft Greater Element of Gold (250,000,000 bonds)"})]}),l.type===q.oS.Garrison&&(0,r.jsx)(it,{location:l,action:"Build",unit:"fortifications",cost:1e6,loading:b,onPurchase:function(e){y({variables:e})}})]}):null}function rt(e){var n=e.name,t=e.value,i=e["aria-label"];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{style:{fontWeight:"bold"},htmlFor:"building-details-value-".concat(n),children:[n,":"]})," ",(0,r.jsx)("span",{"aria-label":i,children:t})]})}function it(e){var n=e.location,t=e.action,o=e.unit,a=e.cost,l=e.loading,s=void 0!==l&&l,c=e.onPurchase,u=(0,i.useState)(0),d=u[0],h=u[1],m=(nt((0,q.Up)(),1)[0],(0,oe.mu)()),f=Number.isFinite(d)&&!isNaN(d)&&d>0;return(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(R.Z,{onChange:function(e){return h(parseInt(e.target.value))},id:"".concat(t,"-input"),label:"Amount of ".concat(o," to ").concat(t.toLowerCase())}),(0,r.jsxs)(dn.Z,{loading:s,variant:"contained",disabled:!f||m,onClick:function(){Number.isFinite(d)&&!isNaN(d)&&c({location:{x:n.location.x,y:n.location.y,map:n.location.map},amount:d})},children:[!f&&"".concat(t," ").concat(o),f&&"".concat(t," ").concat(d.toLocaleString()," ").concat(o," for ").concat((d*a).toLocaleString()," gold")]})]})}var ot=t(89),at=t(6656),lt=t(8456);function st(e){var n,t,i,o=e.open,a=e.onClose,l=e.loading,c=e.attackResults,u=e.hero;return(0,r.jsx)(T.Z,{open:o,onClose:a,children:(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},"aria-labelledby":"attack-results-modal-title","aria-describedby":"modal-modal-description",children:[l&&(0,r.jsx)(lt.Z,{}),c&&(0,r.jsxs)(r.Fragment,{children:[c.target.owner===u.id&&(0,r.jsx)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:"Your troops have claimed this location in your name, it now belongs to your settlement."}),c.target.owner!==u.id&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:["Attack results for ",c.target.location.x,","," ",c.target.location.y]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",children:["Owner:"," ",(0,r.jsx)("strong",{children:null!==(i=null===c||void 0===c||null===(n=c.target)||void 0===n||null===(t=n.publicOwner)||void 0===t?void 0:t.name)&&void 0!==i?i:"Unknown"})]})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{children:["You lost ",ct(c.attackerCasualties)]}),(0,r.jsxs)(h.Z,{children:["Your opponent lost"," ",ct(c.targetCasualties)]}),c.totalDamage>0&&(0,r.jsxs)(h.Z,{children:["Your troops dealt ",c.totalDamage.toLocaleString()," ","damage"]}),c.damage>0&&(0,r.jsxs)(h.Z,{children:["The target location received"," ",c.damage.toLocaleString()," damage",c.totalDamage>c.damage&&", the rest was absorbed by garrisons."]}),0===c.damage&&(0,r.jsx)(h.Z,{children:"All damage was absorbed by garrisons."})]})]})})}function ct(e){var n=Object.keys(e).map((function(n){var t=e[n];return!!(t&&t>0)&&"".concat(t.toLocaleString()," ").concat(n)})).filter((function(e){return!!e}));return n.length?n.join(", "):"nothing"}function ut(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(I=null===(f=Oe.ghost)||void 0===f?void 0:f.value)&&void 0!==I?I:0).toLocaleString()})]})]}),ne&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h5",children:"Troups in this location"}),(0,r.jsxs)("ul",{children:[(null!==(L=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==L?L:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-enlisted",children:"Enlisted:"})," ",(0,r.jsx)("span",{id:"military-target-enlisted",children:(null!==(E=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==E?E:0).toLocaleString()})]}),(null!==(O=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==O?O:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-soldier",children:"Soldier:"})," ",(0,r.jsx)("span",{id:"military-target-soldier",children:(null!==(F=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==F?F:0).toLocaleString()})]}),(null!==(T=null===Le||void 0===Le?void 0:Le.value)&&void 0!==T?T:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-veteran",children:"Veteran:"})," ",(0,r.jsx)("span",{id:"military-target-veteran",children:(null!==(M=null===Le||void 0===Le?void 0:Le.value)&&void 0!==M?M:0).toLocaleString()})]}),(null!==(W=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==W?W:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(G=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==G?G:0).toLocaleString()})]})]}),(0,r.jsx)(h.Z,{mb:2,component:"h6",variant:"h5",children:"Troops to send"}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(vt,{name:"enlisted",value:le,onChange:se,max:Pe?null!==(D=null===(v=Oe.enlisted)||void 0===v?void 0:v.value)&&void 0!==D?D:0:Math.min(null!==(B=null===(x=Oe.enlisted)||void 0===x?void 0:x.value)&&void 0!==B?B:0,(null!==($=null===Ce||void 0===Ce?void 0:Ce.maximum)&&void 0!==$?$:0)-(null!==(z=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==z?z:0))}),(0,r.jsx)(vt,{name:"soldier",value:ue,onChange:de,max:Pe?null!==(R=null===(p=Oe.soldier)||void 0===p?void 0:p.value)&&void 0!==R?R:0:Math.min(null!==(N=null===(g=Oe.soldier)||void 0===g?void 0:g.value)&&void 0!==N?N:0,(null!==(Q=null===Ie||void 0===Ie?void 0:Ie.maximum)&&void 0!==Q?Q:0)-(null!==(H=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==H?H:0))}),(0,r.jsx)(vt,{name:"veteran",value:me,onChange:fe,max:Pe?null!==(U=null===(y=Oe.veteran)||void 0===y?void 0:y.value)&&void 0!==U?U:0:Math.min(null!==(J=null===(b=Oe.veteran)||void 0===b?void 0:b.value)&&void 0!==J?J:0,(null!==(Y=null===Le||void 0===Le?void 0:Le.maximum)&&void 0!==Y?Y:0)-(null!==(K=null===Le||void 0===Le?void 0:Le.value)&&void 0!==K?K:0))}),(0,r.jsx)(vt,{name:"ghost",value:xe,onChange:pe,max:Pe?null!==(V=null===(j=Oe.ghost)||void 0===j?void 0:j.value)&&void 0!==V?V:0:Math.min(null!==(_=null===(S=Oe.ghost)||void 0===S?void 0:S.value)&&void 0!==_?_:0,(null!==(X=null===Ee||void 0===Ee?void 0:Ee.maximum)&&void 0!==X?X:0)-(null!==(ee=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==ee?ee:0))})]}),Pe&&(0,r.jsx)(P.Z,{onClick:function(){return Fe.apply(this,arguments)},children:"Attack target"}),!Pe&&(0,r.jsx)(P.Z,{onClick:function(){ne&&je({variables:{target:{x:ne.location.x,y:ne.location.y,map:ne.location.map},units:{enlisted:le,soldier:ue,veteran:me,ghost:xe}}})},children:"Move troops"})]})]})}function vt(e){var n=e.name,t=e.onChange,i=e.value,o=e.max;return 0===o?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:1,children:(0,r.jsxs)("label",{id:"military-slider-".concat(n,"-label"),children:[(0,en.words)(n),":"]})}),(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(at.ZP,{value:i,onChange:function(e,n){return t(n)},min:0,max:o,valueLabelDisplay:"auto",getAriaValueText:function(e){return e.toLocaleString()},"aria-labelledby":"military-slider-".concat(n,"-label")})})}),(0,r.jsx)(m.ZP,{item:!0,xs:2,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(ot.Z,{value:i,size:"small",onChange:function(e){return t(""===e.target.value?0:Number(e.target.value))},onBlur:function(){i<0?t(0):i>o&&t(o)},inputProps:{step:1,min:0,max:o,type:"number","aria-labelledby":"input-slider"}})})})]})}var xt,pt=t(947);function gt(e){var n=e.cellSize,t=e.x,i=e.y,o=e.boundingBox,a=e.onClick,l=e.adjacentTiles.find((function(e){return e.location.x===t&&e.location.y===i}));return l?(0,r.jsx)(Hn,{onClick:function(){return a(l)},hover:!0,cellSize:n,boundingBox:o,location:{x:t,y:i},tooltip:"Attack here",color:"rgb(140, 0, 0)",icon:(0,r.jsx)(pt.Z,{})},"".concat(t,"-").concat(i)):null}function yt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]})},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,en.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())," ",re.upkeep[e.name]>0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,en.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())]},e.name)})),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(p.Z,{"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",onChange:function(e,n){I&&L(null),H(n)},sx:{flexShrink:0,flexGrow:1},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Dn.Z,{}),label:"Building Details",value:"info",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Fn.Z,{}),label:"Build Buildings",value:"build",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(qn.Z,{}),label:"Destroy Buildings",value:"destroy",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Tn.Z,{}),label:"Resource Market",value:"market",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Bn.Z,{}),label:"Military",value:"military",wrapped:!0})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,lg:3,children:(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,r.jsx)(h.Z,{variant:"h6",style:y.Z,children:"Buildings"}),(0,r.jsx)(De,{location:re.location,minimapSize:[se,ue],cellSize:he,renderCell:function(e){var n,t,i,o,a,l,s,u,d,h,m,f,v,x,p,g,y,b,j,Z,S,w,k,A,P,C,L,E,O,F,T,M,W,G,D,B,$,z,R,N,H,U,J,Y,K,V,_,X,ee,ie,oe,ae,se=e.x,ce=e.y,ue=!1,de=!1;(null===(n=fe[se])||void 0===n||null===(t=n[ce])||void 0===t?void 0:t.type)!==q.oS.Garrison&&(null===(i=fe[se-1])||void 0===i||null===(o=i[ce+1])||void 0===o?void 0:o.type)!==q.oS.Garrison&&(null===(a=fe[se+1])||void 0===a||null===(l=a[ce+1])||void 0===l?void 0:l.type)!==q.oS.Garrison&&(null===(s=fe[se-1])||void 0===s||null===(u=s[ce])||void 0===u?void 0:u.type)!==q.oS.Garrison&&(null===(d=fe[se+1])||void 0===d||null===(h=d[ce])||void 0===h?void 0:h.type)!==q.oS.Garrison&&(null===(m=fe[se-1])||void 0===m||null===(f=m[ce-1])||void 0===f?void 0:f.type)!==q.oS.Garrison&&(null===(v=fe[se+1])||void 0===v||null===(x=v[ce-1])||void 0===x?void 0:x.type)!==q.oS.Garrison&&(null===(p=fe[se])||void 0===p||null===(g=p[ce+1])||void 0===g?void 0:g.type)!==q.oS.Garrison&&(null===(y=fe[se])||void 0===y||null===(b=y[ce-1])||void 0===b?void 0:b.type)!==q.oS.Garrison&&(null===(j=fe[se])||void 0===j||null===(Z=j[ce+2])||void 0===Z?void 0:Z.type)!==q.oS.Garrison&&(null===(S=fe[se])||void 0===S||null===(w=S[ce-2])||void 0===w?void 0:w.type)!==q.oS.Garrison&&(null===(k=fe[se+2])||void 0===k||null===(A=k[ce])||void 0===A?void 0:A.type)!==q.oS.Garrison&&(null===(P=fe[se-2])||void 0===P||null===(C=P[ce])||void 0===C?void 0:C.type)!==q.oS.Garrison||(ue=!0),(null===(L=fe[se])||void 0===L||null===(E=L[ce])||void 0===E?void 0:E.type)!==q.oS.Barracks&&(null===(O=fe[se-1])||void 0===O||null===(F=O[ce+1])||void 0===F?void 0:F.type)!==q.oS.Barracks&&(null===(T=fe[se+1])||void 0===T||null===(M=T[ce+1])||void 0===M?void 0:M.type)!==q.oS.Barracks&&(null===(W=fe[se-1])||void 0===W||null===(G=W[ce])||void 0===G?void 0:G.type)!==q.oS.Barracks&&(null===(D=fe[se+1])||void 0===D||null===(B=D[ce])||void 0===B?void 0:B.type)!==q.oS.Barracks&&(null===($=fe[se-1])||void 0===$||null===(z=$[ce-1])||void 0===z?void 0:z.type)!==q.oS.Barracks&&(null===(R=fe[se+1])||void 0===R||null===(N=R[ce-1])||void 0===N?void 0:N.type)!==q.oS.Barracks&&(null===(H=fe[se])||void 0===H||null===(U=H[ce+1])||void 0===U?void 0:U.type)!==q.oS.Barracks&&(null===(J=fe[se])||void 0===J||null===(Y=J[ce-1])||void 0===Y?void 0:Y.type)!==q.oS.Barracks&&(null===(K=fe[se])||void 0===K||null===(V=K[ce+2])||void 0===V?void 0:V.type)!==q.oS.Barracks&&(null===(_=fe[se])||void 0===_||null===(X=_[ce-2])||void 0===X?void 0:X.type)!==q.oS.Barracks&&(null===(ee=fe[se+2])||void 0===ee||null===(ie=ee[ce])||void 0===ie?void 0:ie.type)!==q.oS.Barracks&&(null===(oe=fe[se-2])||void 0===oe||null===(ae=oe[ce])||void 0===ae?void 0:ae.type)!==q.oS.Barracks||(de=!0);var me=void 0;if(ue?(me="blue",de&&(me="green")):de&&(me="rgb(180, 200, 0)"),se===re.location.x&&ce===re.location.y)return(0,r.jsx)(Hn,{onClick:function(){return c(function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0||E;function J(e){return Y.apply(this,arguments)}function Y(){return(Y=Lt(Z().mark((function e(n){var t,r;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A({variables:{direction:n}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(t=e.t0.graphQLErrors[0])||void 0===t||null===(r=t.extensions)||void 0===r?void 0:r.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function K(){return(K=Lt(Z().mark((function e(){var n,t;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,L({variables:{x:x,y:y}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(n=e.t0.graphQLErrors[0])||void 0===n||null===(t=n.extensions)||void 0===t?void 0:t.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var V,_=Math.round(Math.pow(5*(0,B.LW)(s.location,{x:x,y:y}),1.3));return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:2,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,xs:2,sm:1,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:(0,r.jsx)(kn,{hero:s,onShowSettlement:function(){f(!0)}})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(h.Z,{variant:"h3",children:"Travel"}),s.combat.health>0&&(0,r.jsx)(h.Z,{children:"Use buttons to move around the map."}),0===s.combat.health&&(0,r.jsx)(h.Z,{component:"p",variant:"h6",children:"You cannot move while dead. Heal yourself in the Combat tab."})]}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"North terrain: ".concat(z),disabled:U,variant:"contained",onClick:function(){return J(q.p$.North)},children:"North"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"West terrain: ".concat(H),disabled:U,variant:"contained",onClick:function(){return J(q.p$.West)},children:"West"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsxs)(h.Z,{children:[s.location.x,", ",s.location.y]})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"East terrain: ".concat(Q),disabled:U,variant:"contained",onClick:function(){return J(q.p$.East)},children:"East"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"South terrain: ".concat(N),disabled:U,variant:"contained",onClick:function(){return J(q.p$.South)},children:"South"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),s.stats.intelligence>100&&(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(c.Z,{}),(0,r.jsx)(h.Z,{variant:"h5",component:"h3",color:"secondary",sx:{margin:1},children:"Teleport"}),(0,r.jsx)(R.Z,{label:"X coordinate",value:x,onChange:function(e){return l(e.target.value,y)},sx:{width:"100px",margin:1}}),(0,r.jsx)(R.Z,{label:"Y coordinate",value:y,onChange:function(e){return l(x,e.target.value)},sx:{width:"100px",margin:1}}),(0,r.jsx)("br",{}),(0,r.jsxs)(P.Z,{color:"secondary",variant:"outlined",onClick:function(){return K.apply(this,arguments)},disabled:0===_||_>s.stats.intelligence||U,children:["Teleport",(0,r.jsx)("br",{}),_>0&&"".concat(_.toLocaleString()," minimum intelligence")]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,sm:1,children:[G&&(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:G.name}),G&&(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:G.type}),$&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h6",component:"h4",children:[null!==(V=null===(t=$.publicOwner)||void 0===t?void 0:t.name)&&void 0!==V?V:"???","'s Settlement"]}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:$.type})]}),!G&&!$&&W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"Wilderness"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:W.terrain.terrain})]}),!G&&!$&&!W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"\xa0"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:"loading..."})]}),(0,r.jsx)(De,{location:s.location,renderCell:function(e){var n=e.x,t=e.y;return s.location.x===n&&s.location.y===t?(0,r.jsx)("div",{style:{borderRadius:"".concat(4,"px"),backgroundColor:"red",border:"2px solid rgba(255,255,255,0.3)",width:"".concat(8,"px"),height:"".concat(8,"px"),margin:"auto"}}):null}}),(null===G||void 0===G?void 0:G.description)&&G.description.map((function(e,n){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},"loc-desc-".concat(n))})),M.filter((function(e){return!!e})).map((function(e){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},e)}))]}),"dock"===(null===G||void 0===G?void 0:G.type)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ne,{location:G})}),(null===W||void 0===W?void 0:W.shop)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ke,{shop:null===W||void 0===W?void 0:W.shop})})]})})}var Tt,Mt=t(5582);function Wt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t2&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{id:"level-up-stat-slider-label",children:x}),(0,r.jsx)(at.ZP,{min:1,max:v.attributePoints,value:a,onChange:function(e,n){return!Array.isArray(n)&&l(n)},id:"level-up-stat-slider","aria-labelledby":"level-up-stat-slider-label",valueLabelDisplay:"auto"})]})})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:14,spacing:2,children:[(0,r.jsx)(F.Z,{title:"Strength determines your damage when attacking with melee weapons",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-strength",disabled:f||n>0,onClick:function(){return p("Strength")},variant:"contained",children:"Strength"})})})}),(0,r.jsx)(F.Z,{title:"Dexterity determines the accuracy and dodge rate for melee and ranged weapons, it also determines ranged weapons damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-dexterity",disabled:f||n>0,onClick:function(){return p("Dexterity")},variant:"contained",children:"Dexterity"})})})}),(0,r.jsx)(F.Z,{title:"Constitution determines your max health, and is used in both attacking and defending blood magic",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-constitution",disabled:f||n>0,onClick:function(){return p("Constitution")},variant:"contained",children:"Constitution"})})})}),(0,r.jsx)(F.Z,{title:"Intelligence determines your spellcasting damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-intelligence",disabled:f||n>0,onClick:function(){return p("Intelligence")},variant:"contained",children:"Intelligence"})})})}),(0,r.jsx)(F.Z,{title:"Wisdom is your accuracy and dodge stat for spellcasting and smiting",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-wisdom",disabled:f||n>0,onClick:function(){return p("Wisdom")},variant:"contained",children:"Wisdom"})})})}),(0,r.jsx)(F.Z,{title:"Willpower helps you survive attacks by reducing damage, it also helps smiters deal deal more damage.",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-willpower",disabled:f||n>0,onClick:function(){return p("Willpower")},variant:"contained",children:"Willpower"})})})}),(0,r.jsx)(F.Z,{title:"Luck helps you critically strike foes and also affects item drop rates",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-luck",disabled:f||n>0,onClick:function(){return p("Luck")},variant:"contained",children:"Luck"})})})}),(0,r.jsx)(F.Z,{title:"Places 1 in every stat for a more well rounded character",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-all",disabled:f||n>0,onClick:function(){return p("All")},variant:"contained",children:"All"})})})})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(c.Z,{})]})}function $t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);ta.gold,children:[e.cost&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{display:"inline-block",children:e.name}),"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Lvl. ",e.level]}),"\xa0",(0,r.jsxs)(h.Z,{variant:"subtitle2",display:"inline-block",sx:{color:"info.main"},children:[e.cost.toLocaleString()," Gold"]})]}),!e.cost&&e.name]},e.id)}))})]}):null}function Kt(){var e=Qt((0,oe.gZ)(),1)[0],n=(0,i.useState)(null),t=n[0],o=n[1],a=(0,i.useState)(""),l=a[0],s=a[1],u=(0,q.Cb)(),d=u.data,f=(u.loading,u.error,Qt((0,q.Nn)(),2)),v=f[0],x=f[1].loading,p=Qt((0,q.o_)(),2),g=p[0],y=p[1].loading||x||e>0;function b(){return(b=Rt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,v({variables:{baseItem:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function j(){return(j=Rt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,g({variables:{item:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var S,w="Choose which shop to visit";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{align:"center",children:["Welcome to the shop! You can buy and sell any non-enchanted items here.",(0,r.jsx)("br",{}),"The items purchasable here have a level from 1 to 32 but no enchantments or direct attribute increases."]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"shop-type-select-label",children:w}),(0,r.jsxs)($.Z,{id:"shop-type-select",labelId:"shop-type-select-label",label:w,onChange:function(e){s(e.target.value),o(null)},children:[(0,r.jsx)(z.Z,{value:"sell",children:"Sell Items"}),(0,r.jsx)(c.Z,{}),(0,r.jsxs)(z.Z,{value:q.$7.MeleeWeapon,children:[Ut(q.$7.MeleeWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.RangedWeapon,children:[Ut(q.$7.RangedWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.SpellFocus,children:[Ut(q.$7.SpellFocus)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.Shield,children:[Ut(q.$7.Shield)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.BodyArmor,children:[Ut(q.$7.BodyArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.HandArmor,children:[Ut(q.$7.HandArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.LegArmor,children:[Ut(q.$7.LegArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.HeadArmor,children:[Ut(q.$7.HeadArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:q.$7.FootArmor,children:[Ut(q.$7.FootArmor)," Shop"]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,children:[""!==l&&"sell"!==l&&(0,r.jsx)(Yt,{value:t?t.id:"",type:l,items:function(e){var n;return(null===d||void 0===d||null===(n=d.shopItems)||void 0===n?void 0:n.length)?d.shopItems.filter((function(n){return n.type===e})):[]}(l),onChange:function(e){return o(e)}},l),"sell"===l&&(0,r.jsx)(Jt,{value:t?t.id:"",sellables:null!==(S=null===d||void 0===d?void 0:d.shopItems)&&void 0!==S?S:[],onChange:function(e){return o(e)}})]}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:t&&(0,r.jsxs)(P.Z,{variant:"contained",color:"sell"===l?"error":"success",fullWidth:!0,disabled:y,onClick:"sell"===l?function(){return j.apply(this,arguments)}:function(){return b.apply(this,arguments)},children:["sell"===l?"Sell":"Buy"," ",t.name," for"," ",t.cost.toLocaleString()," gold"]})})]}),(0,r.jsx)("br",{})]})}function Vt(){D();var e=ae();le();return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Item Shop"}),(0,r.jsx)(Kt,{}),(null===e||void 0===e?void 0:e.shop)&&(0,r.jsx)(Ke,{shop:null===e||void 0===e?void 0:e.shop})]})}function _t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=n.levelCap);function l(){return(l=er(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsxs)(s.Z,{sx:{padding:1,margin:1},children:[(0,r.jsx)(h.Z,{color:"secondary",variant:"h2",children:"Rebirth"}),!a&&(0,r.jsx)(h.Z,{children:"You may only be reborn when you are at level cap. Keep leveling up your character in order to be reborn!"}),a&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This will reset your character's level and attributes, however you will keep all gold and items and will receive special bonuses depending on your current level cap."}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{size:"large",variant:"outlined",color:"secondary",onClick:function(){return l.apply(this,arguments)},children:"Reset Character to Level 1"})]})]})}var rr=t(5988),ir=t(9629);function or(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t1&&"(".concat(p[e],")"),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]}),(0,r.jsxs)(P.Z,{fullWidth:!0,variant:"contained",disabled:!y||t||v||S>n.enchantingDust,color:"success",onClick:function(){return j.apply(this,arguments)},children:[y&&""!==u&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Create ",(0,r.jsx)("b",{children:(0,B.GJ)(y,u)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",S.toLocaleString()," Enchantment Dust"]})]}),!y&&"Select Item"]})]})}function pr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tn.enchantingDust,color:"error",onClick:function(){return j.apply(this,arguments)},children:[b&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Disenchant ",(0,r.jsx)("b",{children:(0,B.GJ)(b)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",w.toLocaleString()," Enchantment Dust"]})]}),!b&&"Select Item"]})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),m&&(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"filter-select-label",children:"Filter by enchantment"}),(0,r.jsx)($.Z,{id:"filter-select",labelId:"filter-select-label",value:a||"",label:"Filter by enchantment",onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.enchantment===t}))&&l(t)},children:y.map((function(e){return(0,r.jsxs)(z.Z,{value:e,children:[(0,B.uD)(e),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]})]})}var Zr=t(3457),Sr=t(480),wr=t(9368);function kr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t31)})).sort(B.v4)),v=f.find((function(e){return e.id===a}));!v&&a.length&&(f.length?(v=f[0],a=v.id):a="");var x="Select base item",p=n.equipment.artifact;if(!p)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(h.Z,{children:"You must have an artifact to imbue items with."})});var g,y=(0,B.Vy)(p);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"Imbueing an item adds parts of an artifact onto a base item. Items can only be imbued once, and there is no way to remove the imbue. You may enchant an imbued item, however only unenchanted items can receive an imbue."}),(0,r.jsx)("br",{}),(0,r.jsxs)(L.Z,{fullWidth:!0,sx:{margin:1},children:[(0,r.jsx)(E.Z,{id:"enchant-baseItem-select-label",children:x}),(0,r.jsx)($.Z,{id:"enchant-baseItem-select",labelId:"enchant-baseItem-select-label",value:a||"",label:x,onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.id===t}))&&l(t)},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,B.GJ)(e),(0,B.mQ)(n,e)&&"*EQUIPPED*"]},e.id)}))})]}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h5",children:[v.name," to be imbued with"," ",(0,r.jsx)("strong",{children:p.name})]}),(0,r.jsx)(h.Z,{variant:"subtitle1",children:"Select up to three affixes to activate on the item, each affix increases dust cost dramatically. The remaining affixes will be selected randomly from the remaining affixes."}),(0,r.jsx)(Zr.Z,{children:y.map((function(e){return(0,r.jsx)(Sr.Z,{control:(0,r.jsx)(wr.Z,{disabled:c.length>=3&&!c.includes(e.type),onChange:function(n){var t=c.filter((function(n){return n!==e.type}));n.target.checked&&t.push(e.type),u(t)}}),label:(0,B.xq)(e)},e.type)}))})]}),(0,r.jsx)(dn.Z,{variant:"contained",disabled:t||!v||0===c.length,loading:t,onClick:(g=Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t&&v&&0!==c.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,m({variables:{item:v.id,artifact:p.id,affixes:c}});case 4:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var i=g.apply(e,n);function o(e){Ar(i,t,r,o,a,"next",e)}function a(e){Ar(i,t,r,o,a,"throw",e)}o(void 0)}))}),children:"Imbue item"})]})}function Ir(e){var n=e.hero,t=e.disabled,o=(0,i.useState)("1"),a=o[0],l=o[1],u=n.inventory.some((function(e){return"pure-essence"===e.baseItem})),m=n.inventory.some((function(e){return"essence-of-void"===e.baseItem})),f=u&&m&&null!==n.equipment.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(c.Z,{sx:{margin:2}}),(0,r.jsx)(h.Z,{variant:"h2",component:"h4",color:"secondary",children:"Crafting"}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchanting Dust:"," ",(0,r.jsx)("span",{id:"hero-stats-enchanting-dust",children:n.enchantingDust.toLocaleString()})]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchantments:"," ",(0,r.jsx)("span",{id:"hero-stats-enchantments",children:n.enchantments.length.toLocaleString()})]}),(0,r.jsx)("br",{}),(0,r.jsx)(x.ZP,{value:a,children:(0,r.jsxs)(s.Z,{sx:{flexGrow:1,borderBottom:1,borderColor:"divider",display:"flex"},children:[(0,r.jsxs)(p.Z,{orientation:"vertical",onChange:function(e,n){return l(n)},"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",sx:{flexShrink:0,flexGrow:0,width:"100px"},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(qn.Z,{}),label:"Destroy",value:"1"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(ir.Z,{}),label:"Disenchant",value:"2"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(rr.Z,{}),label:"Enchant",value:"3"}),f&&(0,r.jsx)(d.Z,{icon:(0,r.jsx)(rr.Z,{}),label:"Imbue",value:"4"})]}),(0,r.jsxs)(g.Z,{value:"1",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Destroy Items"}),(0,r.jsx)(cr,{hero:n,disabled:t})]}),(0,r.jsxs)(g.Z,{value:"2",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Disenchant Items"}),(0,r.jsx)(jr,{hero:n,disabled:t})]}),(0,r.jsxs)(g.Z,{value:"3",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Enchant Items"}),(0,r.jsx)(xr,{hero:n,disabled:t})]}),f&&(0,r.jsxs)(g.Z,{value:"4",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:y.Z,children:"Imbue Items"}),(0,r.jsx)(Cr,{hero:n,disabled:t})]})]})})]})}function Lr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1){var r=f.find((function(n){return(0,B.GJ)(n)===t&&n.id!==e}));r&&(x.push(r),v[t]-=1)}}})),x.sort(B.v4),(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"".concat(o,"-equip-select-label"),children:a}),(0,r.jsx)($.Z,{id:"".concat(o,"-equip-select"),labelId:"".concat(o,"-equip-select-label"),value:c||"",label:a,disabled:s,onChange:function(e){m(e.target.value),l(o,e.target.value)},children:x.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:u.indexOf(e.id)>=0,children:[e.id===c?(0,r.jsx)("b",{children:(0,B.GJ)(e)}):(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),v[(0,B.GJ)(e)]>1&&-1===u.indexOf(e.id)?" x".concat(v[(0,B.GJ)(e)]):""]}),(0,r.jsxs)(h.Z,{variant:"caption",sx:{color:"info.secondary"},children:["\xa0Lvl. ",e.level]}),e.enchantment&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"info.main"},children:["\xa0",(0,B.Lt)(e.enchantment)]})]},e.id)}))})]})})})}function Tr(e){var n=e.hero,t=e.disabled,o=e.onChange,a=(0,i.useState)(""),l=a[0],s=a[1],c=n.inventory.filter((function(e){return e.type===q.$7.Quest})).sort((function(e,n){return n.level-e.level})),u="Quest items (passive, always active)",d=n.inventory.find((function(e){return e.id===l}));(0,i.useEffect)((function(){l.length&&!d&&s("")}),[d,l]);var m={};c.forEach((function(e){var n=(0,B.GJ)(e);m[n]?m[n]+=1:m[n]=1}));var f=Object.keys(m).map((function(e){return c.find((function(n){return(0,B.GJ)(n)===e}))}));return(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"quest-item-label",children:u}),(0,r.jsx)($.Z,{id:"quest-item",labelId:"quest-item-label",value:l,label:u,disabled:t,onChange:function(e){if(s(e.target.value),o){var n=c.find((function(n){return n.id===e.target.value}));n&&o(n.baseItem)}},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),m[(0,B.GJ)(e)]>1?" x".concat(m[(0,B.GJ)(e)]):""]}),"???"!==(0,B.Lt)(e.baseItem)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e.baseItem)]})]},e.id)}))})]})})})}function Mr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0;if(!N)return null;function H(e,n){return U.apply(this,arguments)}function U(){return(U=Gr(Z().mark((function e(n,t){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W({variables:{item:t,slot:n}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h3",sx:{fontSize:"1.2rem"},children:"Equipped items"})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"leftHand",label:"Left Hand",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"rightHand",label:"Right Hand",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"bodyArmor",label:"Body Armor",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"handArmor",label:"Gauntlets",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"legArmor",label:"Leggings",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"headArmor",label:"Helmets",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Fr,{hero:N,slot:"footArmor",label:"Greaves",onEquip:H,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Tr,{hero:N,disabled:Q,onChange:R})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:!!N.buffs.blessing&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:(0,B.uD)(N.buffs.blessing)}),(0,r.jsx)(h.Z,{variant:"body1",children:(0,r.jsx)("b",{children:(0,B.Lt)(N.buffs.blessing)})})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,children:(0,r.jsx)(Y,{title:null===(e=N.equipment.artifact)||void 0===e?void 0:e.name,artifact:N.equipment.artifact})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.leftHand?(0,B.GJ)(N.equipment.leftHand,null):null,artifact:null===(n=N.equipment.leftHand)||void 0===n||null===(t=n.imbue)||void 0===t?void 0:t.artifact,affixes:null===(o=N.equipment.leftHand)||void 0===o||null===(a=o.imbue)||void 0===a?void 0:a.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.rightHand?(0,B.GJ)(N.equipment.rightHand,null):null,artifact:null===(l=N.equipment.rightHand)||void 0===l||null===(s=l.imbue)||void 0===s?void 0:s.artifact,affixes:null===(c=N.equipment.rightHand)||void 0===c||null===(u=c.imbue)||void 0===u?void 0:u.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.bodyArmor?(0,B.GJ)(N.equipment.bodyArmor,null):null,artifact:null===(d=N.equipment.bodyArmor)||void 0===d||null===(f=d.imbue)||void 0===f?void 0:f.artifact,affixes:null===(v=N.equipment.bodyArmor)||void 0===v||null===(x=v.imbue)||void 0===x?void 0:x.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.handArmor?(0,B.GJ)(N.equipment.handArmor,null):null,artifact:null===(p=N.equipment.handArmor)||void 0===p||null===(g=p.imbue)||void 0===g?void 0:g.artifact,affixes:null===(y=N.equipment.handArmor)||void 0===y||null===(b=y.imbue)||void 0===b?void 0:b.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.legArmor?(0,B.GJ)(N.equipment.legArmor,null):null,artifact:null===(j=N.equipment.legArmor)||void 0===j||null===(S=j.imbue)||void 0===S?void 0:S.artifact,affixes:null===(w=N.equipment.legArmor)||void 0===w||null===(k=w.imbue)||void 0===k?void 0:k.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.headArmor?(0,B.GJ)(N.equipment.headArmor,null):null,artifact:null===(A=N.equipment.headArmor)||void 0===A||null===(P=A.imbue)||void 0===P?void 0:P.artifact,affixes:null===(C=N.equipment.headArmor)||void 0===C||null===(I=C.imbue)||void 0===I?void 0:I.affixes})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Y,{title:N.equipment.footArmor?(0,B.GJ)(N.equipment.footArmor,null):null,artifact:null===(L=N.equipment.footArmor)||void 0===L||null===(E=L.imbue)||void 0===E?void 0:E.artifact,affixes:null===(O=N.equipment.footArmor)||void 0===O||null===(F=O.imbue)||void 0===F?void 0:F.affixes})})]})}),N.level===N.levelCap&&(0,B.jr)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(tr,{hero:N,disabled:Q})}),(0,B.OB)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ir,{hero:N,disabled:Q})}),(0,B.jj)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Or,{hero:N,disabled:Q})})]})})}function Br(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(Bt,{}),T&&T.currentQuest&&(0,r.jsx)(zr,{event:T.currentQuest})]}),(0,r.jsxs)(s.Z,{sx:{width:"100%",typography:"body1"},children:[(0,r.jsxs)(x.ZP,{value:E,children:[(0,r.jsxs)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:[(0,r.jsx)(h.Z,{variant:"h1",sx:y.Z,children:"Navigation"}),(0,r.jsxs)(p.Z,{onChange:function(e,n){"play"===n?Z.push("/play","/play",{scroll:!1}):Z.push("/play/".concat(n),"/play/".concat(n),{scroll:!1}),O(n)},"aria-label":"navigation tabs",variant:"scrollable",children:[(0,r.jsx)(d.Z,{label:"Welcome",value:"play"}),(0,r.jsx)(d.Z,{label:"Combat",value:"combat"}),!(!(null===T||void 0===T?void 0:T.inventory.length)&&!(null===T||void 0===T?void 0:T.gold))&&(0,r.jsx)(d.Z,{label:"Shop",value:"shop"}),!!(null===T||void 0===T?void 0:T.inventory.length)&&(0,r.jsx)(d.Z,{label:"Inventory",value:"inventory"}),(0,r.jsx)(d.Z,{label:"Map",value:"map"}),T&&Object.values(T.questLog).filter((function(e){return!!e})).length>2&&(0,r.jsx)(d.Z,{label:"Quests",value:"quests"}),W&&(0,r.jsx)(d.Z,{label:"Settings",value:"settings"}),M===q.Ks.Admin&&(0,r.jsx)(d.Z,{label:"Admin",value:"admin"})]})]}),(0,r.jsx)(g.Z,{value:"play",children:(0,r.jsxs)(m.ZP,{container:!0,columns:12,spacing:4,children:[(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:7,md:8,children:[(0,r.jsxs)(h.Z,{variant:"h2",sx:{mb:2,fontSize:"1.8rem"},children:["Welcome to ",(0,r.jsx)("b",{children:"Proof of Combat"}),"!"]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",sx:y.Z,children:["This text is only available to screen readers. Thank you for trying out my game! If you find any parts of the user interface that are difficult to navigate please let me know and I would love to improve them.",(0,r.jsx)("br",{}),(0,r.jsx)(v.Z,{href:"https://github.com/chrisinajar/proofofcombat/wiki/Screen-Readers-and-Accessibility",target:"_blank",rel:"noreferrer",children:"Check this wiki page for more details on accessibility"})]}),(0,r.jsx)(h.Z,{sx:{mb:2},children:"This is a text-based RPG where you can fight monsters, level up, and explore the world. The game is my passion project and is actively being developed at almost all times."}),(0,r.jsx)(h.Z,{variant:"h4",sx:y.Z,children:"Discord Server"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["If you'd like to talk more with other players, report bugs, or discuss upcoming features,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://discord.gg/t7AZSxvfJG",target:"_blank",rel:"noreferrer",children:"join the discord!"})]}),(0,r.jsx)(h.Z,{variant:"h4",sx:y.Z,children:"Game Wiki"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["A great deal of the game is undocumented, but the parts which are documented can be found"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://github.com/chrisinajar/proofofcombat/wiki/",target:"_blank",rel:"noreferrer",children:"in the wiki"}),". The game is nearly impossible to 100% without consulting the wiki."]}),(0,r.jsx)(h.Z,{variant:"h5",sx:{mb:2},children:"Combat Stats"}),(null===T||void 0===T?void 0:T.combatStats)&&(0,r.jsx)(_r,{skills:T.skills,stats:T.combatStats})]}),(null===F||void 0===F?void 0:F.leaderboard)&&(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:5,md:4,children:[(0,r.jsx)(h.Z,{variant:"h6",children:"Leaderboard"}),(0,r.jsx)("ul",{id:"leaderboard-list",children:F.leaderboard.slice(0,20).map((function(e,n){return(0,r.jsxs)("li",{id:"leaderboard-list-".concat(n),children:[(0,r.jsx)("b",{id:"leaderboard-list-".concat(n,"-name"),children:e.name})," ","(",(0,B.qh)(e.class),")"]},e.id)}))})]})]})}),(0,r.jsxs)(g.Z,{value:"combat",children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Combat"}),(0,r.jsx)(h.Z,{children:"Challenge a monster from the list, then fight it to the death. Note that other players in the same location see the same monster lists, so they may get to it first!"}),(0,r.jsx)("br",{}),(0,r.jsx)(Fe,{})]}),(0,r.jsx)(g.Z,{value:"shop",children:(0,r.jsx)(Vt,{})}),(0,r.jsx)(g.Z,{value:"inventory",children:(0,r.jsx)(Dr,{})}),(0,r.jsx)(g.Z,{value:"map",children:(0,r.jsx)(Ft,{})}),(0,r.jsx)(g.Z,{value:"quests",children:(0,r.jsx)(Kr,{})}),(0,r.jsx)(g.Z,{value:"settings",children:(0,r.jsx)(mi,{})}),(0,r.jsx)(g.Z,{value:"admin",children:(0,r.jsx)(xi,{})})]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsx)(re,{})]})]})})}}}]); \ No newline at end of file diff --git a/_next/static/nV971nPxM4f1akqkY9Rtx/_buildManifest.js b/_next/static/nV971nPxM4f1akqkY9Rtx/_buildManifest.js new file mode 100644 index 0000000..0e08d14 --- /dev/null +++ b/_next/static/nV971nPxM4f1akqkY9Rtx/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST=function(a,s,t,c,e){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,s,t,"static/chunks/pages/index-86b6ad0225ab5fd5.js"],"/_error":["static/chunks/pages/_error-0a004b8b8498208d.js"],"/map":[a,"static/chunks/pages/map-e29aa493b081ff8b.js"],"/play":[a,s,c,t,e,"static/chunks/pages/play-3f3e10b32e0d5239.js"],"/play/admin":[a,s,c,t,e,"static/chunks/pages/play/admin-3dd5b720cd1cc776.js"],"/play/combat":[a,s,c,t,e,"static/chunks/pages/play/combat-079cee989a4e5acf.js"],"/play/inventory":[a,s,c,t,e,"static/chunks/pages/play/inventory-fa262c1619ef4b57.js"],"/play/map":[a,s,c,t,e,"static/chunks/pages/play/map-0c334b7cc27fb3b8.js"],"/play/quests":[a,s,c,t,e,"static/chunks/pages/play/quests-94d8bf8f1b358105.js"],"/play/settings":[a,s,c,t,e,"static/chunks/pages/play/settings-850fe9a55081b6f4.js"],"/play/shop":[a,s,c,t,e,"static/chunks/pages/play/shop-e6c188525f8253ce.js"],sortedPages:["/","/_app","/_error","/map","/play","/play/admin","/play/combat","/play/inventory","/play/map","/play/quests","/play/settings","/play/shop"]}}("static/chunks/806-f6f4d391dc92d342.js","static/chunks/432-45e5c3f10246e293.js","static/chunks/998-2ab40a18050e2ffe.js","static/chunks/688-20c0f4d0ce5a4a1f.js","static/chunks/536-85f336bb0ca7d953.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/5ceJlVAP-l5bYBLRUoScy/_middlewareManifest.js b/_next/static/nV971nPxM4f1akqkY9Rtx/_middlewareManifest.js similarity index 100% rename from _next/static/5ceJlVAP-l5bYBLRUoScy/_middlewareManifest.js rename to _next/static/nV971nPxM4f1akqkY9Rtx/_middlewareManifest.js diff --git a/_next/static/5ceJlVAP-l5bYBLRUoScy/_ssgManifest.js b/_next/static/nV971nPxM4f1akqkY9Rtx/_ssgManifest.js similarity index 100% rename from _next/static/5ceJlVAP-l5bYBLRUoScy/_ssgManifest.js rename to _next/static/nV971nPxM4f1akqkY9Rtx/_ssgManifest.js diff --git a/index.html b/index.html index de9e40d..116ec2e 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat


This is a game about clicking things and watching numbers go up, login if you have an account already.




Need an account?






Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat


This is a game about clicking things and watching numbers go up, login if you have an account already.




Need an account?






Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/map.html b/map.html index 6f4bcf2..51ba744 100644 --- a/map.html +++ b/map.html @@ -1 +1 @@ -Proof of Combat
\ No newline at end of file +Proof of Combat
\ No newline at end of file diff --git a/play.html b/play.html index fc83571..b08520d 100644 --- a/play.html +++ b/play.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/admin.html b/play/admin.html index 0e14e6e..2a2f60e 100644 --- a/play/admin.html +++ b/play/admin.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/combat.html b/play/combat.html index 167df7f..6cb8bb7 100644 --- a/play/combat.html +++ b/play/combat.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/inventory.html b/play/inventory.html index d363377..a1d8813 100644 --- a/play/inventory.html +++ b/play/inventory.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/map.html b/play/map.html index a9dacb6..05f0c88 100644 --- a/play/map.html +++ b/play/map.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/quests.html b/play/quests.html index 7b4489e..f725a9b 100644 --- a/play/quests.html +++ b/play/quests.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/settings.html b/play/settings.html index a73d7f2..fbee1c9 100644 --- a/play/settings.html +++ b/play/settings.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/shop.html b/play/shop.html index d557cdf..6ff86ce 100644 --- a/play/shop.html +++ b/play/shop.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file