diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6423fb8 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=QZDY3PPUMH5TU&item_name=OHD%20Admin%20Wrapper¤cy_code=USD # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c40781f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +update.zip +notes.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d2349a5 --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +## OHD Admin Wrapper + +### About + +OHD Admin Wrapper (OHDAW) is a set of tools designed to ease the burden of hosting one or more servers for the `Drakeling Labs` video game [Operation: Harsh Doorstop](https://store.steampowered.com/app/736590/Operation_Harsh_Doorstop/). It is comprised of a Ruby webserver (Sinatra) and associated tools which provide an easy-to-use browser front-end for configuring and managing a server on either Linux or Windows. + +It can also be used to remotely monitor and administer servers via RCON. + +### Screenshots + +TO DO + +### Features + +An easy-to-use webserver with configurable parameters via TOML file (and web interface): + - Bind IP/Port + - SSL Enabled + - Verify SSL Enabled + - Cert/Key Paths + - Session secret + +Local server features: +- **Server Setup page** + - Guides you through installing SteamCMD manually + - Detects SteamCMD installation and server installation + - Shows available server update + - Provides a simple interface to install and manually update/verify the server files as well as enable automatic update + - SteamCMD log (see known issue below for Windows) +- **Server Config page** + - Supports multiple server configurations + - Easy-to-use configuration options for your servers + - Blurring/redaction of sensitive information + - Dropdowns for enumerated settings + - Editable config files (Paste your current settings here! Matching settings above will override what was entered.) + - `Game.ini` + - `Engine.ini` + - `Admins.txt` + - `MapCycle.txt` + - `Bans.json` + - Local copies of these files are stored in `ohd-admin-wrapper/server-config`. Before launching the server, the manual config is applied to the `server-config` files, then those files are copied into the appropriate places in order for the server to use them. This prevents the server from overwriting our changes. After the server closes, any new bans are added to the local copy. +- **Server Control page** + - Select from saved configs or running servers + - Server status + - Start/Restart/Stop buttons + - Detailed PID and process exit toasts + - Thread, player, and bot counts + - Player list (with kick/ban buttons and editable reason) + - Chat log with chat input (RCON say) + - RCON log with RCON input + - Server log with download options +- **Server Status page** + - List of all running servers with their metadata and players + +Extra tools: +- **Remote Monitor Tool** + - Allows monitoring and administration of servers when provided with valid IP, Query Port, RCON Port, and RCON Password + - Shows server, query, and RCON status, player list with admin functionality, and RCON console. + - Can spawn multiple server monitors and switch between them at will + - Can save configurations for easy monitoring later + - If a third party hosts your server(s) for you, this is probably what you're looking for +- **RCON Tool** + - Allows remote RCON commands (with the given IP, port, and password). +- **SteamCMD Tool** + - This tool allows passthrough to the SteamCMD installation. This could be useful for installing/updating other games, etc. + +Wrapper webserver features: +- **Config page** + - Easy configuration for all webserver parameters + - Button to download OHDAW logs + - Button to update OHDAW to the latest version (restart required) + - Button to restart the webserver (to apply changes) +- **Users page** + - Easy addition/modification of users to allow access to server admin features. + - Protections to prevent removing the last Host (and therefore losing access to webserver self-configuration and user configuration) + - User roles: + - `Host`: Server host; can configure webserver, users, and everything else + - `Admin`: Server admin; can do everything except configure the webserver and users + - `Moderator`: Server moderator; can kick and ban users via the status page + - `User`: Read-only role which can access basic account features and the server status page + - New users have a random password automatically generated; this (along with the user name) is given to the user by the host. Upon first login, users are asked to change their password. This helps keep passwords private. +- **Log page** + - Shows live user authentication and incoming request information + +User features: +- **Change password** +- **Log out** + +Command-line parameters: +- CLI parameters are passed from the start script (`linux_start.sh`/`windows_start.bat`) to `admin-interface/lib/webapp.rb` +- OHDAW supports the following command-line parameter(s) + - `--start/-s [server_config_name_or_id]` + - Example: `-s 'My Server 1' -s 'My Server 2' -s 'ebfc1f5a-ee68-45ab-9248-6f425f6d587d'` + - Start one or more servers automatically with the named configuration (matched based on `Config Name` or `Config ID`). This can be used in combination with system startup scripts (e.g. systemd unit example in `extras/systemd`) or Windows Task Scheduler to run your server(s) on boot. + - `--log-level/-l [log_level]` + - Example: `-l debug` + - Sets the log level. Only messages at or above the set level are printed to STDOUT; all logs are still written to `admin-interface/log/ohd-admin-wrapper.log`. One of: `debug`, `info`, `warn`, `error`, `fatal` + +### Prerequisites + +- Windows (10 tested) or Linux (Debian 9 tested) +- A Ruby `3.1.2`+ (check with `ruby -v`) installation with the Bundler gem (`gem install bundler`). I recommend [rbenv](https://github.com/rbenv/rbenv) to manage Ruby installations on Linux and [RubyInstaller for Windows](https://rubyinstaller.org/downloads/) to install Ruby on Windows. +- If using this tool to run a server, grab a portable version of [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD) (we'll extract it to `ohd-admin-wrapper/steamcmd/installation`) + - [Windows SteamCMD](https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip) + - [Linux SteamCMD](https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz) + +### Installation + +- Download and extract (or clone) the repository +- If you plan to install/run a server, [install SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD) manually to `ohd-admin-wrapper/steamcmd/installation`. `steamcmd.exe`/`steamcmd.sh` should be in the `installation` directory. + - During runtime, we change the wrapper's `HOME` environment variable to `ohd-admin-wrapper/steamcmd` in order to contain SteamCMD's home directory pollution (on Linux) within the wrapper. You may see shell or Steam-related files in this directory as a result. + +[Docker instructions](/Docker.md) are also available. + +### Starting the Admin Wrapper + +- Run the start script for your OS (`windows_start.bat` for Windows, `linux_start.sh` for Linux (BASH)) +- Navigate to the web interface in your browser (e.g. https://localhost:51422/) +- Log in with the default admin credentials (`admin`/`password`). You will be prompted to set a new password for the `admin` account. If you ever forget this password, just delete `admin-interface/config/users.json` and restart the webserver to regenerate the default `admin`/`password` account. +- If running a server + - Follow the instructions on the `Server -> Setup` to install the OHD server (refresh may be required to show installed status) + - Configure the server via the `Server -> Config` page + - Run the server via the `Server -> Control` page +- If administrating remote server(s) + - Use the `Tools -> Monitor` page + +### Known issues + +These are the currently known issues. If you can fix any of these or know what to do, please send a pull request or [create a detailed GitHub issue](https://github.com/Joe-Klauza/ohd-admin-wrapper/issues/new). Thanks! + +- SteamCMD output on Windows takes forever! + - SteamCMD buffers progress output when it doesn't detect an interactive session (i.e. when it's being run by ohd-admin-wrapper). This output doesn't become available until the update/validation completes. There is a workaround we're using for Linux (PTY) to emulate an interactive session, but such a workaround does not appear to be feasible on Windows at this time. [(more info here)](https://github.com/ValveSoftware/Source-1-Games/issues/1684) + +### Donate + +If you'd like to show your appreciation of `OHD Admin Wrapper`, please [donate via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=QZDY3PPUMH5TU&item_name=OHD%20Admin%20Wrapper¤cy_code=USD) (or suggest other methods). +[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=QZDY3PPUMH5TU&item_name=OHD%20Admin%20Wrapper¤cy_code=USD) diff --git a/admin-interface/.gitignore b/admin-interface/.gitignore new file mode 100644 index 0000000..8e1ca96 --- /dev/null +++ b/admin-interface/.gitignore @@ -0,0 +1,3 @@ +Gemfile* +test.sh + diff --git a/admin-interface/.ruby-version b/admin-interface/.ruby-version new file mode 100644 index 0000000..7bde84d --- /dev/null +++ b/admin-interface/.ruby-version @@ -0,0 +1 @@ +ruby-3.1.2 diff --git a/admin-interface/docroot/public/bootstrap/bootstrap.min.css b/admin-interface/docroot/public/bootstrap/bootstrap.min.css new file mode 100644 index 0000000..6e2d462 --- /dev/null +++ b/admin-interface/docroot/public/bootstrap/bootstrap.min.css @@ -0,0 +1,12 @@ +/*! + * Bootswatch v4.3.1 + * Homepage: https://bootswatch.com + * Copyright 2012-2019 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*//*! + * Bootstrap v4.3.1 (https://getbootstrap.com/) + * Copyright 2011-2019 The Bootstrap Authors + * Copyright 2011-2019 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");:root{--blue: #375a7f;--indigo: #6610f2;--purple: #6f42c1;--pink: #e83e8c;--red: #E74C3C;--orange: #fd7e14;--yellow: #F39C12;--green: #00bc8c;--teal: #20c997;--cyan: #3498DB;--white: #fff;--gray: #999;--gray-dark: #303030;--primary: #375a7f;--secondary: #444;--success: #00bc8c;--info: #3498DB;--warning: #F39C12;--danger: #E74C3C;--light: #303030;--dark: #adb5bd;--breakpoint-xs: 0;--breakpoint-sm: 576px;--breakpoint-md: 768px;--breakpoint-lg: 992px;--breakpoint-xl: 1200px;--font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.9375rem;font-weight:400;line-height:1.5;color:#fff;text-align:left;background-color:#222}[tabindex="-1"]:focus{outline:0 !important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0.5rem}p{margin-top:0;margin-bottom:1rem}abbr[title],abbr[data-original-title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#00bc8c;text-decoration:none;background-color:transparent}a:hover{color:#007053;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):hover,a:not([href]):not([tabindex]):focus{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre,code,kbd,samp{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:0.75rem;padding-bottom:0.75rem;color:#999;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:0.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button:not(:disabled),[type="button"]:not(:disabled),[type="reset"]:not(:disabled),[type="submit"]:not(:disabled){cursor:pointer}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{padding:0;border-style:none}input[type="radio"],input[type="checkbox"]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{outline-offset:-2px;-webkit-appearance:none}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none !important}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{margin-bottom:0.5rem;font-weight:500;line-height:1.2}h1,.h1{font-size:3rem}h2,.h2{font-size:2.5rem}h3,.h3{font-size:2rem}h4,.h4{font-size:1.40625rem}h5,.h5{font-size:1.171875rem}h6,.h6{font-size:0.9375rem}.lead{font-size:1.171875rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,0.1)}small,.small{font-size:80%;font-weight:400}mark,.mark{padding:0.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:0.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.171875rem}.blockquote-footer{display:block;font-size:80%;color:#999}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:0.25rem;background-color:#222;border:1px solid #dee2e6;border-radius:0.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:0.5rem;line-height:1}.figure-caption{font-size:90%;color:#999}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:0.2rem 0.4rem;font-size:87.5%;color:#fff;background-color:#222;border-radius:0.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:inherit}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width: 576px){.container{max-width:540px}}@media (min-width: 768px){.container{max-width:720px}}@media (min-width: 992px){.container{max-width:960px}}@media (min-width: 1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*="col-"]{padding-right:0;padding-left:0}.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col,.col-auto,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm,.col-sm-auto,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md,.col-md-auto,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg,.col-lg-auto,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}@media (min-width: 576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}}@media (min-width: 768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}}@media (min-width: 992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}}@media (min-width: 1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}}.table{width:100%;margin-bottom:1rem;color:#fff}.table th,.table td{padding:0.75rem;vertical-align:top;border-top:1px solid #444}.table thead th{vertical-align:bottom;border-bottom:2px solid #444}.table tbody+tbody{border-top:2px solid #444}.table-sm th,.table-sm td{padding:0.3rem}.table-bordered{border:1px solid #444}.table-bordered th,.table-bordered td{border:1px solid #444}.table-bordered thead th,.table-bordered thead td{border-bottom-width:2px}.table-borderless th,.table-borderless td,.table-borderless thead th,.table-borderless tbody+tbody{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:#303030}.table-hover tbody tr:hover{color:#fff;background-color:rgba(0,0,0,0.075)}.table-primary,.table-primary>th,.table-primary>td{background-color:#c7d1db}.table-primary th,.table-primary td,.table-primary thead th,.table-primary tbody+tbody{border-color:#97a9bc}.table-hover .table-primary:hover{background-color:#b7c4d1}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#b7c4d1}.table-secondary,.table-secondary>th,.table-secondary>td{background-color:#cbcbcb}.table-secondary th,.table-secondary td,.table-secondary thead th,.table-secondary tbody+tbody{border-color:#9e9e9e}.table-hover .table-secondary:hover{background-color:#bebebe}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#bebebe}.table-success,.table-success>th,.table-success>td{background-color:#b8ecdf}.table-success th,.table-success td,.table-success thead th,.table-success tbody+tbody{border-color:#7adcc3}.table-hover .table-success:hover{background-color:#a4e7d6}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#a4e7d6}.table-info,.table-info>th,.table-info>td{background-color:#c6e2f5}.table-info th,.table-info td,.table-info thead th,.table-info tbody+tbody{border-color:#95c9ec}.table-hover .table-info:hover{background-color:#b0d7f1}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#b0d7f1}.table-warning,.table-warning>th,.table-warning>td{background-color:#fce3bd}.table-warning th,.table-warning td,.table-warning thead th,.table-warning tbody+tbody{border-color:#f9cc84}.table-hover .table-warning:hover{background-color:#fbd9a5}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#fbd9a5}.table-danger,.table-danger>th,.table-danger>td{background-color:#f8cdc8}.table-danger th,.table-danger td,.table-danger thead th,.table-danger tbody+tbody{border-color:#f3a29a}.table-hover .table-danger:hover{background-color:#f5b8b1}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f5b8b1}.table-light,.table-light>th,.table-light>td{background-color:#c5c5c5}.table-light th,.table-light td,.table-light thead th,.table-light tbody+tbody{border-color:#939393}.table-hover .table-light:hover{background-color:#b8b8b8}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#b8b8b8}.table-dark,.table-dark>th,.table-dark>td{background-color:#e8eaed}.table-dark th,.table-dark td,.table-dark thead th,.table-dark tbody+tbody{border-color:#d4d9dd}.table-hover .table-dark:hover{background-color:#dadde2}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#dadde2}.table-active,.table-active>th,.table-active>td{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,0.075)}.table .thead-dark th{color:#222;background-color:#adb5bd;border-color:#98a2ac}.table .thead-light th{color:#444;background-color:#ebebeb;border-color:#444}.table-dark{color:#222;background-color:#adb5bd}.table-dark th,.table-dark td,.table-dark thead th{border-color:#98a2ac}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,0.05)}.table-dark.table-hover tbody tr:hover{color:#222;background-color:rgba(255,255,255,0.075)}@media (max-width: 575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width: 767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width: 991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width: 1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 0.75rem;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#444;background-color:#fff;background-clip:padding-box;border:1px solid transparent;border-radius:0.25rem;-webkit-transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.form-control{-webkit-transition:none;transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#444;background-color:#fff;border-color:#739ac2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.form-control::-webkit-input-placeholder{color:#999;opacity:1}.form-control::-ms-input-placeholder{color:#999;opacity:1}.form-control::placeholder{color:#999;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#ebebeb;opacity:1}select.form-control:focus::-ms-value{color:#444;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(0.375rem + 1px);padding-bottom:calc(0.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(0.5rem + 1px);padding-bottom:calc(0.5rem + 1px);font-size:1.171875rem;line-height:1.5}.col-form-label-sm{padding-top:calc(0.25rem + 1px);padding-bottom:calc(0.25rem + 1px);font-size:0.8203125rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:0.375rem;padding-bottom:0.375rem;margin-bottom:0;line-height:1.5;color:#fff;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-sm,.form-control-plaintext.form-control-lg{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + 0.5rem + 2px);padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}select.form-control[size],select.form-control[multiple]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:0.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*="col-"]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:0.3rem;margin-left:-1.25rem}.form-check-input:disabled ~ .form-check-label{color:#999}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:0.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:0.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#00bc8c}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.8203125rem;line-height:1.5;color:#fff;background-color:rgba(0,188,140,0.9);border-radius:0.25rem}.was-validated .form-control:valid,.form-control.is-valid{border-color:#00bc8c;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2300bc8c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:center right calc(0.375em + 0.1875rem);background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:valid:focus,.form-control.is-valid:focus{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated .form-control:valid ~ .valid-feedback,.was-validated .form-control:valid ~ .valid-tooltip,.form-control.is-valid ~ .valid-feedback,.form-control.is-valid ~ .valid-tooltip{display:block}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .custom-select:valid,.custom-select.is-valid{border-color:#00bc8c;padding-right:calc((1em + 0.75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2300bc8c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .custom-select:valid:focus,.custom-select.is-valid:focus{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated .custom-select:valid ~ .valid-feedback,.was-validated .custom-select:valid ~ .valid-tooltip,.custom-select.is-valid ~ .valid-feedback,.custom-select.is-valid ~ .valid-tooltip{display:block}.was-validated .form-control-file:valid ~ .valid-feedback,.was-validated .form-control-file:valid ~ .valid-tooltip,.form-control-file.is-valid ~ .valid-feedback,.form-control-file.is-valid ~ .valid-tooltip{display:block}.was-validated .form-check-input:valid ~ .form-check-label,.form-check-input.is-valid ~ .form-check-label{color:#00bc8c}.was-validated .form-check-input:valid ~ .valid-feedback,.was-validated .form-check-input:valid ~ .valid-tooltip,.form-check-input.is-valid ~ .valid-feedback,.form-check-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-control-input:valid ~ .custom-control-label,.custom-control-input.is-valid ~ .custom-control-label{color:#00bc8c}.was-validated .custom-control-input:valid ~ .custom-control-label::before,.custom-control-input.is-valid ~ .custom-control-label::before{border-color:#00bc8c}.was-validated .custom-control-input:valid ~ .valid-feedback,.was-validated .custom-control-input:valid ~ .valid-tooltip,.custom-control-input.is-valid ~ .valid-feedback,.custom-control-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before,.custom-control-input.is-valid:checked ~ .custom-control-label::before{border-color:#00efb2;background-color:#00efb2}.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before,.custom-control-input.is-valid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated .custom-control-input:valid:focus:not(:checked) ~ .custom-control-label::before,.custom-control-input.is-valid:focus:not(:checked) ~ .custom-control-label::before{border-color:#00bc8c}.was-validated .custom-file-input:valid ~ .custom-file-label,.custom-file-input.is-valid ~ .custom-file-label{border-color:#00bc8c}.was-validated .custom-file-input:valid ~ .valid-feedback,.was-validated .custom-file-input:valid ~ .valid-tooltip,.custom-file-input.is-valid ~ .valid-feedback,.custom-file-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-file-input:valid:focus ~ .custom-file-label,.custom-file-input.is-valid:focus ~ .custom-file-label{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.invalid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#E74C3C}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.8203125rem;line-height:1.5;color:#fff;background-color:rgba(231,76,60,0.9);border-radius:0.25rem}.was-validated .form-control:invalid,.form-control.is-invalid{border-color:#E74C3C;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23E74C3C' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23E74C3C' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");background-repeat:no-repeat;background-position:center right calc(0.375em + 0.1875rem);background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:invalid:focus,.form-control.is-invalid:focus{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated .form-control:invalid ~ .invalid-feedback,.was-validated .form-control:invalid ~ .invalid-tooltip,.form-control.is-invalid ~ .invalid-feedback,.form-control.is-invalid ~ .invalid-tooltip{display:block}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .custom-select:invalid,.custom-select.is-invalid{border-color:#E74C3C;padding-right:calc((1em + 0.75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23E74C3C' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23E74C3C' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .custom-select:invalid:focus,.custom-select.is-invalid:focus{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated .custom-select:invalid ~ .invalid-feedback,.was-validated .custom-select:invalid ~ .invalid-tooltip,.custom-select.is-invalid ~ .invalid-feedback,.custom-select.is-invalid ~ .invalid-tooltip{display:block}.was-validated .form-control-file:invalid ~ .invalid-feedback,.was-validated .form-control-file:invalid ~ .invalid-tooltip,.form-control-file.is-invalid ~ .invalid-feedback,.form-control-file.is-invalid ~ .invalid-tooltip{display:block}.was-validated .form-check-input:invalid ~ .form-check-label,.form-check-input.is-invalid ~ .form-check-label{color:#E74C3C}.was-validated .form-check-input:invalid ~ .invalid-feedback,.was-validated .form-check-input:invalid ~ .invalid-tooltip,.form-check-input.is-invalid ~ .invalid-feedback,.form-check-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-control-input:invalid ~ .custom-control-label,.custom-control-input.is-invalid ~ .custom-control-label{color:#E74C3C}.was-validated .custom-control-input:invalid ~ .custom-control-label::before,.custom-control-input.is-invalid ~ .custom-control-label::before{border-color:#E74C3C}.was-validated .custom-control-input:invalid ~ .invalid-feedback,.was-validated .custom-control-input:invalid ~ .invalid-tooltip,.custom-control-input.is-invalid ~ .invalid-feedback,.custom-control-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before,.custom-control-input.is-invalid:checked ~ .custom-control-label::before{border-color:#ed7669;background-color:#ed7669}.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before,.custom-control-input.is-invalid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated .custom-control-input:invalid:focus:not(:checked) ~ .custom-control-label::before,.custom-control-input.is-invalid:focus:not(:checked) ~ .custom-control-label::before{border-color:#E74C3C}.was-validated .custom-file-input:invalid ~ .custom-file-label,.custom-file-input.is-invalid ~ .custom-file-label{border-color:#E74C3C}.was-validated .custom-file-input:invalid ~ .invalid-feedback,.was-validated .custom-file-input:invalid ~ .invalid-tooltip,.custom-file-input.is-invalid ~ .invalid-feedback,.custom-file-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-file-input:invalid:focus ~ .custom-file-label,.custom-file-input.is-invalid:focus ~ .custom-file-label{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width: 576px){.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group,.form-inline .custom-select{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:0.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#fff;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:0.9375rem;line-height:1.5;border-radius:0.25rem;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.btn{-webkit-transition:none;transition:none}}.btn:hover{color:#fff;text-decoration:none}.btn:focus,.btn.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.btn.disabled,.btn:disabled{opacity:0.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-primary:hover{color:#fff;background-color:#2b4764;border-color:#28415b}.btn-primary:focus,.btn-primary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5);box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-primary:not(:disabled):not(.disabled):active,.btn-primary:not(:disabled):not(.disabled).active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#28415b;border-color:#243a53}.btn-primary:not(:disabled):not(.disabled):active:focus,.btn-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5);box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5)}.btn-secondary{color:#fff;background-color:#444;border-color:#444}.btn-secondary:hover{color:#fff;background-color:#313131;border-color:#2b2a2a}.btn-secondary:focus,.btn-secondary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5);box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#444;border-color:#444}.btn-secondary:not(:disabled):not(.disabled):active,.btn-secondary:not(:disabled):not(.disabled).active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#2b2a2a;border-color:#242424}.btn-secondary:not(:disabled):not(.disabled):active:focus,.btn-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5);box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5)}.btn-success{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-success:hover{color:#fff;background-color:#009670;border-color:#008966}.btn-success:focus,.btn-success.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5);box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-success:not(:disabled):not(.disabled):active,.btn-success:not(:disabled):not(.disabled).active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#008966;border-color:#007c5d}.btn-success:not(:disabled):not(.disabled):active:focus,.btn-success:not(:disabled):not(.disabled).active:focus,.show>.btn-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5);box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5)}.btn-info{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-info:hover{color:#fff;background-color:#2384c6;border-color:#217dbb}.btn-info:focus,.btn-info.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5);box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-info:not(:disabled):not(.disabled):active,.btn-info:not(:disabled):not(.disabled).active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#217dbb;border-color:#1f76b0}.btn-info:not(:disabled):not(.disabled):active:focus,.btn-info:not(:disabled):not(.disabled).active:focus,.show>.btn-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5);box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5)}.btn-warning{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-warning:hover{color:#fff;background-color:#d4860b;border-color:#c87f0a}.btn-warning:focus,.btn-warning.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5);box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5)}.btn-warning.disabled,.btn-warning:disabled{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-warning:not(:disabled):not(.disabled):active,.btn-warning:not(:disabled):not(.disabled).active,.show>.btn-warning.dropdown-toggle{color:#fff;background-color:#c87f0a;border-color:#bc770a}.btn-warning:not(:disabled):not(.disabled):active:focus,.btn-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5);box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5)}.btn-danger{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-danger:hover{color:#fff;background-color:#e12e1c;border-color:#d62c1a}.btn-danger:focus,.btn-danger.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5);box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-danger:not(:disabled):not(.disabled):active,.btn-danger:not(:disabled):not(.disabled).active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#d62c1a;border-color:#ca2a19}.btn-danger:not(:disabled):not(.disabled):active:focus,.btn-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5);box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5)}.btn-light{color:#fff;background-color:#303030;border-color:#303030}.btn-light:hover{color:#fff;background-color:#1d1d1d;border-color:#171616}.btn-light:focus,.btn-light.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5);box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5)}.btn-light.disabled,.btn-light:disabled{color:#fff;background-color:#303030;border-color:#303030}.btn-light:not(:disabled):not(.disabled):active,.btn-light:not(:disabled):not(.disabled).active,.show>.btn-light.dropdown-toggle{color:#fff;background-color:#171616;border-color:#101010}.btn-light:not(:disabled):not(.disabled):active:focus,.btn-light:not(:disabled):not(.disabled).active:focus,.show>.btn-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5);box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5)}.btn-dark{color:#222;background-color:#adb5bd;border-color:#adb5bd}.btn-dark:hover{color:#fff;background-color:#98a2ac;border-color:#919ca6}.btn-dark:focus,.btn-dark.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(152,159,166,0.5);box-shadow:0 0 0 0.2rem rgba(152,159,166,0.5)}.btn-dark.disabled,.btn-dark:disabled{color:#222;background-color:#adb5bd;border-color:#adb5bd}.btn-dark:not(:disabled):not(.disabled):active,.btn-dark:not(:disabled):not(.disabled).active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#919ca6;border-color:#8a95a1}.btn-dark:not(:disabled):not(.disabled):active:focus,.btn-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(152,159,166,0.5);box-shadow:0 0 0 0.2rem rgba(152,159,166,0.5)}.btn-outline-primary{color:#375a7f;border-color:#375a7f}.btn-outline-primary:hover{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-outline-primary:focus,.btn-outline-primary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#375a7f;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled):active,.btn-outline-primary:not(:disabled):not(.disabled).active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.btn-outline-secondary{color:#444;border-color:#444}.btn-outline-secondary:hover{color:#fff;background-color:#444;border-color:#444}.btn-outline-secondary:focus,.btn-outline-secondary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#444;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled):active,.btn-outline-secondary:not(:disabled):not(.disabled).active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#444;border-color:#444}.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.btn-outline-success{color:#00bc8c;border-color:#00bc8c}.btn-outline-success:hover{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-outline-success:focus,.btn-outline-success.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#00bc8c;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled):active,.btn-outline-success:not(:disabled):not(.disabled).active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-outline-success:not(:disabled):not(.disabled):active:focus,.btn-outline-success:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.btn-outline-info{color:#3498DB;border-color:#3498DB}.btn-outline-info:hover{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-outline-info:focus,.btn-outline-info.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#3498DB;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled):active,.btn-outline-info:not(:disabled):not(.disabled).active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-outline-info:not(:disabled):not(.disabled):active:focus,.btn-outline-info:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.btn-outline-warning{color:#F39C12;border-color:#F39C12}.btn-outline-warning:hover{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-outline-warning:focus,.btn-outline-warning.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#F39C12;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled):active,.btn-outline-warning:not(:disabled):not(.disabled).active,.show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.btn-outline-danger{color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:hover{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:focus,.btn-outline-danger.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#E74C3C;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled):active,.btn-outline-danger:not(:disabled):not(.disabled).active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.btn-outline-light{color:#303030;border-color:#303030}.btn-outline-light:hover{color:#fff;background-color:#303030;border-color:#303030}.btn-outline-light:focus,.btn-outline-light.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#303030;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled):active,.btn-outline-light:not(:disabled):not(.disabled).active,.show>.btn-outline-light.dropdown-toggle{color:#fff;background-color:#303030;border-color:#303030}.btn-outline-light:not(:disabled):not(.disabled):active:focus,.btn-outline-light:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.btn-outline-dark{color:#adb5bd;border-color:#adb5bd}.btn-outline-dark:hover{color:#222;background-color:#adb5bd;border-color:#adb5bd}.btn-outline-dark:focus,.btn-outline-dark.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5);box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#adb5bd;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled):active,.btn-outline-dark:not(:disabled):not(.disabled).active,.show>.btn-outline-dark.dropdown-toggle{color:#222;background-color:#adb5bd;border-color:#adb5bd}.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5);box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5)}.btn-link{font-weight:400;color:#00bc8c;text-decoration:none}.btn-link:hover{color:#007053;text-decoration:underline}.btn-link:focus,.btn-link.focus{text-decoration:underline;-webkit-box-shadow:none;box-shadow:none}.btn-link:disabled,.btn-link.disabled{color:#999;pointer-events:none}.btn-lg,.btn-group-lg>.btn{padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}.btn-sm,.btn-group-sm>.btn{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:0.5rem}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{-webkit-transition:opacity 0.15s linear;transition:opacity 0.15s linear}@media (prefers-reduced-motion: reduce){.fade{-webkit-transition:none;transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;transition:height 0.35s ease}@media (prefers-reduced-motion: reduce){.collapsing{-webkit-transition:none;transition:none}}.dropup,.dropright,.dropdown,.dropleft{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid;border-right:0.3em solid transparent;border-bottom:0;border-left:0.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:0.5rem 0;margin:0.125rem 0 0;font-size:0.9375rem;color:#fff;text-align:left;list-style:none;background-color:#222;background-clip:padding-box;border:1px solid #444;border-radius:0.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width: 576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width: 768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width: 992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width: 1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:0.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0;border-right:0.3em solid transparent;border-bottom:0.3em solid;border-left:0.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:0.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0;border-bottom:0.3em solid transparent;border-left:0.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:0.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0.3em solid;border-bottom:0.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^="top"],.dropdown-menu[x-placement^="right"],.dropdown-menu[x-placement^="bottom"],.dropdown-menu[x-placement^="left"]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:0.5rem 0;overflow:hidden;border-top:1px solid #444}.dropdown-item{display:block;width:100%;padding:0.25rem 1.5rem;clear:both;font-weight:400;color:#fff;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:hover,.dropdown-item:focus{color:#fff;text-decoration:none;background-color:#375a7f}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#375a7f}.dropdown-item.disabled,.dropdown-item:disabled{color:#999;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:0.5rem 1.5rem;margin-bottom:0;font-size:0.8203125rem;color:#999;white-space:nowrap}.dropdown-item-text{display:block;padding:0.25rem 1.5rem;color:#fff}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover{z-index:1}.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn.active{z-index:1}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:not(:first-child),.btn-group>.btn-group:not(:first-child){margin-left:-1px}.btn-group>.btn:not(:last-child):not(.dropdown-toggle),.btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:not(:first-child),.btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:0.5625rem;padding-left:0.5625rem}.dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-sm+.dropdown-toggle-split,.btn-group-sm>.btn+.dropdown-toggle-split{padding-right:0.375rem;padding-left:0.375rem}.btn-lg+.dropdown-toggle-split,.btn-group-lg>.btn+.dropdown-toggle-split{padding-right:0.75rem;padding-left:0.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle),.btn-group-vertical>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type="radio"],.btn-group-toggle>.btn input[type="checkbox"],.btn-group-toggle>.btn-group>.btn input[type="radio"],.btn-group-toggle>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-control-plaintext,.input-group>.custom-select,.input-group>.custom-file{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.form-control+.form-control,.input-group>.form-control+.custom-select,.input-group>.form-control+.custom-file,.input-group>.form-control-plaintext+.form-control,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.custom-file,.input-group>.custom-select+.form-control,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.custom-file,.input-group>.custom-file+.form-control,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.custom-file{margin-left:-1px}.input-group>.form-control:focus,.input-group>.custom-select:focus,.input-group>.custom-file .custom-file-input:focus ~ .custom-file-label{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.form-control:not(:last-child),.input-group>.custom-select:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.form-control:not(:first-child),.input-group>.custom-select:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-prepend,.input-group-append{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-prepend .btn,.input-group-append .btn{position:relative;z-index:2}.input-group-prepend .btn:focus,.input-group-append .btn:focus{z-index:3}.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.input-group-text,.input-group-append .input-group-text+.btn{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.375rem 0.75rem;margin-bottom:0;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#adb5bd;text-align:center;white-space:nowrap;background-color:#444;border:1px solid transparent;border-radius:0.25rem}.input-group-text input[type="radio"],.input-group-text input[type="checkbox"]{margin-top:0}.input-group-lg>.form-control:not(textarea),.input-group-lg>.custom-select{height:calc(1.5em + 1rem + 2px)}.input-group-lg>.form-control,.input-group-lg>.custom-select,.input-group-lg>.input-group-prepend>.input-group-text,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-append>.btn{padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}.input-group-sm>.form-control:not(textarea),.input-group-sm>.custom-select{height:calc(1.5em + 0.5rem + 2px)}.input-group-sm>.form-control,.input-group-sm>.custom-select,.input-group-sm>.input-group-prepend>.input-group-text,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-append>.btn{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text,.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.40625rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked ~ .custom-control-label::before{color:#fff;border-color:#375a7f;background-color:#375a7f}.custom-control-input:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-control-input:focus:not(:checked) ~ .custom-control-label::before{border-color:#739ac2}.custom-control-input:not(:disabled):active ~ .custom-control-label::before{color:#fff;background-color:#97b3d2;border-color:#97b3d2}.custom-control-input:disabled ~ .custom-control-label{color:#999}.custom-control-input:disabled ~ .custom-control-label::before{background-color:#ebebeb}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:0.203125rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:0.203125rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50% / 50% 50%}.custom-checkbox .custom-control-label::before{border-radius:0.25rem}.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before{border-color:#375a7f;background-color:#375a7f}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:0.5rem}.custom-switch .custom-control-label::after{top:calc(0.203125rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:0.5rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.custom-switch .custom-control-label::after{-webkit-transition:none;transition:none}}.custom-switch .custom-control-input:checked ~ .custom-control-label::after{background-color:#fff;-webkit-transform:translateX(0.75rem);transform:translateX(0.75rem)}.custom-switch .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 1.75rem 0.375rem 0.75rem;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#444;vertical-align:middle;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px;background-color:#fff;border:1px solid transparent;border-radius:0.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#739ac2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-select:focus::-ms-value{color:#444;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:0.75rem;background-image:none}.custom-select:disabled{color:#999;background-color:#ebebeb}.custom-select::-ms-expand{display:none}.custom-select-sm{height:calc(1.5em + 0.5rem + 2px);padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.5rem;font-size:0.8203125rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;font-size:1.171875rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + 0.75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + 0.75rem + 2px);margin:0;opacity:0}.custom-file-input:focus ~ .custom-file-label{border-color:#739ac2;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-file-input:disabled ~ .custom-file-label{background-color:#ebebeb}.custom-file-input:lang(en) ~ .custom-file-label::after{content:"Browse"}.custom-file-input ~ .custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 0.75rem;font-weight:400;line-height:1.5;color:#adb5bd;background-color:#fff;border:1px solid #444;border-radius:0.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + 0.75rem);padding:0.375rem 0.75rem;line-height:1.5;color:#adb5bd;content:"Browse";background-color:#444;border-left:inherit;border-radius:0 0.25rem 0.25rem 0}.custom-range{width:100%;height:calc(1rem + 0.4rem);padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:none}.custom-range:focus::-webkit-slider-thumb{-webkit-box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-0.25rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#97b3d2}.custom-range::-webkit-slider-runnable-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-moz-range-thumb{-webkit-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#97b3d2}.custom-range::-moz-range-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:0.2rem;margin-left:0.2rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-ms-thumb{-webkit-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#97b3d2}.custom-range::-ms-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:0.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:none;transition:none}}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:0.5rem 2rem}.nav-link:hover,.nav-link:focus{text-decoration:none}.nav-link.disabled{color:#adb5bd;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #444}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{border-color:#444 #444 transparent}.nav-tabs .nav-link.disabled{color:#adb5bd;background-color:transparent;border-color:transparent}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:#fff;background-color:#222;border-color:#444 #444 transparent}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:0.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#375a7f}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:0.32421875rem;padding-bottom:0.32421875rem;margin-right:1rem;font-size:1.171875rem;line-height:inherit;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:0.5rem;padding-bottom:0.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:0.25rem 0.75rem;font-size:1.171875rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:0.25rem}.navbar-toggler:hover,.navbar-toggler:focus{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width: 575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 576px){.navbar-expand-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width: 767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 768px){.navbar-expand-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width: 991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 992px){.navbar-expand-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width: 1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 1200px){.navbar-expand-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:#fff}.navbar-light .navbar-brand:hover,.navbar-light .navbar-brand:focus{color:#fff}.navbar-light .navbar-nav .nav-link{color:rgba(255,255,255,0.5)}.navbar-light .navbar-nav .nav-link:hover,.navbar-light .navbar-nav .nav-link:focus{color:#fff}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(255,255,255,0.3)}.navbar-light .navbar-nav .show>.nav-link,.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .nav-link.active{color:#fff}.navbar-light .navbar-toggler{color:rgba(255,255,255,0.5);border-color:rgba(255,255,255,0.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(255,255,255,0.5)}.navbar-light .navbar-text a{color:#fff}.navbar-light .navbar-text a:hover,.navbar-light .navbar-text a:focus{color:#fff}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:hover,.navbar-dark .navbar-brand:focus{color:#fff}.navbar-dark .navbar-nav .nav-link{color:#fff}.navbar-dark .navbar-nav .nav-link:hover,.navbar-dark .navbar-nav .nav-link:focus{color:#00bc8c}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,0.25)}.navbar-dark .navbar-nav .show>.nav-link,.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .nav-link.active{color:#fff}.navbar-dark .navbar-toggler{color:#fff;border-color:rgba(255,255,255,0.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:#fff}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:hover,.navbar-dark .navbar-text a:focus{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#303030;background-clip:border-box;border:1px solid rgba(0,0,0,0.125);border-radius:0.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:0.75rem}.card-subtitle{margin-top:-0.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:0.75rem 1.25rem;margin-bottom:0;background-color:#444;border-bottom:1px solid rgba(0,0,0,0.125)}.card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:0.75rem 1.25rem;background-color:#444;border-top:1px solid rgba(0,0,0,0.125)}.card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.card-header-tabs{margin-right:-0.625rem;margin-bottom:-0.75rem;margin-left:-0.625rem;border-bottom:0}.card-header-pills{margin-right:-0.625rem;margin-left:-0.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(0.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(0.25rem - 1px);border-bottom-left-radius:calc(0.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width: 576px){.card-deck{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width: 576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-img-top,.card-group>.card:not(:last-child) .card-header{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-img-bottom,.card-group>.card:not(:last-child) .card-footer{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-img-top,.card-group>.card:not(:first-child) .card-header{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-img-bottom,.card-group>.card:not(:first-child) .card-footer{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:0.75rem}@media (min-width: 576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:first-of-type) .card-header:first-child{border-radius:0}.accordion>.card:not(:first-of-type):not(:last-of-type){border-bottom:0;border-radius:0}.accordion>.card:first-of-type{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:last-of-type{border-top-left-radius:0;border-top-right-radius:0}.accordion>.card .card-header{margin-bottom:-1px}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#444;border-radius:0.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:0.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:0.5rem;color:#999;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#999}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:0.25rem}.page-link{position:relative;display:block;padding:0.5rem 0.75rem;margin-left:0;line-height:1.25;color:#fff;background-color:#00bc8c;border:0 solid transparent}.page-link:hover{z-index:2;color:#fff;text-decoration:none;background-color:#00efb2;border-color:transparent}.page-link:focus{z-index:2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem}.page-item:last-child .page-link{border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#00efb2;border-color:transparent}.page-item.disabled .page-link{color:#fff;pointer-events:none;cursor:auto;background-color:#007053;border-color:transparent}.pagination-lg .page-link{padding:0.75rem 1.5rem;font-size:1.171875rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:0.3rem;border-bottom-left-radius:0.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:0.3rem;border-bottom-right-radius:0.3rem}.pagination-sm .page-link{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:0.2rem;border-bottom-left-radius:0.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:0.2rem;border-bottom-right-radius:0.2rem}.badge{display:inline-block;padding:0.25em 0.4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:0.25rem;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.badge{-webkit-transition:none;transition:none}}a.badge:hover,a.badge:focus{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:0.6em;padding-left:0.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#375a7f}a.badge-primary:hover,a.badge-primary:focus{color:#fff;background-color:#28415b}a.badge-primary:focus,a.badge-primary.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.badge-secondary{color:#fff;background-color:#444}a.badge-secondary:hover,a.badge-secondary:focus{color:#fff;background-color:#2b2a2a}a.badge-secondary:focus,a.badge-secondary.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.badge-success{color:#fff;background-color:#00bc8c}a.badge-success:hover,a.badge-success:focus{color:#fff;background-color:#008966}a.badge-success:focus,a.badge-success.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.badge-info{color:#fff;background-color:#3498DB}a.badge-info:hover,a.badge-info:focus{color:#fff;background-color:#217dbb}a.badge-info:focus,a.badge-info.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.badge-warning{color:#fff;background-color:#F39C12}a.badge-warning:hover,a.badge-warning:focus{color:#fff;background-color:#c87f0a}a.badge-warning:focus,a.badge-warning.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.badge-danger{color:#fff;background-color:#E74C3C}a.badge-danger:hover,a.badge-danger:focus{color:#fff;background-color:#d62c1a}a.badge-danger:focus,a.badge-danger.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.badge-light{color:#fff;background-color:#303030}a.badge-light:hover,a.badge-light:focus{color:#fff;background-color:#171616}a.badge-light:focus,a.badge-light.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.badge-dark{color:#222;background-color:#adb5bd}a.badge-dark:hover,a.badge-dark:focus{color:#222;background-color:#919ca6}a.badge-dark:focus,a.badge-dark.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5);box-shadow:0 0 0 0.2rem rgba(173,181,189,0.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#303030;border-radius:0.3rem}@media (min-width: 576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3.90625rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:0.75rem 1.25rem;color:inherit}.alert-primary{color:#1d2f42;background-color:#d7dee5;border-color:#c7d1db}.alert-primary hr{border-top-color:#b7c4d1}.alert-primary .alert-link{color:#0d161f}.alert-secondary{color:#232323;background-color:#dadada;border-color:#cbcbcb}.alert-secondary hr{border-top-color:#bebebe}.alert-secondary .alert-link{color:#0a0909}.alert-success{color:#006249;background-color:#ccf2e8;border-color:#b8ecdf}.alert-success hr{border-top-color:#a4e7d6}.alert-success .alert-link{color:#002f23}.alert-info{color:#1b4f72;background-color:#d6eaf8;border-color:#c6e2f5}.alert-info hr{border-top-color:#b0d7f1}.alert-info .alert-link{color:#113249}.alert-warning{color:#7e5109;background-color:#fdebd0;border-color:#fce3bd}.alert-warning hr{border-top-color:#fbd9a5}.alert-warning .alert-link{color:#4e3206}.alert-danger{color:#78281f;background-color:#fadbd8;border-color:#f8cdc8}.alert-danger hr{border-top-color:#f5b8b1}.alert-danger .alert-link{color:#4f1a15}.alert-light{color:#191919;background-color:#d6d6d6;border-color:#c5c5c5}.alert-light hr{border-top-color:#b8b8b8}.alert-light .alert-link{color:black}.alert-dark{color:#5a5e62;background-color:#eff0f2;border-color:#e8eaed}.alert-dark hr{border-top-color:#dadde2}.alert-dark .alert-link{color:#424547}@-webkit-keyframes progress-bar-stripes{from{background-position:0.625rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:0.625rem 0}to{background-position:0 0}}.progress{display:-webkit-box;display:-ms-flexbox;display:flex;height:0.625rem;overflow:hidden;font-size:0.625rem;background-color:#444;border-radius:0.25rem}.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#375a7f;-webkit-transition:width 0.6s ease;transition:width 0.6s ease}@media (prefers-reduced-motion: reduce){.progress-bar{-webkit-transition:none;transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-size:0.625rem 0.625rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion: reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#444;text-align:inherit}.list-group-item-action:hover,.list-group-item-action:focus{z-index:1;color:#444;text-decoration:none;background-color:#444}.list-group-item-action:active{color:#fff;background-color:#ebebeb}.list-group-item{position:relative;display:block;padding:0.75rem 1.25rem;margin-bottom:-1px;background-color:#303030;border:1px solid #444}.list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.list-group-item.disabled,.list-group-item:disabled{color:#999;pointer-events:none;background-color:#303030}.list-group-item.active{z-index:2;color:#fff;background-color:#375a7f;border-color:#375a7f}.list-group-horizontal{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal .list-group-item:first-child{border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal .list-group-item:last-child{margin-right:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0}@media (min-width: 576px){.list-group-horizontal-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-sm .list-group-item:first-child{border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-sm .list-group-item:last-child{margin-right:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0}}@media (min-width: 768px){.list-group-horizontal-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-md .list-group-item:first-child{border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-md .list-group-item:last-child{margin-right:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0}}@media (min-width: 992px){.list-group-horizontal-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-lg .list-group-item:first-child{border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-lg .list-group-item:last-child{margin-right:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0}}@media (min-width: 1200px){.list-group-horizontal-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-xl .list-group-item:first-child{border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-xl .list-group-item:last-child{margin-right:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0}}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush .list-group-item:last-child{margin-bottom:-1px}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{margin-bottom:0;border-bottom:0}.list-group-item-primary{color:#1d2f42;background-color:#c7d1db}.list-group-item-primary.list-group-item-action:hover,.list-group-item-primary.list-group-item-action:focus{color:#1d2f42;background-color:#b7c4d1}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#1d2f42;border-color:#1d2f42}.list-group-item-secondary{color:#232323;background-color:#cbcbcb}.list-group-item-secondary.list-group-item-action:hover,.list-group-item-secondary.list-group-item-action:focus{color:#232323;background-color:#bebebe}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#232323;border-color:#232323}.list-group-item-success{color:#006249;background-color:#b8ecdf}.list-group-item-success.list-group-item-action:hover,.list-group-item-success.list-group-item-action:focus{color:#006249;background-color:#a4e7d6}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#006249;border-color:#006249}.list-group-item-info{color:#1b4f72;background-color:#c6e2f5}.list-group-item-info.list-group-item-action:hover,.list-group-item-info.list-group-item-action:focus{color:#1b4f72;background-color:#b0d7f1}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#1b4f72;border-color:#1b4f72}.list-group-item-warning{color:#7e5109;background-color:#fce3bd}.list-group-item-warning.list-group-item-action:hover,.list-group-item-warning.list-group-item-action:focus{color:#7e5109;background-color:#fbd9a5}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#7e5109;border-color:#7e5109}.list-group-item-danger{color:#78281f;background-color:#f8cdc8}.list-group-item-danger.list-group-item-action:hover,.list-group-item-danger.list-group-item-action:focus{color:#78281f;background-color:#f5b8b1}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#78281f;border-color:#78281f}.list-group-item-light{color:#191919;background-color:#c5c5c5}.list-group-item-light.list-group-item-action:hover,.list-group-item-light.list-group-item-action:focus{color:#191919;background-color:#b8b8b8}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#191919;border-color:#191919}.list-group-item-dark{color:#5a5e62;background-color:#e8eaed}.list-group-item-dark.list-group-item-action:hover,.list-group-item-dark.list-group-item-action:focus{color:#5a5e62;background-color:#dadde2}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#5a5e62;border-color:#5a5e62}.close{float:right;font-size:1.40625rem;font-weight:700;line-height:1;color:#fff;text-shadow:none;opacity:.5}.close:hover{color:#fff;text-decoration:none}.close:not(:disabled):not(.disabled):hover,.close:not(:disabled):not(.disabled):focus{opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:0.875rem;background-color:rgba(255,255,255,0.85);background-clip:padding-box;border:1px solid rgba(0,0,0,0.1);-webkit-box-shadow:0 0.25rem 0.75rem rgba(0,0,0,0.1);box-shadow:0 0.25rem 0.75rem rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:0.25rem}.toast:not(:last-child){margin-bottom:0.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.25rem 0.75rem;color:#999;background-color:rgba(255,255,255,0.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,0.05)}.toast-body{padding:0.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:0.5rem;pointer-events:none}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform 0.3s ease-out;transition:-webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out;transition:transform 0.3s ease-out, -webkit-transform 0.3s ease-out;-webkit-transform:translate(0, -50px);transform:translate(0, -50px)}@media (prefers-reduced-motion: reduce){.modal.fade .modal-dialog{-webkit-transition:none;transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal-dialog-scrollable{display:-webkit-box;display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-header,.modal-dialog-scrollable .modal-footer{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);content:""}.modal-dialog-centered.modal-dialog-scrollable{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#303030;background-clip:padding-box;border:1px solid #444;border-radius:0.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:0.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #444;border-top-left-radius:0.3rem;border-top-right-radius:0.3rem}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #444;border-bottom-right-radius:0.3rem;border-bottom-left-radius:0.3rem}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width: 576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width: 992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width: 1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.8203125rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:0.9}.tooltip .arrow{position:absolute;display:block;width:0.8rem;height:0.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-top,.bs-tooltip-auto[x-placement^="top"]{padding:0.4rem 0}.bs-tooltip-top .arrow,.bs-tooltip-auto[x-placement^="top"] .arrow{bottom:0}.bs-tooltip-top .arrow::before,.bs-tooltip-auto[x-placement^="top"] .arrow::before{top:0;border-width:0.4rem 0.4rem 0;border-top-color:#000}.bs-tooltip-right,.bs-tooltip-auto[x-placement^="right"]{padding:0 0.4rem}.bs-tooltip-right .arrow,.bs-tooltip-auto[x-placement^="right"] .arrow{left:0;width:0.4rem;height:0.8rem}.bs-tooltip-right .arrow::before,.bs-tooltip-auto[x-placement^="right"] .arrow::before{right:0;border-width:0.4rem 0.4rem 0.4rem 0;border-right-color:#000}.bs-tooltip-bottom,.bs-tooltip-auto[x-placement^="bottom"]{padding:0.4rem 0}.bs-tooltip-bottom .arrow,.bs-tooltip-auto[x-placement^="bottom"] .arrow{top:0}.bs-tooltip-bottom .arrow::before,.bs-tooltip-auto[x-placement^="bottom"] .arrow::before{bottom:0;border-width:0 0.4rem 0.4rem;border-bottom-color:#000}.bs-tooltip-left,.bs-tooltip-auto[x-placement^="left"]{padding:0 0.4rem}.bs-tooltip-left .arrow,.bs-tooltip-auto[x-placement^="left"] .arrow{right:0;width:0.4rem;height:0.8rem}.bs-tooltip-left .arrow::before,.bs-tooltip-auto[x-placement^="left"] .arrow::before{left:0;border-width:0.4rem 0 0.4rem 0.4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:0.25rem 0.5rem;color:#fff;text-align:center;background-color:#000;border-radius:0.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.8203125rem;word-wrap:break-word;background-color:#303030;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:0.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:0.5rem;margin:0 0.3rem}.popover .arrow::before,.popover .arrow::after{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-top,.bs-popover-auto[x-placement^="top"]{margin-bottom:0.5rem}.bs-popover-top>.arrow,.bs-popover-auto[x-placement^="top"]>.arrow{bottom:calc((0.5rem + 1px) * -1)}.bs-popover-top>.arrow::before,.bs-popover-auto[x-placement^="top"]>.arrow::before{bottom:0;border-width:0.5rem 0.5rem 0;border-top-color:rgba(0,0,0,0.25)}.bs-popover-top>.arrow::after,.bs-popover-auto[x-placement^="top"]>.arrow::after{bottom:1px;border-width:0.5rem 0.5rem 0;border-top-color:#303030}.bs-popover-right,.bs-popover-auto[x-placement^="right"]{margin-left:0.5rem}.bs-popover-right>.arrow,.bs-popover-auto[x-placement^="right"]>.arrow{left:calc((0.5rem + 1px) * -1);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-right>.arrow::before,.bs-popover-auto[x-placement^="right"]>.arrow::before{left:0;border-width:0.5rem 0.5rem 0.5rem 0;border-right-color:rgba(0,0,0,0.25)}.bs-popover-right>.arrow::after,.bs-popover-auto[x-placement^="right"]>.arrow::after{left:1px;border-width:0.5rem 0.5rem 0.5rem 0;border-right-color:#303030}.bs-popover-bottom,.bs-popover-auto[x-placement^="bottom"]{margin-top:0.5rem}.bs-popover-bottom>.arrow,.bs-popover-auto[x-placement^="bottom"]>.arrow{top:calc((0.5rem + 1px) * -1)}.bs-popover-bottom>.arrow::before,.bs-popover-auto[x-placement^="bottom"]>.arrow::before{top:0;border-width:0 0.5rem 0.5rem 0.5rem;border-bottom-color:rgba(0,0,0,0.25)}.bs-popover-bottom>.arrow::after,.bs-popover-auto[x-placement^="bottom"]>.arrow::after{top:1px;border-width:0 0.5rem 0.5rem 0.5rem;border-bottom-color:#303030}.bs-popover-bottom .popover-header::before,.bs-popover-auto[x-placement^="bottom"] .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-0.5rem;content:"";border-bottom:1px solid #444}.bs-popover-left,.bs-popover-auto[x-placement^="left"]{margin-right:0.5rem}.bs-popover-left>.arrow,.bs-popover-auto[x-placement^="left"]>.arrow{right:calc((0.5rem + 1px) * -1);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-left>.arrow::before,.bs-popover-auto[x-placement^="left"]>.arrow::before{right:0;border-width:0.5rem 0 0.5rem 0.5rem;border-left-color:rgba(0,0,0,0.25)}.bs-popover-left>.arrow::after,.bs-popover-auto[x-placement^="left"]>.arrow::after{right:1px;border-width:0.5rem 0 0.5rem 0.5rem;border-left-color:#303030}.popover-header{padding:0.5rem 0.75rem;margin-bottom:0;font-size:0.9375rem;background-color:#444;border-bottom:1px solid #373737;border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:0.5rem 0.75rem;color:#fff}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:-webkit-transform 0.6s ease-in-out;transition:-webkit-transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out}@media (prefers-reduced-motion: reduce){.carousel-item{-webkit-transition:none;transition:none}}.carousel-item.active,.carousel-item-next,.carousel-item-prev{display:block}.carousel-item-next:not(.carousel-item-left),.active.carousel-item-right{-webkit-transform:translateX(100%);transform:translateX(100%)}.carousel-item-prev:not(.carousel-item-right),.active.carousel-item-left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item.active,.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;-webkit-transition:0s 0.6s opacity;transition:0s 0.6s opacity}@media (prefers-reduced-motion: reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{-webkit-transition:none;transition:none}}.carousel-control-prev,.carousel-control-next{position:absolute;top:0;bottom:0;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:0.5;-webkit-transition:opacity 0.15s ease;transition:opacity 0.15s ease}@media (prefers-reduced-motion: reduce){.carousel-control-prev,.carousel-control-next{-webkit-transition:none;transition:none}}.carousel-control-prev:hover,.carousel-control-prev:focus,.carousel-control-next:hover,.carousel-control-next:focus{color:#fff;text-decoration:none;outline:0;opacity:0.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-prev-icon,.carousel-control-next-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50% / 100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;-webkit-transition:opacity 0.6s ease;transition:opacity 0.6s ease}@media (prefers-reduced-motion: reduce){.carousel-indicators li{-webkit-transition:none;transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:0.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:0.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline !important}.align-top{vertical-align:top !important}.align-middle{vertical-align:middle !important}.align-bottom{vertical-align:bottom !important}.align-text-bottom{vertical-align:text-bottom !important}.align-text-top{vertical-align:text-top !important}.bg-primary{background-color:#375a7f !important}a.bg-primary:hover,a.bg-primary:focus,button.bg-primary:hover,button.bg-primary:focus{background-color:#28415b !important}.bg-secondary{background-color:#444 !important}a.bg-secondary:hover,a.bg-secondary:focus,button.bg-secondary:hover,button.bg-secondary:focus{background-color:#2b2a2a !important}.bg-success{background-color:#00bc8c !important}a.bg-success:hover,a.bg-success:focus,button.bg-success:hover,button.bg-success:focus{background-color:#008966 !important}.bg-info{background-color:#3498DB !important}a.bg-info:hover,a.bg-info:focus,button.bg-info:hover,button.bg-info:focus{background-color:#217dbb !important}.bg-warning{background-color:#F39C12 !important}a.bg-warning:hover,a.bg-warning:focus,button.bg-warning:hover,button.bg-warning:focus{background-color:#c87f0a !important}.bg-danger{background-color:#E74C3C !important}a.bg-danger:hover,a.bg-danger:focus,button.bg-danger:hover,button.bg-danger:focus{background-color:#d62c1a !important}.bg-light{background-color:#303030 !important}a.bg-light:hover,a.bg-light:focus,button.bg-light:hover,button.bg-light:focus{background-color:#171616 !important}.bg-dark{background-color:#adb5bd !important}a.bg-dark:hover,a.bg-dark:focus,button.bg-dark:hover,button.bg-dark:focus{background-color:#919ca6 !important}.bg-white{background-color:#fff !important}.bg-transparent{background-color:transparent !important}.border{border:1px solid #dee2e6 !important}.border-top{border-top:1px solid #dee2e6 !important}.border-right{border-right:1px solid #dee2e6 !important}.border-bottom{border-bottom:1px solid #dee2e6 !important}.border-left{border-left:1px solid #dee2e6 !important}.border-0{border:0 !important}.border-top-0{border-top:0 !important}.border-right-0{border-right:0 !important}.border-bottom-0{border-bottom:0 !important}.border-left-0{border-left:0 !important}.border-primary{border-color:#375a7f !important}.border-secondary{border-color:#444 !important}.border-success{border-color:#00bc8c !important}.border-info{border-color:#3498DB !important}.border-warning{border-color:#F39C12 !important}.border-danger{border-color:#E74C3C !important}.border-light{border-color:#303030 !important}.border-dark{border-color:#adb5bd !important}.border-white{border-color:#fff !important}.rounded-sm{border-radius:0.2rem !important}.rounded{border-radius:0.25rem !important}.rounded-top{border-top-left-radius:0.25rem !important;border-top-right-radius:0.25rem !important}.rounded-right{border-top-right-radius:0.25rem !important;border-bottom-right-radius:0.25rem !important}.rounded-bottom{border-bottom-right-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-left{border-top-left-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-lg{border-radius:0.3rem !important}.rounded-circle{border-radius:50% !important}.rounded-pill{border-radius:50rem !important}.rounded-0{border-radius:0 !important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none !important}.d-inline{display:inline !important}.d-inline-block{display:inline-block !important}.d-block{display:block !important}.d-table{display:table !important}.d-table-row{display:table-row !important}.d-table-cell{display:table-cell !important}.d-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}@media (min-width: 576px){.d-sm-none{display:none !important}.d-sm-inline{display:inline !important}.d-sm-inline-block{display:inline-block !important}.d-sm-block{display:block !important}.d-sm-table{display:table !important}.d-sm-table-row{display:table-row !important}.d-sm-table-cell{display:table-cell !important}.d-sm-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-sm-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 768px){.d-md-none{display:none !important}.d-md-inline{display:inline !important}.d-md-inline-block{display:inline-block !important}.d-md-block{display:block !important}.d-md-table{display:table !important}.d-md-table-row{display:table-row !important}.d-md-table-cell{display:table-cell !important}.d-md-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-md-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 992px){.d-lg-none{display:none !important}.d-lg-inline{display:inline !important}.d-lg-inline-block{display:inline-block !important}.d-lg-block{display:block !important}.d-lg-table{display:table !important}.d-lg-table-row{display:table-row !important}.d-lg-table-cell{display:table-cell !important}.d-lg-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-lg-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 1200px){.d-xl-none{display:none !important}.d-xl-inline{display:inline !important}.d-xl-inline-block{display:inline-block !important}.d-xl-block{display:block !important}.d-xl-table{display:table !important}.d-xl-table-row{display:table-row !important}.d-xl-table-cell{display:table-cell !important}.d-xl-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-xl-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media print{.d-print-none{display:none !important}.d-print-inline{display:inline !important}.d-print-inline-block{display:inline-block !important}.d-print-block{display:block !important}.d-print-table{display:table !important}.d-print-table-row{display:table-row !important}.d-print-table-cell{display:table-cell !important}.d-print-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-print-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.8571428571%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}@media (min-width: 576px){.flex-sm-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-sm-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-sm-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-sm-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-sm-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-sm-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-sm-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-sm-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-sm-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-sm-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-sm-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-sm-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-sm-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-sm-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-sm-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-sm-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-sm-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-sm-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-sm-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-sm-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-sm-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-sm-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-sm-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-sm-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-sm-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-sm-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-sm-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-sm-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-sm-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-sm-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-sm-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-sm-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-sm-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 768px){.flex-md-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-md-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-md-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-md-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-md-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-md-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-md-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-md-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-md-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-md-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-md-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-md-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-md-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-md-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-md-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-md-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-md-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-md-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-md-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-md-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-md-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-md-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-md-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-md-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-md-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-md-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-md-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-md-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-md-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-md-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-md-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-md-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-md-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 992px){.flex-lg-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-lg-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-lg-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-lg-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-lg-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-lg-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-lg-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-lg-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-lg-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-lg-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-lg-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-lg-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-lg-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-lg-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-lg-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-lg-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-lg-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-lg-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-lg-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-lg-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-lg-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-lg-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-lg-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-lg-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-lg-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-lg-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-lg-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-lg-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-lg-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-lg-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-lg-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-lg-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-lg-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 1200px){.flex-xl-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-xl-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-xl-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-xl-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-xl-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-xl-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-xl-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-xl-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-xl-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-xl-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-xl-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-xl-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-xl-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-xl-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-xl-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-xl-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-xl-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-xl-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-xl-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-xl-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-xl-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-xl-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-xl-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-xl-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-xl-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-xl-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-xl-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-xl-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-xl-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-xl-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-xl-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-xl-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-xl-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}.float-left{float:left !important}.float-right{float:right !important}.float-none{float:none !important}@media (min-width: 576px){.float-sm-left{float:left !important}.float-sm-right{float:right !important}.float-sm-none{float:none !important}}@media (min-width: 768px){.float-md-left{float:left !important}.float-md-right{float:right !important}.float-md-none{float:none !important}}@media (min-width: 992px){.float-lg-left{float:left !important}.float-lg-right{float:right !important}.float-lg-none{float:none !important}}@media (min-width: 1200px){.float-xl-left{float:left !important}.float-xl-right{float:right !important}.float-xl-none{float:none !important}}.overflow-auto{overflow:auto !important}.overflow-hidden{overflow:hidden !important}.position-static{position:static !important}.position-relative{position:relative !important}.position-absolute{position:absolute !important}.position-fixed{position:fixed !important}.position-sticky{position:-webkit-sticky !important;position:sticky !important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports (position: -webkit-sticky) or (position: sticky){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{-webkit-box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important}.shadow{-webkit-box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important;box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important}.shadow-lg{-webkit-box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important;box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important}.shadow-none{-webkit-box-shadow:none !important;box-shadow:none !important}.w-25{width:25% !important}.w-50{width:50% !important}.w-75{width:75% !important}.w-100{width:100% !important}.w-auto{width:auto !important}.h-25{height:25% !important}.h-50{height:50% !important}.h-75{height:75% !important}.h-100{height:100% !important}.h-auto{height:auto !important}.mw-100{max-width:100% !important}.mh-100{max-height:100% !important}.min-vw-100{min-width:100vw !important}.min-vh-100{min-height:100vh !important}.vw-100{width:100vw !important}.vh-100{height:100vh !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.m-0{margin:0 !important}.mt-0,.my-0{margin-top:0 !important}.mr-0,.mx-0{margin-right:0 !important}.mb-0,.my-0{margin-bottom:0 !important}.ml-0,.mx-0{margin-left:0 !important}.m-1{margin:0.25rem !important}.mt-1,.my-1{margin-top:0.25rem !important}.mr-1,.mx-1{margin-right:0.25rem !important}.mb-1,.my-1{margin-bottom:0.25rem !important}.ml-1,.mx-1{margin-left:0.25rem !important}.m-2{margin:0.5rem !important}.mt-2,.my-2{margin-top:0.5rem !important}.mr-2,.mx-2{margin-right:0.5rem !important}.mb-2,.my-2{margin-bottom:0.5rem !important}.ml-2,.mx-2{margin-left:0.5rem !important}.m-3{margin:1rem !important}.mt-3,.my-3{margin-top:1rem !important}.mr-3,.mx-3{margin-right:1rem !important}.mb-3,.my-3{margin-bottom:1rem !important}.ml-3,.mx-3{margin-left:1rem !important}.m-4{margin:1.5rem !important}.mt-4,.my-4{margin-top:1.5rem !important}.mr-4,.mx-4{margin-right:1.5rem !important}.mb-4,.my-4{margin-bottom:1.5rem !important}.ml-4,.mx-4{margin-left:1.5rem !important}.m-5{margin:3rem !important}.mt-5,.my-5{margin-top:3rem !important}.mr-5,.mx-5{margin-right:3rem !important}.mb-5,.my-5{margin-bottom:3rem !important}.ml-5,.mx-5{margin-left:3rem !important}.p-0{padding:0 !important}.pt-0,.py-0{padding-top:0 !important}.pr-0,.px-0{padding-right:0 !important}.pb-0,.py-0{padding-bottom:0 !important}.pl-0,.px-0{padding-left:0 !important}.p-1{padding:0.25rem !important}.pt-1,.py-1{padding-top:0.25rem !important}.pr-1,.px-1{padding-right:0.25rem !important}.pb-1,.py-1{padding-bottom:0.25rem !important}.pl-1,.px-1{padding-left:0.25rem !important}.p-2{padding:0.5rem !important}.pt-2,.py-2{padding-top:0.5rem !important}.pr-2,.px-2{padding-right:0.5rem !important}.pb-2,.py-2{padding-bottom:0.5rem !important}.pl-2,.px-2{padding-left:0.5rem !important}.p-3{padding:1rem !important}.pt-3,.py-3{padding-top:1rem !important}.pr-3,.px-3{padding-right:1rem !important}.pb-3,.py-3{padding-bottom:1rem !important}.pl-3,.px-3{padding-left:1rem !important}.p-4{padding:1.5rem !important}.pt-4,.py-4{padding-top:1.5rem !important}.pr-4,.px-4{padding-right:1.5rem !important}.pb-4,.py-4{padding-bottom:1.5rem !important}.pl-4,.px-4{padding-left:1.5rem !important}.p-5{padding:3rem !important}.pt-5,.py-5{padding-top:3rem !important}.pr-5,.px-5{padding-right:3rem !important}.pb-5,.py-5{padding-bottom:3rem !important}.pl-5,.px-5{padding-left:3rem !important}.m-n1{margin:-0.25rem !important}.mt-n1,.my-n1{margin-top:-0.25rem !important}.mr-n1,.mx-n1{margin-right:-0.25rem !important}.mb-n1,.my-n1{margin-bottom:-0.25rem !important}.ml-n1,.mx-n1{margin-left:-0.25rem !important}.m-n2{margin:-0.5rem !important}.mt-n2,.my-n2{margin-top:-0.5rem !important}.mr-n2,.mx-n2{margin-right:-0.5rem !important}.mb-n2,.my-n2{margin-bottom:-0.5rem !important}.ml-n2,.mx-n2{margin-left:-0.5rem !important}.m-n3{margin:-1rem !important}.mt-n3,.my-n3{margin-top:-1rem !important}.mr-n3,.mx-n3{margin-right:-1rem !important}.mb-n3,.my-n3{margin-bottom:-1rem !important}.ml-n3,.mx-n3{margin-left:-1rem !important}.m-n4{margin:-1.5rem !important}.mt-n4,.my-n4{margin-top:-1.5rem !important}.mr-n4,.mx-n4{margin-right:-1.5rem !important}.mb-n4,.my-n4{margin-bottom:-1.5rem !important}.ml-n4,.mx-n4{margin-left:-1.5rem !important}.m-n5{margin:-3rem !important}.mt-n5,.my-n5{margin-top:-3rem !important}.mr-n5,.mx-n5{margin-right:-3rem !important}.mb-n5,.my-n5{margin-bottom:-3rem !important}.ml-n5,.mx-n5{margin-left:-3rem !important}.m-auto{margin:auto !important}.mt-auto,.my-auto{margin-top:auto !important}.mr-auto,.mx-auto{margin-right:auto !important}.mb-auto,.my-auto{margin-bottom:auto !important}.ml-auto,.mx-auto{margin-left:auto !important}@media (min-width: 576px){.m-sm-0{margin:0 !important}.mt-sm-0,.my-sm-0{margin-top:0 !important}.mr-sm-0,.mx-sm-0{margin-right:0 !important}.mb-sm-0,.my-sm-0{margin-bottom:0 !important}.ml-sm-0,.mx-sm-0{margin-left:0 !important}.m-sm-1{margin:0.25rem !important}.mt-sm-1,.my-sm-1{margin-top:0.25rem !important}.mr-sm-1,.mx-sm-1{margin-right:0.25rem !important}.mb-sm-1,.my-sm-1{margin-bottom:0.25rem !important}.ml-sm-1,.mx-sm-1{margin-left:0.25rem !important}.m-sm-2{margin:0.5rem !important}.mt-sm-2,.my-sm-2{margin-top:0.5rem !important}.mr-sm-2,.mx-sm-2{margin-right:0.5rem !important}.mb-sm-2,.my-sm-2{margin-bottom:0.5rem !important}.ml-sm-2,.mx-sm-2{margin-left:0.5rem !important}.m-sm-3{margin:1rem !important}.mt-sm-3,.my-sm-3{margin-top:1rem !important}.mr-sm-3,.mx-sm-3{margin-right:1rem !important}.mb-sm-3,.my-sm-3{margin-bottom:1rem !important}.ml-sm-3,.mx-sm-3{margin-left:1rem !important}.m-sm-4{margin:1.5rem !important}.mt-sm-4,.my-sm-4{margin-top:1.5rem !important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem !important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem !important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem !important}.m-sm-5{margin:3rem !important}.mt-sm-5,.my-sm-5{margin-top:3rem !important}.mr-sm-5,.mx-sm-5{margin-right:3rem !important}.mb-sm-5,.my-sm-5{margin-bottom:3rem !important}.ml-sm-5,.mx-sm-5{margin-left:3rem !important}.p-sm-0{padding:0 !important}.pt-sm-0,.py-sm-0{padding-top:0 !important}.pr-sm-0,.px-sm-0{padding-right:0 !important}.pb-sm-0,.py-sm-0{padding-bottom:0 !important}.pl-sm-0,.px-sm-0{padding-left:0 !important}.p-sm-1{padding:0.25rem !important}.pt-sm-1,.py-sm-1{padding-top:0.25rem !important}.pr-sm-1,.px-sm-1{padding-right:0.25rem !important}.pb-sm-1,.py-sm-1{padding-bottom:0.25rem !important}.pl-sm-1,.px-sm-1{padding-left:0.25rem !important}.p-sm-2{padding:0.5rem !important}.pt-sm-2,.py-sm-2{padding-top:0.5rem !important}.pr-sm-2,.px-sm-2{padding-right:0.5rem !important}.pb-sm-2,.py-sm-2{padding-bottom:0.5rem !important}.pl-sm-2,.px-sm-2{padding-left:0.5rem !important}.p-sm-3{padding:1rem !important}.pt-sm-3,.py-sm-3{padding-top:1rem !important}.pr-sm-3,.px-sm-3{padding-right:1rem !important}.pb-sm-3,.py-sm-3{padding-bottom:1rem !important}.pl-sm-3,.px-sm-3{padding-left:1rem !important}.p-sm-4{padding:1.5rem !important}.pt-sm-4,.py-sm-4{padding-top:1.5rem !important}.pr-sm-4,.px-sm-4{padding-right:1.5rem !important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem !important}.pl-sm-4,.px-sm-4{padding-left:1.5rem !important}.p-sm-5{padding:3rem !important}.pt-sm-5,.py-sm-5{padding-top:3rem !important}.pr-sm-5,.px-sm-5{padding-right:3rem !important}.pb-sm-5,.py-sm-5{padding-bottom:3rem !important}.pl-sm-5,.px-sm-5{padding-left:3rem !important}.m-sm-n1{margin:-0.25rem !important}.mt-sm-n1,.my-sm-n1{margin-top:-0.25rem !important}.mr-sm-n1,.mx-sm-n1{margin-right:-0.25rem !important}.mb-sm-n1,.my-sm-n1{margin-bottom:-0.25rem !important}.ml-sm-n1,.mx-sm-n1{margin-left:-0.25rem !important}.m-sm-n2{margin:-0.5rem !important}.mt-sm-n2,.my-sm-n2{margin-top:-0.5rem !important}.mr-sm-n2,.mx-sm-n2{margin-right:-0.5rem !important}.mb-sm-n2,.my-sm-n2{margin-bottom:-0.5rem !important}.ml-sm-n2,.mx-sm-n2{margin-left:-0.5rem !important}.m-sm-n3{margin:-1rem !important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem !important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem !important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem !important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem !important}.m-sm-n4{margin:-1.5rem !important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem !important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem !important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem !important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem !important}.m-sm-n5{margin:-3rem !important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem !important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem !important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem !important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem !important}.m-sm-auto{margin:auto !important}.mt-sm-auto,.my-sm-auto{margin-top:auto !important}.mr-sm-auto,.mx-sm-auto{margin-right:auto !important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto !important}.ml-sm-auto,.mx-sm-auto{margin-left:auto !important}}@media (min-width: 768px){.m-md-0{margin:0 !important}.mt-md-0,.my-md-0{margin-top:0 !important}.mr-md-0,.mx-md-0{margin-right:0 !important}.mb-md-0,.my-md-0{margin-bottom:0 !important}.ml-md-0,.mx-md-0{margin-left:0 !important}.m-md-1{margin:0.25rem !important}.mt-md-1,.my-md-1{margin-top:0.25rem !important}.mr-md-1,.mx-md-1{margin-right:0.25rem !important}.mb-md-1,.my-md-1{margin-bottom:0.25rem !important}.ml-md-1,.mx-md-1{margin-left:0.25rem !important}.m-md-2{margin:0.5rem !important}.mt-md-2,.my-md-2{margin-top:0.5rem !important}.mr-md-2,.mx-md-2{margin-right:0.5rem !important}.mb-md-2,.my-md-2{margin-bottom:0.5rem !important}.ml-md-2,.mx-md-2{margin-left:0.5rem !important}.m-md-3{margin:1rem !important}.mt-md-3,.my-md-3{margin-top:1rem !important}.mr-md-3,.mx-md-3{margin-right:1rem !important}.mb-md-3,.my-md-3{margin-bottom:1rem !important}.ml-md-3,.mx-md-3{margin-left:1rem !important}.m-md-4{margin:1.5rem !important}.mt-md-4,.my-md-4{margin-top:1.5rem !important}.mr-md-4,.mx-md-4{margin-right:1.5rem !important}.mb-md-4,.my-md-4{margin-bottom:1.5rem !important}.ml-md-4,.mx-md-4{margin-left:1.5rem !important}.m-md-5{margin:3rem !important}.mt-md-5,.my-md-5{margin-top:3rem !important}.mr-md-5,.mx-md-5{margin-right:3rem !important}.mb-md-5,.my-md-5{margin-bottom:3rem !important}.ml-md-5,.mx-md-5{margin-left:3rem !important}.p-md-0{padding:0 !important}.pt-md-0,.py-md-0{padding-top:0 !important}.pr-md-0,.px-md-0{padding-right:0 !important}.pb-md-0,.py-md-0{padding-bottom:0 !important}.pl-md-0,.px-md-0{padding-left:0 !important}.p-md-1{padding:0.25rem !important}.pt-md-1,.py-md-1{padding-top:0.25rem !important}.pr-md-1,.px-md-1{padding-right:0.25rem !important}.pb-md-1,.py-md-1{padding-bottom:0.25rem !important}.pl-md-1,.px-md-1{padding-left:0.25rem !important}.p-md-2{padding:0.5rem !important}.pt-md-2,.py-md-2{padding-top:0.5rem !important}.pr-md-2,.px-md-2{padding-right:0.5rem !important}.pb-md-2,.py-md-2{padding-bottom:0.5rem !important}.pl-md-2,.px-md-2{padding-left:0.5rem !important}.p-md-3{padding:1rem !important}.pt-md-3,.py-md-3{padding-top:1rem !important}.pr-md-3,.px-md-3{padding-right:1rem !important}.pb-md-3,.py-md-3{padding-bottom:1rem !important}.pl-md-3,.px-md-3{padding-left:1rem !important}.p-md-4{padding:1.5rem !important}.pt-md-4,.py-md-4{padding-top:1.5rem !important}.pr-md-4,.px-md-4{padding-right:1.5rem !important}.pb-md-4,.py-md-4{padding-bottom:1.5rem !important}.pl-md-4,.px-md-4{padding-left:1.5rem !important}.p-md-5{padding:3rem !important}.pt-md-5,.py-md-5{padding-top:3rem !important}.pr-md-5,.px-md-5{padding-right:3rem !important}.pb-md-5,.py-md-5{padding-bottom:3rem !important}.pl-md-5,.px-md-5{padding-left:3rem !important}.m-md-n1{margin:-0.25rem !important}.mt-md-n1,.my-md-n1{margin-top:-0.25rem !important}.mr-md-n1,.mx-md-n1{margin-right:-0.25rem !important}.mb-md-n1,.my-md-n1{margin-bottom:-0.25rem !important}.ml-md-n1,.mx-md-n1{margin-left:-0.25rem !important}.m-md-n2{margin:-0.5rem !important}.mt-md-n2,.my-md-n2{margin-top:-0.5rem !important}.mr-md-n2,.mx-md-n2{margin-right:-0.5rem !important}.mb-md-n2,.my-md-n2{margin-bottom:-0.5rem !important}.ml-md-n2,.mx-md-n2{margin-left:-0.5rem !important}.m-md-n3{margin:-1rem !important}.mt-md-n3,.my-md-n3{margin-top:-1rem !important}.mr-md-n3,.mx-md-n3{margin-right:-1rem !important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem !important}.ml-md-n3,.mx-md-n3{margin-left:-1rem !important}.m-md-n4{margin:-1.5rem !important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem !important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem !important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem !important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem !important}.m-md-n5{margin:-3rem !important}.mt-md-n5,.my-md-n5{margin-top:-3rem !important}.mr-md-n5,.mx-md-n5{margin-right:-3rem !important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem !important}.ml-md-n5,.mx-md-n5{margin-left:-3rem !important}.m-md-auto{margin:auto !important}.mt-md-auto,.my-md-auto{margin-top:auto !important}.mr-md-auto,.mx-md-auto{margin-right:auto !important}.mb-md-auto,.my-md-auto{margin-bottom:auto !important}.ml-md-auto,.mx-md-auto{margin-left:auto !important}}@media (min-width: 992px){.m-lg-0{margin:0 !important}.mt-lg-0,.my-lg-0{margin-top:0 !important}.mr-lg-0,.mx-lg-0{margin-right:0 !important}.mb-lg-0,.my-lg-0{margin-bottom:0 !important}.ml-lg-0,.mx-lg-0{margin-left:0 !important}.m-lg-1{margin:0.25rem !important}.mt-lg-1,.my-lg-1{margin-top:0.25rem !important}.mr-lg-1,.mx-lg-1{margin-right:0.25rem !important}.mb-lg-1,.my-lg-1{margin-bottom:0.25rem !important}.ml-lg-1,.mx-lg-1{margin-left:0.25rem !important}.m-lg-2{margin:0.5rem !important}.mt-lg-2,.my-lg-2{margin-top:0.5rem !important}.mr-lg-2,.mx-lg-2{margin-right:0.5rem !important}.mb-lg-2,.my-lg-2{margin-bottom:0.5rem !important}.ml-lg-2,.mx-lg-2{margin-left:0.5rem !important}.m-lg-3{margin:1rem !important}.mt-lg-3,.my-lg-3{margin-top:1rem !important}.mr-lg-3,.mx-lg-3{margin-right:1rem !important}.mb-lg-3,.my-lg-3{margin-bottom:1rem !important}.ml-lg-3,.mx-lg-3{margin-left:1rem !important}.m-lg-4{margin:1.5rem !important}.mt-lg-4,.my-lg-4{margin-top:1.5rem !important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem !important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem !important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem !important}.m-lg-5{margin:3rem !important}.mt-lg-5,.my-lg-5{margin-top:3rem !important}.mr-lg-5,.mx-lg-5{margin-right:3rem !important}.mb-lg-5,.my-lg-5{margin-bottom:3rem !important}.ml-lg-5,.mx-lg-5{margin-left:3rem !important}.p-lg-0{padding:0 !important}.pt-lg-0,.py-lg-0{padding-top:0 !important}.pr-lg-0,.px-lg-0{padding-right:0 !important}.pb-lg-0,.py-lg-0{padding-bottom:0 !important}.pl-lg-0,.px-lg-0{padding-left:0 !important}.p-lg-1{padding:0.25rem !important}.pt-lg-1,.py-lg-1{padding-top:0.25rem !important}.pr-lg-1,.px-lg-1{padding-right:0.25rem !important}.pb-lg-1,.py-lg-1{padding-bottom:0.25rem !important}.pl-lg-1,.px-lg-1{padding-left:0.25rem !important}.p-lg-2{padding:0.5rem !important}.pt-lg-2,.py-lg-2{padding-top:0.5rem !important}.pr-lg-2,.px-lg-2{padding-right:0.5rem !important}.pb-lg-2,.py-lg-2{padding-bottom:0.5rem !important}.pl-lg-2,.px-lg-2{padding-left:0.5rem !important}.p-lg-3{padding:1rem !important}.pt-lg-3,.py-lg-3{padding-top:1rem !important}.pr-lg-3,.px-lg-3{padding-right:1rem !important}.pb-lg-3,.py-lg-3{padding-bottom:1rem !important}.pl-lg-3,.px-lg-3{padding-left:1rem !important}.p-lg-4{padding:1.5rem !important}.pt-lg-4,.py-lg-4{padding-top:1.5rem !important}.pr-lg-4,.px-lg-4{padding-right:1.5rem !important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem !important}.pl-lg-4,.px-lg-4{padding-left:1.5rem !important}.p-lg-5{padding:3rem !important}.pt-lg-5,.py-lg-5{padding-top:3rem !important}.pr-lg-5,.px-lg-5{padding-right:3rem !important}.pb-lg-5,.py-lg-5{padding-bottom:3rem !important}.pl-lg-5,.px-lg-5{padding-left:3rem !important}.m-lg-n1{margin:-0.25rem !important}.mt-lg-n1,.my-lg-n1{margin-top:-0.25rem !important}.mr-lg-n1,.mx-lg-n1{margin-right:-0.25rem !important}.mb-lg-n1,.my-lg-n1{margin-bottom:-0.25rem !important}.ml-lg-n1,.mx-lg-n1{margin-left:-0.25rem !important}.m-lg-n2{margin:-0.5rem !important}.mt-lg-n2,.my-lg-n2{margin-top:-0.5rem !important}.mr-lg-n2,.mx-lg-n2{margin-right:-0.5rem !important}.mb-lg-n2,.my-lg-n2{margin-bottom:-0.5rem !important}.ml-lg-n2,.mx-lg-n2{margin-left:-0.5rem !important}.m-lg-n3{margin:-1rem !important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem !important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem !important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem !important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem !important}.m-lg-n4{margin:-1.5rem !important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem !important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem !important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem !important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem !important}.m-lg-n5{margin:-3rem !important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem !important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem !important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem !important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem !important}.m-lg-auto{margin:auto !important}.mt-lg-auto,.my-lg-auto{margin-top:auto !important}.mr-lg-auto,.mx-lg-auto{margin-right:auto !important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto !important}.ml-lg-auto,.mx-lg-auto{margin-left:auto !important}}@media (min-width: 1200px){.m-xl-0{margin:0 !important}.mt-xl-0,.my-xl-0{margin-top:0 !important}.mr-xl-0,.mx-xl-0{margin-right:0 !important}.mb-xl-0,.my-xl-0{margin-bottom:0 !important}.ml-xl-0,.mx-xl-0{margin-left:0 !important}.m-xl-1{margin:0.25rem !important}.mt-xl-1,.my-xl-1{margin-top:0.25rem !important}.mr-xl-1,.mx-xl-1{margin-right:0.25rem !important}.mb-xl-1,.my-xl-1{margin-bottom:0.25rem !important}.ml-xl-1,.mx-xl-1{margin-left:0.25rem !important}.m-xl-2{margin:0.5rem !important}.mt-xl-2,.my-xl-2{margin-top:0.5rem !important}.mr-xl-2,.mx-xl-2{margin-right:0.5rem !important}.mb-xl-2,.my-xl-2{margin-bottom:0.5rem !important}.ml-xl-2,.mx-xl-2{margin-left:0.5rem !important}.m-xl-3{margin:1rem !important}.mt-xl-3,.my-xl-3{margin-top:1rem !important}.mr-xl-3,.mx-xl-3{margin-right:1rem !important}.mb-xl-3,.my-xl-3{margin-bottom:1rem !important}.ml-xl-3,.mx-xl-3{margin-left:1rem !important}.m-xl-4{margin:1.5rem !important}.mt-xl-4,.my-xl-4{margin-top:1.5rem !important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem !important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem !important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem !important}.m-xl-5{margin:3rem !important}.mt-xl-5,.my-xl-5{margin-top:3rem !important}.mr-xl-5,.mx-xl-5{margin-right:3rem !important}.mb-xl-5,.my-xl-5{margin-bottom:3rem !important}.ml-xl-5,.mx-xl-5{margin-left:3rem !important}.p-xl-0{padding:0 !important}.pt-xl-0,.py-xl-0{padding-top:0 !important}.pr-xl-0,.px-xl-0{padding-right:0 !important}.pb-xl-0,.py-xl-0{padding-bottom:0 !important}.pl-xl-0,.px-xl-0{padding-left:0 !important}.p-xl-1{padding:0.25rem !important}.pt-xl-1,.py-xl-1{padding-top:0.25rem !important}.pr-xl-1,.px-xl-1{padding-right:0.25rem !important}.pb-xl-1,.py-xl-1{padding-bottom:0.25rem !important}.pl-xl-1,.px-xl-1{padding-left:0.25rem !important}.p-xl-2{padding:0.5rem !important}.pt-xl-2,.py-xl-2{padding-top:0.5rem !important}.pr-xl-2,.px-xl-2{padding-right:0.5rem !important}.pb-xl-2,.py-xl-2{padding-bottom:0.5rem !important}.pl-xl-2,.px-xl-2{padding-left:0.5rem !important}.p-xl-3{padding:1rem !important}.pt-xl-3,.py-xl-3{padding-top:1rem !important}.pr-xl-3,.px-xl-3{padding-right:1rem !important}.pb-xl-3,.py-xl-3{padding-bottom:1rem !important}.pl-xl-3,.px-xl-3{padding-left:1rem !important}.p-xl-4{padding:1.5rem !important}.pt-xl-4,.py-xl-4{padding-top:1.5rem !important}.pr-xl-4,.px-xl-4{padding-right:1.5rem !important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem !important}.pl-xl-4,.px-xl-4{padding-left:1.5rem !important}.p-xl-5{padding:3rem !important}.pt-xl-5,.py-xl-5{padding-top:3rem !important}.pr-xl-5,.px-xl-5{padding-right:3rem !important}.pb-xl-5,.py-xl-5{padding-bottom:3rem !important}.pl-xl-5,.px-xl-5{padding-left:3rem !important}.m-xl-n1{margin:-0.25rem !important}.mt-xl-n1,.my-xl-n1{margin-top:-0.25rem !important}.mr-xl-n1,.mx-xl-n1{margin-right:-0.25rem !important}.mb-xl-n1,.my-xl-n1{margin-bottom:-0.25rem !important}.ml-xl-n1,.mx-xl-n1{margin-left:-0.25rem !important}.m-xl-n2{margin:-0.5rem !important}.mt-xl-n2,.my-xl-n2{margin-top:-0.5rem !important}.mr-xl-n2,.mx-xl-n2{margin-right:-0.5rem !important}.mb-xl-n2,.my-xl-n2{margin-bottom:-0.5rem !important}.ml-xl-n2,.mx-xl-n2{margin-left:-0.5rem !important}.m-xl-n3{margin:-1rem !important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem !important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem !important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem !important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem !important}.m-xl-n4{margin:-1.5rem !important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem !important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem !important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem !important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem !important}.m-xl-n5{margin:-3rem !important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem !important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem !important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem !important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem !important}.m-xl-auto{margin:auto !important}.mt-xl-auto,.my-xl-auto{margin-top:auto !important}.mr-xl-auto,.mx-xl-auto{margin-right:auto !important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto !important}.ml-xl-auto,.mx-xl-auto{margin-left:auto !important}}.text-monospace{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important}.text-justify{text-align:justify !important}.text-wrap{white-space:normal !important}.text-nowrap{white-space:nowrap !important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left !important}.text-right{text-align:right !important}.text-center{text-align:center !important}@media (min-width: 576px){.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}.text-sm-center{text-align:center !important}}@media (min-width: 768px){.text-md-left{text-align:left !important}.text-md-right{text-align:right !important}.text-md-center{text-align:center !important}}@media (min-width: 992px){.text-lg-left{text-align:left !important}.text-lg-right{text-align:right !important}.text-lg-center{text-align:center !important}}@media (min-width: 1200px){.text-xl-left{text-align:left !important}.text-xl-right{text-align:right !important}.text-xl-center{text-align:center !important}}.text-lowercase{text-transform:lowercase !important}.text-uppercase{text-transform:uppercase !important}.text-capitalize{text-transform:capitalize !important}.font-weight-light{font-weight:300 !important}.font-weight-lighter{font-weight:lighter !important}.font-weight-normal{font-weight:400 !important}.font-weight-bold{font-weight:700 !important}.font-weight-bolder{font-weight:bolder !important}.font-italic{font-style:italic !important}.text-white{color:#fff !important}.text-primary{color:#375a7f !important}a.text-primary:hover,a.text-primary:focus{color:#20344a !important}.text-secondary{color:#444 !important}a.text-secondary:hover,a.text-secondary:focus{color:#1e1e1e !important}.text-success{color:#00bc8c !important}a.text-success:hover,a.text-success:focus{color:#007053 !important}.text-info{color:#3498DB !important}a.text-info:hover,a.text-info:focus{color:#1d6fa5 !important}.text-warning{color:#F39C12 !important}a.text-warning:hover,a.text-warning:focus{color:#b06f09 !important}.text-danger{color:#E74C3C !important}a.text-danger:hover,a.text-danger:focus{color:#bf2718 !important}.text-light{color:#303030 !important}a.text-light:hover,a.text-light:focus{color:#0a0a0a !important}.text-dark{color:#adb5bd !important}a.text-dark:hover,a.text-dark:focus{color:#838f9b !important}.text-body{color:#fff !important}.text-muted{color:#999 !important}.text-black-50{color:rgba(0,0,0,0.5) !important}.text-white-50{color:rgba(255,255,255,0.5) !important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none !important}.text-break{word-break:break-word !important;overflow-wrap:break-word !important}.text-reset{color:inherit !important}.visible{visibility:visible !important}.invisible{visibility:hidden !important}@media print{*,*::before,*::after{text-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap !important}pre,blockquote{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px !important}.container{min-width:992px !important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #dee2e6 !important}.table-dark{color:inherit}.table-dark th,.table-dark td,.table-dark thead th,.table-dark tbody+tbody{border-color:#444}.table .thead-dark th{color:inherit;border-color:#444}}.bg-primary .navbar-nav .active>.nav-link{color:#00bc8c !important}.bg-dark{background-color:#00bc8c !important}.bg-dark.navbar-dark .navbar-nav .nav-link:focus,.bg-dark.navbar-dark .navbar-nav .nav-link:hover,.bg-dark.navbar-dark .navbar-nav .active>.nav-link{color:#375a7f !important}.blockquote-footer{color:#999}.table-primary,.table-primary>th,.table-primary>td{background-color:#375a7f}.table-secondary,.table-secondary>th,.table-secondary>td{background-color:#444}.table-light,.table-light>th,.table-light>td{background-color:#303030}.table-dark,.table-dark>th,.table-dark>td{background-color:#adb5bd}.table-success,.table-success>th,.table-success>td{background-color:#00bc8c}.table-info,.table-info>th,.table-info>td{background-color:#3498DB}.table-danger,.table-danger>th,.table-danger>td{background-color:#E74C3C}.table-warning,.table-warning>th,.table-warning>td{background-color:#F39C12}.table-active,.table-active>th,.table-active>td{background-color:rgba(0,0,0,0.075)}.table-hover .table-primary:hover,.table-hover .table-primary:hover>th,.table-hover .table-primary:hover>td{background-color:#2f4d6d}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>th,.table-hover .table-secondary:hover>td{background-color:#373737}.table-hover .table-light:hover,.table-hover .table-light:hover>th,.table-hover .table-light:hover>td{background-color:#232323}.table-hover .table-dark:hover,.table-hover .table-dark:hover>th,.table-hover .table-dark:hover>td{background-color:#9fa8b2}.table-hover .table-success:hover,.table-hover .table-success:hover>th,.table-hover .table-success:hover>td{background-color:#00a379}.table-hover .table-info:hover,.table-hover .table-info:hover>th,.table-hover .table-info:hover>td{background-color:#258cd1}.table-hover .table-danger:hover,.table-hover .table-danger:hover>th,.table-hover .table-danger:hover>td{background-color:#e43725}.table-hover .table-warning:hover,.table-hover .table-warning:hover>th,.table-hover .table-warning:hover>td{background-color:#e08e0b}.table-hover .table-active:hover,.table-hover .table-active:hover>th,.table-hover .table-active:hover>td{background-color:rgba(0,0,0,0.075)}.input-group-addon{color:#fff}.nav-tabs .nav-link,.nav-tabs .nav-link.active,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-link.active:hover,.nav-tabs .nav-item.open .nav-link,.nav-tabs .nav-item.open .nav-link:focus,.nav-tabs .nav-item.open .nav-link:hover,.nav-pills .nav-link,.nav-pills .nav-link.active,.nav-pills .nav-link.active:focus,.nav-pills .nav-link.active:hover,.nav-pills .nav-item.open .nav-link,.nav-pills .nav-item.open .nav-link:focus,.nav-pills .nav-item.open .nav-link:hover{color:#fff}.breadcrumb a{color:#fff}.pagination a:hover{text-decoration:none}.close{opacity:0.4}.close:hover,.close:focus{opacity:1}.alert{border:none;color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-primary{background-color:#375a7f}.alert-secondary{background-color:#444}.alert-success{background-color:#00bc8c}.alert-info{background-color:#3498DB}.alert-warning{background-color:#F39C12}.alert-danger{background-color:#E74C3C}.alert-light{background-color:#303030}.alert-dark{background-color:#adb5bd}.list-group-item-action{color:#fff}.list-group-item-action:hover,.list-group-item-action:focus{background-color:#444;color:#fff}.list-group-item-action .list-group-item-heading{color:#fff} diff --git a/admin-interface/docroot/public/bootstrap/bootstrap.min.js b/admin-interface/docroot/public/bootstrap/bootstrap.min.js new file mode 100644 index 0000000..c4c0d1f --- /dev/null +++ b/admin-interface/docroot/public/bootstrap/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.3.1 (https://getbootstrap.com/) + * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" diff --git a/admin-interface/docroot/views/confirm.erb b/admin-interface/docroot/views/confirm.erb new file mode 100644 index 0000000..deb931e --- /dev/null +++ b/admin-interface/docroot/views/confirm.erb @@ -0,0 +1,17 @@ + + + diff --git a/admin-interface/docroot/views/daemons.erb b/admin-interface/docroot/views/daemons.erb new file mode 100644 index 0000000..0f35c28 --- /dev/null +++ b/admin-interface/docroot/views/daemons.erb @@ -0,0 +1,11 @@ +<% @daemons.reject{|_,d| d.nil? }.select{|id, daemon| daemon.server_running? }.sort_by {|_, daemon| daemon.config['server-config-name'] }.each do |id, daemon| %> + +<% end %> diff --git a/admin-interface/docroot/views/homepage.erb b/admin-interface/docroot/views/homepage.erb new file mode 100644 index 0000000..26ab26f --- /dev/null +++ b/admin-interface/docroot/views/homepage.erb @@ -0,0 +1,5 @@ +
+
+

OHD Admin Wrapper

+
+
diff --git a/admin-interface/docroot/views/layout-main.erb b/admin-interface/docroot/views/layout-main.erb new file mode 100644 index 0000000..6017afc --- /dev/null +++ b/admin-interface/docroot/views/layout-main.erb @@ -0,0 +1,170 @@ + + + OHD Admin Wrapper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + +
+ + +
+
+
+
+ + +
+
+
+
OHD Admin Wrapper
+
+
+ <%= yield %> +
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin-interface/docroot/views/login.erb b/admin-interface/docroot/views/login.erb new file mode 100644 index 0000000..3c941fc --- /dev/null +++ b/admin-interface/docroot/views/login.erb @@ -0,0 +1,70 @@ + + + Login + + + + + + + +
+
+
+
+
+
+

Login

+
+
+ + +
+
User
+
+ +
+
+ + +
+
Password
+
+ +
+
+ +
+
+ +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/admin-interface/docroot/views/maplist.erb b/admin-interface/docroot/views/maplist.erb new file mode 100644 index 0000000..74b7f89 --- /dev/null +++ b/admin-interface/docroot/views/maplist.erb @@ -0,0 +1,5 @@ +<% MAPMAP.values.sort.each do |map| %> +<%= map %> +<% end %> + +Random \ No newline at end of file diff --git a/admin-interface/docroot/views/monitor-configs.erb b/admin-interface/docroot/views/monitor-configs.erb new file mode 100644 index 0000000..97c219f --- /dev/null +++ b/admin-interface/docroot/views/monitor-configs.erb @@ -0,0 +1,10 @@ +<% @configs.sort_by { |name, _| name }.each do |name, config| %> + +<% end %> \ No newline at end of file diff --git a/admin-interface/docroot/views/monitor-tool.erb b/admin-interface/docroot/views/monitor-tool.erb new file mode 100644 index 0000000..22abe03 --- /dev/null +++ b/admin-interface/docroot/views/monitor-tool.erb @@ -0,0 +1,113 @@ +
+
+

Remote Monitor

+
+
+ + +
+
+ +
+
+ +
+
Name
+
+
+
+
+ +
+ +
+
+ +
+
IP
+
+ +
+
+ + +
+
Query Port
+
+ +
+
+ + +
+ +
+ +
+
RCON Port
+
+ +
+
+ + +
+
RCON Password
+
+ +
+
+ +
+
+
+
+ + + +
+
Server RCON
+
+ +
+
+
+ + +
+
+
+ + +
+
+
RCON Log
+
+ + +
+
+

+    
+ +
+
diff --git a/admin-interface/docroot/views/monitoring-details.erb b/admin-interface/docroot/views/monitoring-details.erb new file mode 100644 index 0000000..78ac5e8 --- /dev/null +++ b/admin-interface/docroot/views/monitoring-details.erb @@ -0,0 +1,26 @@ +<% server_down = @info[:server_down].nil? ? true : @info[:server_down] rescue true %> +<% rcon_down = @info[:rcon_connection_problem].nil? ? true : @info[:rcon_connection_problem] rescue true %> +<% query_down = @info[:a2s_connection_problem].nil? ? true : @info[:a2s_connection_problem] rescue true %> +
+ +
+
+
+
Connection Status
+
<%= server_down ? 'Down' : 'Up' %>
+
+
+
RCON Status
+
<%= rcon_down ? 'Down' : 'Up' %>
+
+
+
Query Status
+
<%= query_down ? 'Down' : 'Up' %>
+
+
+
+ +
+ <%= erb :players %> +
+
\ No newline at end of file diff --git a/admin-interface/docroot/views/monitors.erb b/admin-interface/docroot/views/monitors.erb new file mode 100644 index 0000000..6eaebb4 --- /dev/null +++ b/admin-interface/docroot/views/monitors.erb @@ -0,0 +1,11 @@ +<% @monitors.sort_by {|_, monitor| monitor.name }.each do |id, monitor| %> + +<% end %> diff --git a/admin-interface/docroot/views/players.erb b/admin-interface/docroot/views/players.erb new file mode 100644 index 0000000..81948eb --- /dev/null +++ b/admin-interface/docroot/views/players.erb @@ -0,0 +1,41 @@ +<% players = @info.nil? ? [] : @info[:rcon_players] || [] %> +<% players.each do |player| %> +<% player['display_name'] = player.dig('steam_info', 'name') || player['name'] %> +<% matches = (@info[:a2s_player] || []).select{ |p| p['name'] == player['name'] } %> +<% next if matches.empty? %> +<% player['duration'] = matches.first['duration'] if matches.size == 1 %> +<% end %> +
+
+
Player
+
Score
+
Duration
+
<% if is_admin? %>Admin<% end %>
+
+ <% players.sort_by { |p| [p['score'].to_i, (p['duration'] || ''), p['name']] }.reverse.each_with_index do |player, i| %> +
+
+ <%# <% ip_info = player.dig('ip_info', player['ip']).to_h %> + <%# <% country_code = ip_info['countryCode'] %> + <%# <% region_name = ip_info['regionName'] %> + <%# <% city = ip_info['city'] %> + <%# <%= (' ') if country_code %> + <<% if player['unique_id'].nil? %>span<% else %>a target="<%= !@use_steam_urls ? '_blank' : '' %>" href="<%= !@use_steam_urls ? 'https://steamcommunity.com/profiles/' : 'steam://url/SteamIDPage/' %><%= player['unique_id'] %>" <% end %>> + + <%= CGI.escapeHTML player['display_name'] %> + span<% else %>a<% end %>> +
+
<%= player['score'] %>
+
<%= player['duration'] %>
+
+ <% if is_moderator? %> + + + + <%# <%= "#{country_code} ➤ #{region_name} ➤ #{city}" %> + + <% end %> +
+
+ <% end %> +
diff --git a/admin-interface/docroot/views/rcon-tool.erb b/admin-interface/docroot/views/rcon-tool.erb new file mode 100644 index 0000000..0534828 --- /dev/null +++ b/admin-interface/docroot/views/rcon-tool.erb @@ -0,0 +1,62 @@ +
+
+

RCON Tool

+
+
+ +
+
Target Host
+
+ +
+
+ + +
+
Port
+
+ +
+
+ + +
+
Password
+
+ +
+
+ +
+
+ + +
+
Command
+
+ +
+
+
+ + +
+
+
+ + +
+
RCON Log
+
+
+      
+
+
+
diff --git a/admin-interface/docroot/views/server-config.erb b/admin-interface/docroot/views/server-config.erb new file mode 100644 index 0000000..e5c33af --- /dev/null +++ b/admin-interface/docroot/views/server-config.erb @@ -0,0 +1,456 @@ +
+
+

Server Config

+
+
+ + +
+
Config ID
+
+ +
+ <% if @config['id'] %> +
+ +
+
+ +
+ <% end %> +
+
+
Config Name
+
+ + +
+
+
+ + +
+
+ +
+
+
+ + +
+
Server Name
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Server Password
+
+ +
+
+ + + + +
+
+
+ + +
+
+
+ + +
+
Game Port
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Query Port
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
RCON Port
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
RCON Password
+
+ +
+
+ + + + +
+
+
+ + +
+
+
+ + +
+
Player join message
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Player leave message
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Admin join message
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Admin leave message
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Hang Recovery
+
+
+
+ > + +
+
+
+
+ + +
+
+
+ + +
+
Query Recovery
+
+
+
+ > + +
+
+
+
+ + +
+
+
+ + +
+
Max Players
+
Visible:
+
+ +
+
+
+ + +
+
+
Actual:
+
+ +
+
+
+ + +
+
+
+
+
+ + +
+
Default Map
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
Config Files
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+ + +
+
Custom Travel Arguments
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Custom Server Arguments
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
RCON
+
+
+ > + +
+
+
+
+ + +
+
+
+
+ + +
+
Game Mode
+
+ + +
+
+
+ + +
+
+
+ +
+
diff --git a/admin-interface/docroot/views/server-configs.erb b/admin-interface/docroot/views/server-configs.erb new file mode 100644 index 0000000..46e67e5 --- /dev/null +++ b/admin-interface/docroot/views/server-configs.erb @@ -0,0 +1,7 @@ +<% @configs.sort_by {|_, config| config['server-config-name'] }.each do |key, config| %> + +<% end %> diff --git a/admin-interface/docroot/views/server-control-status.erb b/admin-interface/docroot/views/server-control-status.erb new file mode 100644 index 0000000..e5468e8 --- /dev/null +++ b/admin-interface/docroot/views/server-control-status.erb @@ -0,0 +1,13 @@ +
+ <%= @config['server-config-name'] %> (<%= @config['server_name'] %>) +
<%= @server_status %>
+
+
+ +
Game Port: <%= @game_port %>
+
Query Port: <%= @query_port %>
+
RCON Port: <%= @rcon_port %>
+
+
<%= erb :threads %>
+
+
diff --git a/admin-interface/docroot/views/server-control.erb b/admin-interface/docroot/views/server-control.erb new file mode 100644 index 0000000..6312235 --- /dev/null +++ b/admin-interface/docroot/views/server-control.erb @@ -0,0 +1,127 @@ +
+
+

Server Control

+
+
+ + +
+ + +
+ + +
+
+ + + +
+
+ + +
+ <%= erb :'server-control-status' %> +
+ + +
+
+
Server RCON
+ + + +
+
+ + +
+ <%= erb :'monitoring-details' %> +
+ +
+
Toggle Server Panes
+ + + +
+ +
    + +
    +
    +
    + +
    Chat
    +
    + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    
    +        
    +
    + + +
    +
    +
    + +
    RCON Log
    +
    + + +
    +
    +
    
    +        
    +
    + + +
    +
    +
    + +
    Server Log
    +
    + Download Logs: + + + + | + + +
    +
    +
    
    +        
    +
    +
+ +
+
diff --git a/admin-interface/docroot/views/server-daemons.erb b/admin-interface/docroot/views/server-daemons.erb new file mode 100644 index 0000000..bbc797b --- /dev/null +++ b/admin-interface/docroot/views/server-daemons.erb @@ -0,0 +1,30 @@ +
+
+

Server Daemons

+
+
+ <% @daemons.reject{|_,d| d.nil? }.sort_by {|_, daemon| daemon.config['server-config-name'] }.each do |id, daemon| %> + <% server_running = daemon.server_running? %> + <% monitor = daemon.monitor rescue nil %> + <% @info = monitor.info rescue nil%> + <% @pid = daemon.game_pid %> + <% process = Sys::ProcTable.ps(pid: @pid) if @pid %> + <% threads = (WINDOWS ? process.thread_count : process.nlwp) if process %> + <% @threads = threads || 0 %> +
+
<%= "#{daemon.config['server-config-name']} | #{ @info.nil? || @info.dig(:a2s_info, 'name').to_s.empty? ? daemon.config['server_name'] : @info.dig(:a2s_info, 'name')}" %>
+
+
Game Port: <%= daemon.active_game_port %>
+
Query Port: <%= daemon.active_query_port %>
+
RCON Port: <%= daemon.active_rcon_port %>
+
+
+ <%= erb :threads %> +
+
<%= server_running ? 'ON' : 'OFF' %>
+ +
+ <% end %> +
+
+ diff --git a/admin-interface/docroot/views/server-list.erb b/admin-interface/docroot/views/server-list.erb new file mode 100644 index 0000000..b067626 --- /dev/null +++ b/admin-interface/docroot/views/server-list.erb @@ -0,0 +1,66 @@ +<% at_least_one_server = false %> +<% at_least_one_server = true unless @daemons.values.compact.empty? && @monitors.compact.empty? %> +<% @daemons.reject{|_,d| d.nil? }.sort_by{ |_, d| d.config['server_name'] }.each do |id, daemon| %> + <% @id = id %> + <% server_running = daemon.server_running? %> + <% @monitor = daemon.monitor rescue nil %> + <% @info = @monitor.info rescue nil %> + + +
+
<%= daemon.frozen_config['server_name'] %>
+
+
Game Port: <%= daemon.active_game_port %>
+
Query Port: <%= daemon.active_query_port %>
+
RCON Port: <%= daemon.active_rcon_port %>
+
+
+ <% @pid = daemon.game_pid %> + <% process = Sys::ProcTable.ps(pid: @pid) if @pid %> + <% threads = (WINDOWS ? process.thread_count : process.nlwp) if process %> + <% @threads = threads || 0 %> + <%= erb :threads %> +
+
+
<%= server_running ? 'ON' : 'OFF' %>
+ <% if is_admin? %> +
+ + + +
+ <% end %> +
+
+
+ <%= erb :'monitoring-details' %> +
+<% end %> + +<% @monitors.each do |id, monitor| %> + <% @id = id %> + <% @monitor = monitor %> + <% @info = @monitor.info rescue nil %> + +
+
<%= @info[:a2s_info]['name'] rescue "Unknown Name (#{@monitor.name})" %>
+
+
Query Port: <%= @monitor.query_port %>
+
RCON Port: <%= @monitor.rcon_port %>
+
+
+ <% @pid = nil %> + <%= erb :threads %> +
+
<%= !@info[:server_down] ? 'ON' : 'OFF' %>
+
+
+ <%= erb :'monitoring-details' %> +
+<% end %> + +<% unless at_least_one_server %> +
+
No servers running
+
+<% end %> diff --git a/admin-interface/docroot/views/server-setup.erb b/admin-interface/docroot/views/server-setup.erb new file mode 100644 index 0000000..6039d8f --- /dev/null +++ b/admin-interface/docroot/views/server-setup.erb @@ -0,0 +1,92 @@ +
+
+

Server Setup

+
+
+ +
+
SteamCMD Install
+
<%= @steamcmd_path ? 'COMPLETE' : 'INCOMPLETE' %>
+
+ <% unless @steamcmd_path %> + + <% end %> +
+
+ <% if @steamcmd_path %> +
SteamCMD installation detected:
+
<%= @steamcmd_path.sub(USER_HOME, '~') %>
+ <% else %> +
SteamCMD must be installed manually. Depending on your operating system, installation steps can vary. Install to:
+
ohd-admin-wrapper/steamcmd/installation/
+ + <% end %> +
+
+ + +
+
Server Install
+
<%= @game_server_path ? 'COMPLETE' : 'INCOMPLETE' %>
+
+ <% if @steamcmd_path && !@game_server_path %> + +
+ + +
+ <% end %> +
+
+
+ <% if @game_server_path %> +
OHD server installation detected:
+
<%= @game_server_path.sub(USER_HOME, '~') %>
+ <% else %> +
+ Server installation is dependent on valid SteamCMD installation. Follow the steps above, then refresh this page. +
+ <% end %> +
+
+
+ + <% if @steamcmd_path && @game_server_path %> + +
+
+ + +
+
Automatic Updates
+
+
+ > + +
+
+
+
+ + +
+
+
+ <% end %> + + +
+
+
SteamCMD Log
+
+
+ + +
+
+
+

+    
+ +
+
\ No newline at end of file diff --git a/admin-interface/docroot/views/server-status.erb b/admin-interface/docroot/views/server-status.erb new file mode 100644 index 0000000..1c1a3ab --- /dev/null +++ b/admin-interface/docroot/views/server-status.erb @@ -0,0 +1,13 @@ +
+
+

Server Status

+
+
+ <%= yield %> +
+
+ + + diff --git a/admin-interface/docroot/views/steamcmd-tool.erb b/admin-interface/docroot/views/steamcmd-tool.erb new file mode 100644 index 0000000..24b7b4b --- /dev/null +++ b/admin-interface/docroot/views/steamcmd-tool.erb @@ -0,0 +1,35 @@ +
+
+

SteamCMD Tool

+
+
+ +
+
Command
+
+ +
+
+
+ + +
+
+
+ + +
+
SteamCMD Log
+
+
+      
+
+
+
diff --git a/admin-interface/docroot/views/threads.erb b/admin-interface/docroot/views/threads.erb new file mode 100644 index 0000000..355d13b --- /dev/null +++ b/admin-interface/docroot/views/threads.erb @@ -0,0 +1,49 @@ +
+
+ <% if is_admin? && @pid %> +
+
PID:
+
<%= @pid %>
+
+
+
Threads:
+
<%= @threads %>
+
+ <% end %> +
+
Players:
+
<%= @info[:rcon_players].size rescue 0 %> / <%= @info.dig(:a2s_rules, 'PlrM_i') rescue '?' %>
+
+
+
Bots:
+
<%= @info[:rcon_bots].size rescue 0 %>
+
+
+
Password:
+
<%= @info.dig(:a2s_rules, 'Pwd_b') == 'true' ? 'Yes' : 'No' rescue 'Unknown' %>
+
+
+ +
+
+
Ranked:
+
<%= @info.dig(:a2s_rules, 'RankedServer_b') == 'false' ? 'No' : 'Yes' rescue 'Unknown' %>
+
+
+
Mods:
+
<%= @info.dig(:a2s_rules, 'Mods_b') == 'true' ? (@info.dig(:a2s_rules, 'ModList_s').to_s.strip.empty? ? 'Yes (no IDs reported)' : @info.dig(:a2s_rules, 'ModList_s')) : 'No' rescue 'Unknown' %>
+
+
+
Mutators:
+
<%= @info.dig(:a2s_rules, 'Mutated_b') == 'true' ? 'Yes' : 'No' rescue 'Unknown' %>
+
+
+
Map:
+
<%= "#{@info.dig(:a2s_info, 'map')}#{' (' << MAPMAP[@info.dig(:a2s_info, 'map')] <<')' if MAPMAP[@info.dig(:a2s_info, 'map')] && MAPMAP[@info.dig(:a2s_info, 'map')] != @info.dig(:a2s_info, 'map')}" rescue 'Unknown' %>
+
+
+
Mode:
+
<%= @info.dig(:a2s_rules, 'GameMode_s') rescue 'Unknown' %> (<%= @info.dig(:a2s_rules, 'Versus_b') == 'true' ? 'PvP' : 'Co-op' rescue 'Unknown'%>)
+
+
+
diff --git a/admin-interface/docroot/views/update-info.erb b/admin-interface/docroot/views/update-info.erb new file mode 100644 index 0000000..5827c0a --- /dev/null +++ b/admin-interface/docroot/views/update-info.erb @@ -0,0 +1,21 @@ +
Server Update
+
<%= @update_available ? 'OUT OF DATE' : 'UP TO DATE' %>
+
+
+
+ + +
+
+
+
+ <% if @update_available %> +
Update is available!
+
Current: <%= @old_build %>
+
New: <%= @new_build %>
+ <% else %> +
Server is up to date!
+
Current: <%= @old_build %>
+ <% end %> +
+
\ No newline at end of file diff --git a/admin-interface/docroot/views/wrapper-config.erb b/admin-interface/docroot/views/wrapper-config.erb new file mode 100644 index 0000000..72e9f1a --- /dev/null +++ b/admin-interface/docroot/views/wrapper-config.erb @@ -0,0 +1,160 @@ +
+
+

Wrapper Config

+
+
+ +
+
Bind IP
+
+ +
+
+
+ + +
+
+
+ + +
+
Bind Port
+
+ +
+
+
+ + +
+
+
+ + +
+
Use SSL (HTTPS)
+
+
+ > + +
+
+
+
+ + +
+
+
+ + +
+
Verify SSL (strict)
+
+
+ > + +
+
+
+
+ + +
+
+
+ + +
+
SSL Cert Path
+
+ +
+
+
+ + +
+
+
+ + +
+
SSL Key Path
+
+ +
+
+
+ + +
+
+
+ + +
+
Session Secret
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
Steam API Key?
+
+ +
+
+ +
+
+
+ + +
+
+
+ + +
+
+ + +
+
Downloads OHDAW-specific logs
+
+ + +
+
+ + +
+
Updates to the latest release on GitHub
+
Installed version: <%= @wrapper_version || 'Unknown' %>
+
+ + +
+
+ + +
+
This also stops all OHD servers
+
+ +
+
diff --git a/admin-interface/docroot/views/wrapper-log.erb b/admin-interface/docroot/views/wrapper-log.erb new file mode 100644 index 0000000..6d4509a --- /dev/null +++ b/admin-interface/docroot/views/wrapper-log.erb @@ -0,0 +1,37 @@ +
+
+

Wrapper Log

+
+
+ + +
+
+
User Log
+
+ + +
+
+

+    
+ + +
+
+
Connection Log
+
+ + +
+
+

+    
+ +
+
+ + \ No newline at end of file diff --git a/admin-interface/docroot/views/wrapper-users-list.erb b/admin-interface/docroot/views/wrapper-users-list.erb new file mode 100644 index 0000000..8ec4f86 --- /dev/null +++ b/admin-interface/docroot/views/wrapper-users-list.erb @@ -0,0 +1,29 @@ +<% @users.each do |id, user| %> + +
+
User
+
+
Role
+
+ +
+
+ <% if user.initial_password %> + + + <% end %> + + +
+
+
+<% end %> \ No newline at end of file diff --git a/admin-interface/docroot/views/wrapper-users.erb b/admin-interface/docroot/views/wrapper-users.erb new file mode 100644 index 0000000..ceae2ed --- /dev/null +++ b/admin-interface/docroot/views/wrapper-users.erb @@ -0,0 +1,35 @@ +
+
+

Wrapper Users

+
+
+ +
+
New User
+
+ +
+
Role
+
+ + +
+ +
+
+ + +
+ <%= yield %> +
+
+
diff --git a/admin-interface/ext/string.rb b/admin-interface/ext/string.rb new file mode 100644 index 0000000..8401af9 --- /dev/null +++ b/admin-interface/ext/string.rb @@ -0,0 +1,50 @@ +# encoding: UTF-8 + +require 'unicode/display_width' + +# Certain UTF-8 characters display as wider than they report with the standard Ruby length method +# This can cause issues when justifying text containing these characters. Use the methods below instead. +class String + def length_utf8 + Unicode::DisplayWidth.of(self) + end + + def ljust_utf8(length, padstr=' ') + if Unicode::DisplayWidth.of(self) < length + self + (padstr * (length - Unicode::DisplayWidth.of(self))) + else + self + end + end + + def rjust_utf8(length, padstr=' ') + if Unicode::DisplayWidth.of(self) < length + (padstr * (length - Unicode::DisplayWidth.of(self))) + self + else + self + end + end + + def center_utf8(length, padstr=' ') + if Unicode::DisplayWidth.of(self) < length + prefix = padstr * ((length - Unicode::DisplayWidth.of(self))/2.to_f).floor # Floor here to keep text left of center if uneven + postfix = padstr * ((length - Unicode::DisplayWidth.of(self))/2.to_f).ceil + prefix + self + postfix + else + self + end + end + + def utf8 + s = encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8') #force_encoding('UTF-8') + s.strip # Don't strip; test that it can be stripped (else we fall back to encode()) + s + rescue => e + log("Failed to encode string as UTF-8: #{self.inspect}", level: :warn) + encode('UTF-8', invalid: :replace, undef: :replace) + end + + def is_uuid? + self =~ /^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/ + end +end diff --git a/admin-interface/ext/thread.rb b/admin-interface/ext/thread.rb new file mode 100644 index 0000000..63851f1 --- /dev/null +++ b/admin-interface/ext/thread.rb @@ -0,0 +1,27 @@ + +# Threads which terminate unexpectedly are not logged +# so we monkey-patch a rescue in for StandardErrors in order +# to log and raise the exception. + +Thread.report_on_exception = false + +module ThreadExtensions + def initialize(*args) + begin + super(*args) do |args| + begin + yield(args) + rescue => e + level = :error + level = :debug if e.is_a?(IOError) && e.message == 'stream closed in another thread' + log "(#{self.inspect}#{' ' << self[:name] if self[:name]}) StandardError in thread", e, level: level + raise e + end + end + end + end +end + +class Thread + prepend ThreadExtensions +end diff --git a/admin-interface/lib/buffer.rb b/admin-interface/lib/buffer.rb new file mode 100644 index 0000000..3738995 --- /dev/null +++ b/admin-interface/lib/buffer.rb @@ -0,0 +1,57 @@ +require_relative 'logger' + +class Buffer < Hash + def initialize(uuid, opts={}) + self.merge!({ + uuid: uuid, + data: [], + bookmarks: {}, + status: nil, + message: nil, + mutex: Mutex.new, + limit: 500, + filters: [], + persistent: false + }) + self.merge!(opts) + end + + def synchronize + self[:mutex].synchronize { yield } + end + + def <<(string) + self[:data] << string + truncate + self[:data] + end + + def push(string) + self << string + end + + def truncate(limit: self[:limit]) + current_size = size + return 0 unless current_size > limit + over_limit = current_size - limit + self[:data].shift over_limit # Remove the first (oldest) n elements + self[:bookmarks].each do |uuid, value| + next if value == -1 + self[:bookmarks][uuid] = (value - over_limit).floor 0 + end + over_limit + end + + def reset + unless self[:persistent] + self[:data].clear + self[:bookmarks].clear + end + self[:status] = nil + self[:message] = nil + end + + def size + self[:data].size + end +end diff --git a/admin-interface/lib/certificate-generator.rb b/admin-interface/lib/certificate-generator.rb new file mode 100644 index 0000000..9d5b9e7 --- /dev/null +++ b/admin-interface/lib/certificate-generator.rb @@ -0,0 +1,26 @@ +require_relative 'logger' + +class CertificateGenerator + def self.generate + key = OpenSSL::PKey::RSA.new(2048) + public_key = key.public_key + subject = "/CN=localhost" + cert = OpenSSL::X509::Certificate.new + cert.subject = cert.issuer = OpenSSL::X509::Name.parse(subject) + cert.not_before = Time.now + cert.not_after = Time.now + 365 * 24 * 60 * 60 + cert.public_key = public_key + cert.serial = 0x0 + cert.version = 2 + ef = OpenSSL::X509::ExtensionFactory.new + ef.subject_certificate = cert + ef.issuer_certificate = cert + cert.extensions = [ + ef.create_extension("basicConstraints", "CA:TRUE", true), + ef.create_extension("subjectKeyIdentifier", "hash") + ] + cert.add_extension ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always") + cert.sign key, OpenSSL::Digest::SHA256.new + return cert, key + end +end \ No newline at end of file diff --git a/admin-interface/lib/config-handler.rb b/admin-interface/lib/config-handler.rb new file mode 100644 index 0000000..bd82a01 --- /dev/null +++ b/admin-interface/lib/config-handler.rb @@ -0,0 +1,696 @@ +require 'bcrypt' +require 'erb' +require 'fileutils' +require 'inifile' +require 'net/http' +require 'oj' +require 'socket' +require 'sysrandom' +require_relative 'logger' + +# Used in server-monitor to avoid showing internal IPs for local players +# but OHD does not (yet?) provide player IP addresses like Insurgency: Sandstorm does +# LOCAL_IP_PREFIXES = ['10.', '0.', '127.','192.168.'] # https://en.wikipedia.org/wiki/Reserved_IP_addresses +# Thread.new { EXTERNAL_IP = Net::HTTP.get URI "https://api.ipify.org" rescue nil } + +CONFIG_PATH = File.expand_path File.join File.dirname(__FILE__), '..', 'config' +CONFIG_FILE = File.join CONFIG_PATH, 'config.json' +USERS_CONFIG_FILE = File.join CONFIG_PATH, 'users.json' +MONITOR_CONFIGS_FILE = File.join CONFIG_PATH, 'monitor-configs.json' +SERVER_CONFIGS_FILE = File.join CONFIG_PATH, 'server-configs.json' +PLAYER_INFO_FILE = File.join CONFIG_PATH, 'players.json' + +WRAPPER_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze +WRAPPER_CONFIG = File.join WRAPPER_ROOT, 'config' +WEBAPP_ROOT = File.join WRAPPER_ROOT, 'admin-interface' +WEBAPP_CONFIG = File.join(WRAPPER_CONFIG, 'config.toml') +WEBAPP_CONFIG_SAMPLE = File.join(WRAPPER_CONFIG, 'config.toml.sample') +GENERATED_SSL_CERT = File.join(WRAPPER_CONFIG, 'generated_ssl_cert.pem') +GENERATED_SSL_KEY = File.join(WRAPPER_CONFIG, 'generated_ssl_key.pem') +SERVER_ROOT = File.join WRAPPER_ROOT, 'ohd-server' +STEAMCMD_ROOT = File.join WRAPPER_ROOT, 'steamcmd' +STEAMCMD_EXE = File.join STEAMCMD_ROOT, 'installation', (WINDOWS ? "steamcmd.exe" : "steamcmd.sh") +STEAM_APPINFO_VDF = File.join STEAMCMD_ROOT, (WINDOWS ? "installation" : 'Steam'), 'appcache', 'appinfo.vdf' +USER_HOME = ENV['HOME'] unless USER_HOME +ENV['HOME'] = STEAMCMD_ROOT # Steam will pollute the user directory otherwise on Linux. + +BINARY = File.join SERVER_ROOT, 'HarshDoorstop', 'Binaries', (WINDOWS ? 'Win64\HarshDoorstopServer-Win64-Shipping.exe' : 'Linux/HarshDoorstopServer-Linux-Shipping') +SERVER_LOG_DIR = File.join SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Logs' +RCON_LOG_FILE = File.join SERVER_LOG_DIR, 'HarshDoorstop.log' +CONFIG_FILES_DIR = File.join WRAPPER_ROOT, 'server-config' +FileUtils.mkdir_p CONFIG_FILES_DIR +CONFIG_FILES = { + game_ini: { + type: :ini, + actual: File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Game.ini'), + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'Game.ini')%>" + }, + engine_ini: { + type: :ini, + actual: File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Engine.ini'), + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'Engine.ini')%>" + }, + game_user_settings_ini: { + type: :ini, + actual: File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'GameUserSettings.ini'), + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'GameUserSettings.ini')%>" + }, + admins_cfg: { + type: :txt, + actual_erb: "<%=File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Admins_' + config_id + '.cfg')%>", + local_erb: "<%=File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Admins_' + config_id + '.cfg')%>" + }, + mapcycle_cfg: { + type: :txt, + actual_erb: "<%=File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'MapCycle_' + config_id + '.cfg')%>", + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'MapCycle.cfg')%>" + }, + bans_cfg: { + type: :txt, + actual: File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Bans.cfg'), + local_erb: "<%=File.join(SERVER_ROOT, 'HarshDoorstop', 'Saved', 'Config', (WINDOWS ? 'WindowsServer' : 'LinuxServer'), 'Bans.cfg')%>" + }, + motd_txt: { + type: :txt, + actual_erb: "<%=File.join(SERVER_ROOT, 'HarshDoorstop', 'Config', 'Server', 'Motd_' + config_id + '.txt')%>", + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'Motd.txt')%>" + }, + notes_txt: { + type: :txt, + actual: nil, + local_erb: "<%=File.join(CONFIG_FILES_DIR, config_id, 'Notes.txt')%>" + }, +} + +MAPMAP = { + 'Argonne' => 'Argonne', + 'Montecassino' => ' Monte Cassino', + 'LamDong' => 'Lam Dong', + 'Khafji_P' => 'Khafji_P', + 'Risala' => 'Risala', + 'AAS-TestMap' => 'Test Map (AAS)' + # 'SaintQuentin' => 'Saint Quentin', + # 'OmahaBeach' => 'OmahaBeach', + # 'Carentan' => 'Carentan', + # 'Tan_Binh' => 'Tan_Binh' +} +MAPMAP_INVERTED = MAPMAP.invert +SIDES = [ + 'Insurgents', + 'Security' +] +SCENARIO_MODES = [ +] +GAME_MODES = [ + 'Ambush', + 'Domination', + 'Firefight', + 'Frontline', + 'Occupy', + 'Skirmish', + 'CaptureTheBase', + 'TeamDeathmatch', + 'Filming', + 'Mission', + 'Checkpoint', + 'CheckpointHardcore', + 'CheckpointTutorial', + 'Operations', + 'Outpost', + 'Survival' +] +RULE_SETS = [ + 'CheckpointFrenzy', + 'CompetitiveFirefight', + 'CompetitiveTheater', + 'MatchmakingCasual', + 'OfficialRules' +] +MUTATORS = { + 'AllYouCanEat' => { 'name' => 'All You Can Eat', 'description' => 'Start with 100 supply points.' }, + 'AntiMaterielRiflesOnly' => { 'name' => 'Anti-Materiel Only', 'description' => 'Only anti-materiel rifles are available along with normal equipment and explosives.' }, + 'BoltActionsOnly' => { 'name' => 'Bolt-Actions Only', 'description' =>'Only bolt-action rifles are available along with normal equipment and explosives.' }, + 'Broke' => { 'name' => 'Broke', 'description' => 'Start with 0 supply points.' }, + 'BudgetAntiquing' => {'name' => 'Budget Antiquing', 'description' => 'Only allows only old, cheap weapons along with normal equipment and explosives.' }, + 'BulletSponge' => { 'name' => 'Bullet Sponge', 'description' => 'Health is increased.' }, + 'Competitive' => { 'name' => 'Competitive', 'description' => 'Equipment is more expensive, rounds are shorter, and capturing objectives is faster.' }, + 'CompetitiveLoadouts' => { 'name' => 'Competitive Loadouts', 'description' => 'Player classes are replaced with those from Competitive.' }, + 'FastMovement' => { 'name' => 'Fast Movement', 'description' => 'Move faster.' }, + 'Frenzy' => { 'name' => 'Frenzy', 'description' => 'Fight against AI enemies who only use melee attacks. Watch out for special enemies.' }, + 'FullyLoaded' => {'name' => 'Fully Loaded', 'description' => 'All weapons, equipment, and explosives in the game are available in the Loadout Menu.' }, + 'Guerrillas' => { 'name' => 'Guerrillas', 'description' => 'Start with 5 supply points.' }, + 'Gunslingers' => {'name' => 'Gunslingers', 'description' => 'Players are equipped with the MR 73 revolver, normal equipment, and explosives.' }, + 'Hardcore' => { 'name' => 'Hardcore', 'description' => 'Mutator featuring slower movement speeds and longer capture times.' }, + 'HeadshotOnly' => { 'name' => 'Headshots Only', 'description' => 'Players only take damage when shot in the head.' }, + 'HotPotato' => { 'name' => 'Hot Potato', 'description' => 'A live fragmentation grenade is dropped on death.' }, + 'LockedAim' => { 'name' => 'Locked Aim', 'description' => 'Weapons always point to the center of the screen.' }, + 'MakarovsOnly' => {'name' => 'Makarovs Only', 'description' => 'Makarov pistols only.' }, + 'NoAim' => { 'name' => 'No Aim Down Sights', 'description' => 'Aiming down sights is disabled.' }, + 'NoDrops' => {'name' => 'No Drops', 'description' => 'Weapons, explosives, and equipment are not dropped by dead players or enemy AI.' }, + 'PistolsOnly' => { 'name' => 'Pistols Only', 'description' => 'Only pistols are available along with normal equipment and explosives.' }, + 'Poor' => {'name' => 'Poor', 'description' => 'Players start with only 2 supply points' }, + 'ShotgunsOnly' => { 'name' => 'Shotguns Only', 'description' => 'Only Shotguns are available along with normal equipment and explosives.' }, + 'SlowCaptureTimes' => { 'name' => 'Slow Capture Times', 'description' => 'Objectives will take longer to capture.' }, + 'SlowMovement' => { 'name' => 'Slow Movement', 'description' => 'Move slower.' }, + 'SoldierOfFortune' => { 'name' => 'Soldier of Fortune', 'description' => 'Gain supply points as your score increases.' }, + 'SpecialOperations' => { 'name' => 'Special Operations', 'description' => 'Start with 30 supply points.' }, + 'Strapped' => { 'name' => 'Strapped', 'description' => 'Start with 1 supply point.' }, + 'Ultralethal' => { 'name' => 'Ultralethal', 'description' => 'Everyone dies with one shot.' }, + 'Vampirism' => { 'name' => 'Vampirism', 'description' => 'Receive health when dealing damage to enemies equal to the amount of damage dealt.' }, + 'Warlords' => { 'name' => 'Warlords', 'description' => 'Start with 10 supply points.' } +} + + +class ConfigHandler + attr_reader :monitor_configs + attr_reader :server_configs + attr_reader :users + attr_reader :bans_thread + attr_accessor :players + + def self.generate_password + Sysrandom.base64(32 + Sysrandom.random_number(32)).gsub("\n", '') + end + + CONFIG_VARIABLES = { + 'server-config-name' => { + 'default' => 'Default', + 'validation' => Proc.new { true } + }, + 'server_default_map' => { + 'default' => MAPMAP.keys.sample, + 'random' => false, + 'validation' => Proc.new { |map| !map.to_s.empty? }, + 'type' => :map + }, + 'server_lighting_day' => { + 'default' => 'true', + 'validation' => Proc.new { |val| ['true', 'false'].include? val } + }, + 'server_default_side' => { + 'default' => SIDES.sample, + 'random' => false, + 'validation' => Proc.new { |side| SIDES.include?(side) || side == 'Random' } + }, + 'server_max_players' => { + 'default' => '8', + 'type' => :argument, + 'validation' => Proc.new do |num| + num.to_s =~ /\A\d+\Z/ + rescue + false + end + }, + 'server_max_players_override' => { + 'default' => '10', + 'type' => :engine_ini, + 'validation' => Proc.new do |num| + num.to_s =~ /\A\d+\Z/ + rescue + false + end, + 'getter' => Proc.new { |engine_ini| engine_ini['SystemSettings']['net.MaxPlayersOverride'] }, + 'setter' => Proc.new { |engine_ini, players| engine_ini['SystemSettings']['net.MaxPlayersOverride'] = players } + }, + 'server_game_mode' => { + 'default' => 'None', + 'validation' => Proc.new { |mode| ['None'].concat(GAME_MODES).include? mode } + }, + 'server_scenario_mode' => { + 'default' => 'Checkpoint', + 'validation' => Proc.new { |mode| SCENARIO_MODES.include? mode } + }, + 'server_rule_set' => { + 'default' => 'None', + 'validation' => Proc.new { |rule_set| RULE_SETS.include?(rule_set) || rule_set = 'None' } + }, + 'server_mutators_custom' => { + 'default' => '', + 'validation' => Proc.new { true } + }, + 'server_mutators' => { + 'default' => [], + 'validation' => Proc.new { |mutators| mutators.all? { |mutator| MUTATORS.keys.include?(mutator) } } + }, + 'server_cheats' => { + 'default' => 'false', + 'validation' => Proc.new { |val| ['true', 'false'].include? val } + }, + 'server_name' => { + 'default' => 'OHD Admin Wrapper', + 'type' => :argument, + 'template' => '-hostname=<%= it %>', + 'validation' => Proc.new { true }, + }, + 'server_password' => { + 'default' => '', + 'type' => :argument, + 'template' => '-password=<%= it %>', + 'validation' => Proc.new { true }, + 'sensitive' => true + }, + 'server_game_port' => { + 'default' => '7777', + 'type' => :argument, + 'template' => '-Port=<%= it %>', + 'validation' => Proc.new { |port| ConfigHandler.valid_port? port } + }, + 'server_query_port' => { + 'default' => '27131', + 'type' => :argument, + 'template' => '-QueryPort=<%= it %>', + 'validation' => Proc.new { |port| ConfigHandler.valid_port? port } + }, + 'server_rcon_enabled' => { + 'default' => 'true', + 'type' => :game_ini, + 'getter' => Proc.new { |game_ini| game_ini['/Script/RCON.RCONServerSystem']['bEnabled'] }, + 'setter' => Proc.new { |game_ini, bool| game_ini['/Script/RCON.RCONServerSystem']['bEnabled'] = bool.to_s.casecmp('true').zero? ? 'True' : 'False' }, + 'validation' => Proc.new { true } + }, + 'server_rcon_port' => { + 'default' => '27015', + 'type' => :game_ini, + 'getter' => Proc.new { |game_ini| game_ini['/Script/RCON.RCONServerSystem']['ListenPort'] }, + 'setter' => Proc.new { |game_ini, port| game_ini['/Script/RCON.RCONServerSystem']['ListenPort'] = port }, + 'validation' => Proc.new { |port| ConfigHandler.valid_port? port } + }, + 'server_rcon_password' => { + 'default' => ConfigHandler.generate_password, + 'type' => :game_ini, + 'getter' => Proc.new { |game_ini| game_ini['/Script/RCON.RCONServerSystem']['Password'] }, + 'setter' => Proc.new { |game_ini, password| game_ini['/Script/RCON.RCONServerSystem']['Password'] = password }, + 'validation' => Proc.new { true }, + 'sensitive' => true + }, + 'server_gst' => { + 'default' => '', + 'type' => :argument, + 'validation' => Proc.new { |token| token =~ /\A[ABCDEF0-9]+\Z/ || token.empty? }, + 'sensitive' => true + }, + 'server_gslt' => { + 'default' => '', + 'type' => :argument, + 'validation' => Proc.new { |token| token =~ /\A[ABCDEF0-9]+\Z/ || token.empty? }, + 'sensitive' => true + }, + 'server_custom_server_args' => { + 'default' => '', + 'validation' => Proc.new { true } + }, + 'server_custom_travel_args' => { + 'default' => '', + 'validation' => Proc.new { true } + }, + 'hang_recovery' => { + 'default' => 'true', + 'validation' => Proc.new { |val| ['true', 'false'].include? val } + }, + 'query_recovery' => { + 'default' => 'true', + 'validation' => Proc.new { |val| ['true', 'false'].include? val } + }, + 'join_message' => { + 'default' => 'Welcome, ${player_name}!', + 'validation' => Proc.new { true } + }, + 'leave_message' => { + 'default' => 'See you later, ${player_name}!', + 'validation' => Proc.new { true } + }, + 'admin_join_message' => { + 'default' => 'Welcome, ${player_name}! (admin)', + 'validation' => Proc.new { true } + }, + 'admin_leave_message' => { + 'default' => 'See you later, ${player_name}! (admin)', + 'validation' => Proc.new { true } + } + } + + def initialize + @users = load_user_config + @monitor_configs = load_monitor_configs + @server_configs = load_server_configs + @players = load_player_config + end + + def self.valid_port?(port) + port = port.to_i + port >= 1 && port <= 65535 + rescue + false + end + + def self.sanitize_directory(directory_name) + directory_name.gsub(/[^ 0-9A-Za-z.\-'"]/, '') + end + + def get_uuid(uuid=Sysrandom.uuid) + return uuid if @server_configs.nil? || @server_configs.empty? + while @server_configs.keys.include?(uuid) + uuid = Sysrandom.uuid + end + uuid + end + + def get_default_config + defaults = {'id' => get_uuid} + CONFIG_VARIABLES.each { |k, v| defaults[k] = v['default'] } + defaults + end + + def get_default_user_config + default_admin_user = User.new('admin', :host, password: BCrypt::Password.create('password').to_s, initial_password: 'password') + { + default_admin_user.id => default_admin_user + } + end + + def load_user_config + @users = Oj.load(File.read(USERS_CONFIG_FILE)) + @users = get_default_user_config if @users.to_s.strip.empty? + @users + rescue Errno::ENOENT + get_default_user_config + rescue => e + log "Failed to load user config from #{USERS_CONFIG_FILE}. Using default user config.", e + raise + end + + def load_monitor_configs + @monitor_configs = Oj.load(File.read(MONITOR_CONFIGS_FILE)) + @monitor_configs = {} if @monitor_configs.to_s.empty? + @monitor_configs.each { |_, config| config['id'] ||= get_uuid } + @monitor_configs + rescue Errno::ENOENT + {} + rescue => e + log "Failed to load monitor configs from #{MONITOR_CONFIGS_FILE}. Using empty config.", e + raise + end + + def add_server_config(config) + @server_configs[config['id']] = config + end + + def get_server_configs_skeleton + skeleton = {} + default_config = get_default_config + skeleton[default_config['id']] = default_config + end + + def load_server_configs + @server_configs = Oj.load(File.read(SERVER_CONFIGS_FILE)) + if @server_configs.nil? || @server_configs.empty? + @server_configs = {} + add_server_config(get_default_config) + end + # Ensure all keys are IDs, else convert automatically + @server_configs.select { |k, _| !k.is_uuid? }.keys.each do |key| + log "Replacing config key '#{key}' with an ID" + config = @server_configs[key] + id = config['id'] || get_uuid + config['id'] = id + @server_configs[id] = config + @server_configs.delete(key) + end + # Ensure all configs have latest config params + @server_configs.each do |id, config| + @server_configs[id] = get_default_config.merge(config) + end + init_server_config_files + @server_configs + rescue Errno::ENOENT + {'Default' => get_default_config} + rescue => e + log "Failed to load server configs from #{SERVER_CONFIGS_FILE}. Using empty config.", e + raise + end + + def load_player_config + Oj.load(File.read(PLAYER_INFO_FILE)) + rescue Errno::ENOENT + {} + rescue => e + log "Failed to load user config from #{USERS_CONFIG_FILE}. Using default user config.", e + raise + end + + def write_user_config + log "Writing user config" + File.write(USERS_CONFIG_FILE, Oj.dump(@users, indent: 2)) + end + + def write_monitor_configs + log "Writing monitor configs" + File.write(MONITOR_CONFIGS_FILE, Oj.dump(@monitor_configs, indent: 2)) + end + + def create_server_config(incoming_config) + config_id = incoming_config['id'] + config_name = incoming_config['server-config-name'] + overwrote = false + outgoing_config = if config_id && @server_configs[config_id] && @server_configs[config_id]['server-config-name'] == config_name + overwrote = true + log "Writing server config: #{config_id} #{config_name}", level: :info + @server_configs[config_id] = get_default_config.merge(incoming_config) + else + new_config = get_default_config + config_id = new_config['id'] + log "Creating server config: #{config_id} #{config_name}", level: :info + @server_configs[config_id] = get_default_config.merge(incoming_config) + .merge({ + 'id' => config_id, # Ignore provided config ID + }) + end + write_server_configs + init_server_config_files(config_id) + outgoing_config + end + + def delete_server_config(config_id) + config = @server_configs[config_id] + config_name = config['server-config-name'] + log "Deleting server config: #{config_id} #{config_name}", level: :info + @server_configs.delete config_id + CONFIG_FILES.reject { |f, _| [:bans_cfg, :admins_cfg].include?(f) }.values.each do |it| + local = ERB.new(it[:local_erb]).result(binding) + FileUtils.rm local + rescue Errno::ENOENT + rescue => e + log "Error while trying to delete file (#{local})", e + end + begin + dir = File.join(CONFIG_FILES_DIR, config_id) + FileUtils.rmdir dir + rescue Errno::ENOENT + rescue => e + log "Error while trying to delete directory (#{dir})", e + end + add_server_config(get_default_config) if @server_configs.empty? + write_server_configs + nil + end + + def write_server_configs + log "Writing server configs" + File.write(SERVER_CONFIGS_FILE, Oj.dump(@server_configs, indent: 2)) + nil + end + + def write_player_info + log "Writing player info" + File.write(PLAYER_INFO_FILE, Oj.dump(@players, indent: 2)) + nil + end + + def write_config + write_user_config + write_monitor_configs + write_server_configs + write_player_info + true + rescue => e + log 'Failed to write config', e + false + end + + def init_server_config_files(config_id=nil) + config_ids = @server_configs.values.map { |c| c['id'] } + config_ids = config_id.nil? ? config_ids : [config_id] + config_ids.reject{ |id| !config_ids.include?(id) }.each do |config_id| + CONFIG_FILES.values.each do |it| + [ERB.new(it[:local_erb]).result(binding), it[:actual], it[:actual_erb] && ERB.new(it[:actual_erb]).result(binding)].each do |path| + next if path.nil? + FileUtils.mkdir_p File.dirname path + FileUtils.touch path + end + end + end + nil + end + + def apply_server_config_files(config) + config_id = config['id'] # Needed for bindings + # Apply values in case any in memory aren't in the file + apply_game_ini_local config + apply_engine_ini_local config + + # Remove :delete files so that the server doesn't use any the user may have manually set outside of OHDAW + CONFIG_FILES.reject {|_,i| i[:delete].nil? }.values.each do |it| + local = ERB.new(it[:delete]).result(binding) + log "Deleting #{local}" + FileUtils.rm local + rescue Errno::ENOENT + rescue => e + log "Error while trying to delete file (#{local})", e + end + + CONFIG_FILES.reject {|_,i| i[:actual].nil? && i[:actual_erb].nil? }.values.each do |it| + local = ERB.new(it[:local_erb]).result(binding) # relies on config_id + actual = it[:actual_erb] ? ERB.new(it[:actual_erb]).result(binding) : it[:actual] # relies on config_id for actual_erb if present + if local == actual + log "Skipping #{local} -> #{actual} (same file)" + return + end + log "Applying #{local} -> #{actual}" + FileUtils.cp local, actual + rescue => e + log "Error while trying to copy file (#{local} -> #{actual})", e + end + nil + end + + def get_server_config_file_content(config_file, config_id) + local = ERB.new(CONFIG_FILES[config_file][:local_erb]).result(binding) + File.read(local) + end + + def set(config_id, variable, value) + return [false, "Variable not in config: #{variable}"] unless CONFIG_VARIABLES.keys.include? variable + return [false, "Variable has no validation: #{variable}"] unless CONFIG_VARIABLES[variable]['validation'].respond_to?('call') + config = (@server_configs[config_id] = get_default_config.merge(@server_configs[config_id] || {})) + old_value = config[variable] + return [false, "Variable #{variable} is already set to #{CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : value}."] if value.to_s == old_value.to_s + status = false + msg = "Failed to set #{variable.inspect} to #{CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : value.inspect}" + old_value = old_value || CONFIG_VARIABLES[variable]['default'] || 'Unknown' + + if CONFIG_VARIABLES[variable]['validation'].call(value) + log "Value passed validation: #{CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : value.inspect}" + config[variable] = value + write_server_configs + apply_game_ini_local(@server_configs[config_id]) if CONFIG_VARIABLES[variable]['type'] == :game_ini + apply_engine_ini_local(@server_configs[config_id]) if CONFIG_VARIABLES[variable]['type'] == :engine_ini + status = true + else + msg = "Value failed validation for variable #{variable.inspect}: #{CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : value.inspect}" + log msg, level: :warn + end + + return [status, msg, CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : config[variable], CONFIG_VARIABLES[variable]['sensitive'] ? '[REDACTED]' : old_value] + end + + def get(config_id, variable) + @server_configs[config_id][variable] + end + + def get_log_file(config_id) + log_file = File.join(SERVER_LOG_DIR, "#{config_id}.log") + FileUtils.mkdir_p File.dirname log_file + begin + FileUtils.touch log_file + rescue Errno::EACCES + log "Unable to access log file: #{log_file}" + end + log_file + end + + def get_scenario(map, mode, side) + filtered_map = MAPMAP[map] || map + "Scenario_#{filtered_map}_#{mode}#{'_' << side if ['Checkpoint', 'Push'].include?(mode)}" + end + + def get_additional_travel_args(config) + # Split using regex for unquoted strings + config['server_custom_travel_args'].dup.to_s.split(/[ ]+(?=[^"]*(?:"[^"]*"[^"]*)*$)/) + end + + def get_query_string(config, map: nil, side: nil, game_mode: nil, max_players: nil, password: nil) + map = config['server_default_map'] == 'Random' ? MAPMAP.keys.sample : config['server_default_map'].dup if map.nil? + game_mode = config['server_game_mode'] == 'Random' ? GAME_MODES.sample : config['server_game_mode'].dup if game_mode.nil? + max_players ||= config['server_max_players'].dup + password ||= config['server_password'].dup + query = map.dup + query << "?MaxPlayers=#{max_players}" + query << "?Game=#{game_mode}" unless game_mode == 'None' + query << "?Password=#{password}" unless password.empty? + get_additional_travel_args(config).each do |arg| + query << arg + end + query + end + + def get_additional_server_args(config) + # Split using regex for unquoted strings + config['server_custom_server_args'].dup.split(/[ ]+(?=[^"]*(?:"[^"]*"[^"]*)*$)/) + end + + def get_server_arguments(config) + arguments = [] + map = config['server_default_map'].dup + starting_map = map == 'Random' ? MAPMAP.keys.sample : map + starting_map = MAPMAP.keys.include?(starting_map) ? starting_map : (MAPMAP.keys.include?(MAPMAP.key(starting_map)) ? MAPMAP.key(starting_map) : MAPMAP.keys.first ) + arguments.push( + get_query_string(config, map: starting_map), + "-ServerName=#{config['server_name']}", + "-MaxPlayers=#{config['server_max_players']}", + "-Port=#{config['server_game_port']}", + "-QueryPort=#{config['server_query_port']}", + "-log=#{config['id']}.log", + "-LogCmds=LogGameplayEvents Log", + "-LOCALLOGTIMES", + "-AdminList=Admins_#{config['id']}.cfg", + "-MapCycle=MapCycle_#{config['id']}.cfg" + ) + custom_args = get_additional_server_args(config) + arguments.concat(custom_args) + arguments + end + + def apply_game_ini_local(config) + # config_id needed in binding + config_id = config['id'] + apply_ini(config, ERB.new(CONFIG_FILES[:game_ini][:local_erb]).result(binding)) + end + + def apply_engine_ini_local(config) + # config_id needed in binding + config_id = config['id'] + apply_ini(config, ERB.new(CONFIG_FILES[:engine_ini][:local_erb]).result(binding)) + end + + def apply_ini(config, path) + type = File.basename(path).downcase.sub('.', '_').to_sym + log "Applying #{type} values to #{path}" + ini = IniFile.load(path) + changed = false + CONFIG_VARIABLES.select { |_, metadata| metadata['type'] == type }.each do |option, metadata| + next if (metadata['getter'].call(ini).to_s) == config[option].to_s + changed = true + log "Applying #{option}" + metadata['setter'].call(ini, config[option]) + end + if changed + log "Saving #{type}" + ini.save + else + log "No #{type} changes" + end + rescue => e + log "Error while applying #{type} settings", e + raise + end +end diff --git a/admin-interface/lib/daemon.rb b/admin-interface/lib/daemon.rb new file mode 100644 index 0000000..e209d36 --- /dev/null +++ b/admin-interface/lib/daemon.rb @@ -0,0 +1,369 @@ +require 'file-tail' +require_relative 'rcon-client' +require_relative 'server-monitor' +require_relative 'server-updater' +require_relative 'subprocess' + +include Process + +class ServerDaemon + attr_accessor :config + attr_accessor :executable + attr_accessor :server_root_dir + attr_accessor :arguments + attr_accessor :rcon_ip + attr_accessor :rcon_port + attr_accessor :rcon_pass + attr_accessor :player_feed + attr_accessor :steam_api_key + attr_reader :frozen_config + attr_reader :name + attr_reader :id + attr_reader :active_game_port + attr_reader :active_rcon_port + attr_reader :active_query_port + attr_reader :active_rcon_pass + attr_reader :buffer + attr_reader :rcon_buffer + attr_reader :chat_buffer + attr_reader :rcon_client + attr_reader :game_pid + attr_reader :threads + attr_reader :monitor + attr_reader :log_file + attr_reader :rcon_listening + + def initialize(config, daemons, mutex, rcon_client, server_buffer, rcon_buffer, chat_buffer, steam_api_key: '') + @config = config + @name = @config['server-config-name'] + @id = @config['id'] + @daemons = daemons + @daemons_mutex = mutex + @monitor_mutex = Mutex.new + @rcon_ip = '127.0.0.1' + @buffer = server_buffer + @rcon_buffer = rcon_buffer + @chat_buffer = chat_buffer + @rcon_client = rcon_client + @rcon_listening = false + @game_pid = nil + @monitor = nil + @threads = {} + @buffer[:persistent] = true + @rcon_buffer[:persistent] = true + @chat_buffer[:persistent] = true + @chat_buffer[:filters] = [ + Proc.new do |line| + line.gsub!(/\x1b\[[0-9;]*m/, '') # Remove color codes + line.gsub!(/^(\d{4}\/\d{2}\/\d{2}) (\d{2}:\d{2}:\d{2}).*TX >>\) say/, '\1 \2 ADMIN:') # Cut down RCON messages (TX) + line.gsub!(/^\[(\d{4})\.(\d{2})\.(\d{2})-(\d{2}).(\d{2}).(\d{2}).*LogChat: Display: /, '\1/\2/\3 \4:\5:\6 ') # Cut down server log messages (RX) + end + ] + @buffer[:filters] = [ + Proc.new do |line| + line.gsub!(/\x1b\[[0-9;]*m/, '') # Remove color codes + line.prepend "#{get_server_id} | " + end + ] + @rcon_buffer[:filters] = [ + Proc.new { |line| line.prepend "#{get_server_id} | " } + ] + @log_file = nil + @player_feed = [] + @admin_ids = nil + @steam_api_key = steam_api_key + @exit_requested = false + start_daemon + log "Daemon initialized" + end + + def log(message, exception=nil, level: nil) + super("#{get_server_id} | #{message}", exception, level: level) # Call the log function created by logger + end + + def get_server_id + conf = @frozen_config || @config + "[PID #{@game_pid || '(N/A)'} Ports #{[conf['server_game_port'], conf['server_query_port'], conf['server_rcon_port']].join(',')}]" + end + + def server_running? + if @game_pid.nil? + return false + end + Process.kill(0, @game_pid) + true + rescue Errno::ESRCH + false + end + + def do_pre_update_warning(sleep_length: 5) + log "Sending restart warning to server", level: :info + message = 'say This server is restarting in 5 seconds to apply a new server update.' + message << ' This may take some time.' if WINDOWS # Since we have to stop the server before downloading the update + do_blast_message(message) + sleep sleep_length + rescue => e + log "Error while trying to message players", e + end + + def do_blast_message(message, amount: 3, interval: 0.2) + amount.times do |i| + do_send_rcon message + sleep interval unless i + 1 == amount + end + end + + def is_ohd_admin?(unique_id) + @admin_ids.include?(unique_id.to_s) + end + + def do_send_rcon(command, host: nil, port: nil, pass: nil, buffer: nil, outcome_buffer: nil, no_rx: false) + host ||= @rcon_ip + port ||= @active_rcon_port || @config['server_rcon_port'] + port ||= @active_rcon_pass + pass ||= @active_rcon_pass || @config['server_rcon_password'] + buffer ||= @rcon_buffer + outcome_buffer ||= buffer + log "Calling RCON client for command: #{command}" + @rcon_client.send(host, port, pass, command, buffer: buffer, outcome_buffer: outcome_buffer, no_rx: no_rx) + end + + def do_start_server + @exit_requested = false + # log "start daemons mutex wait" + @daemons_mutex.synchronize do + # log "start daemons mutex start" + return "Exiting" if @exit_requested + if server_running? || (@threads[:game_server] && @threads[:game_server].alive?) + "Server is already running. PID: #{@game_pid}" + else + new_game_port = @config['server_game_port'] + if @active_game_port && @active_game_port != new_game_port + # We need to move the daemon for future access + log "Moving daemon #{@active_game_port} -> #{new_game_port}" + former_tenant = @daemons[new_game_port] + if former_tenant + log "Stopping daemon #{former_tenant.name} using desired game port #{new_game_port}", level: :warn + former_tenant.implode + end + @daemons[new_game_port] = @daemons.delete @active_game_port + end + log "Starting server", level: :info + @server_started = false + @server_failed = false + @game_pid = nil + @threads[:game_server] = get_game_server_thread + # Keep the mutex lock until we see RCON listening or the server fails to start + sleep 0.1 until (@game_pid && @rcon_listening) || @server_failed + @game_pid ? "Server is starting. PID: #{@game_pid}" : "Server failed to start!" + end + # log "start daemons mutex end" + end + # log "start daemons mutex clear" + end + + def do_restart_server + log "Restarting server", level: :info + do_stop_server + do_start_server + end + + def do_stop_server + @exit_requested = true + # log "stop daemons mutex wait" + @daemons_mutex.synchronize do + # log "stop daemons mutex start" + return 'Server not running.' unless server_running? + log "Stopping server", level: :info + # No need to do anything besides remove it from monitoring + # We want the signal to be sent to the thread's subprocess + # so that the thread has time to set the status/message in the buffer + @server_thread_exited = false + @threads.delete(:game_server) + msg = kill_server_process + log "Waiting for server thread to exit and clean up" + sleep 0.2 until @server_thread_exited || @server_failed + log "Server thread #{@server_failed ? "failed" : "exited and cleaned up"}" + msg + # log "stop daemons mutex end" + end + # log "stop daemons mutex clear" + end + + def implode + log "Daemon for server #{@name} (#{@config['id']}) imploding", level: :info + @exit_requested = true + @game_pid = nil + @buffer.reset + @buffer = nil + @rcon_buffer.reset + @rcon_buffer = nil + Thread.new { @monitor.stop if @monitor } + game_server_thread = @threads.delete :game_server + kill_server_process + game_server_thread.join unless game_server_thread.nil? + @threads.keys.each do |thread_name| + thread = @threads.delete thread_name + thread.kill if thread.respond_to? :kill + end + end + + def kill_server_process(signal: nil) + signal = 'KILL' if signal.nil? # TERM can hang shutting down EAC. KILL doesn't, but might not disconnect players (instead they time out). + return "Unable to send #{signal} (#{Signal.list[signal]}) signal to server; no known PID!" unless @game_pid + return "Server isn't running!" unless server_running? + begin + Process.kill(signal, @game_pid) + rescue Errno::ESRCH + end + msg = "Sent #{signal} (#{Signal.list[signal]}) signal to PID #{@game_pid}." + log msg, level: :info + msg + end + + def create_monitor + @monitor_mutex.synchronize do + if @monitor.nil? + Thread.new { @monitor = ServerMonitor.new('127.0.0.1', @active_query_port, @active_rcon_port, @active_rcon_pass, name: @name, rcon_buffer: @rcon_buffer, interval: 5, daemon_handle: self) } + end + sleep 0.5 while @monitor.nil? && !(@exit_requested) + end + end + + def run_game_server + log "Applying config" + @frozen_config = @config.dup + $config_handler.apply_server_config_files @frozen_config + @admin_ids = $config_handler.get_server_config_file_content(:admins_cfg, @frozen_config['id']).split("\n").map { |l| l[/\d{17}/] }.compact + executable = BINARY + arguments = $config_handler.get_server_arguments(@frozen_config) + @active_game_port = @frozen_config['server_game_port'] + @active_query_port = @frozen_config['server_query_port'] + @active_rcon_port = @frozen_config['server_rcon_port'] + @active_rcon_pass = @frozen_config['server_rcon_password'] + @log_file = $config_handler.get_log_file(@frozen_config['id']) + log "Spawning game process: #{[executable, *arguments].inspect}", level: :info + SubprocessRunner.run( + [executable, *arguments], + buffer: @buffer, + pty: false, + no_prefix: true, + formatter: Proc.new { |output, _| WINDOWS ? "#{datetime} | #{output.chomp}" : output.chomp } # Windows doesn't have the timestamp, so we'll add our own to make it look nice. + ) do |pid| + @game_pid = pid + log "Game process spawned. Starting self-monitoring after detecting RCON listening message.", level: :info + @rcon_tail_thread = Thread.new do + # last_modified_log_time = File.mtime(Dir[File.join(SERVER_LOG_DIR, '*.log')].sort_by{|f| File.mtime(f) }.last).to_i rescue 0 + # other_used_logs = @daemons.map { |_, daemon| daemon.log_file } + # @rcon_buffer[:data] << "[PID: #{@game_pid} Game Port: #{@active_game_port}] Waiting to detect log file in use" + log "Waiting to ensure log file is in use" + earlier = Time.now.to_i + loop do + last_updated = File.mtime(@log_file).to_i + break if last_updated > earlier + sleep 0.5 + end + log "Log file is in use. Proceeding with log tailing." + begin + File.open(@log_file) do |log| + log.extend(File::Tail) + log.interval = 0.1 + log.backward(0) + last_line_was_rcon = false + log.tail do |line| + Thread.exit if @exit_requested + next if line.nil? + if line.include? 'LogRCON' + last_line_was_rcon = true + if line[/LogRcon: Error: Failed to create TcpListener at .* for rcon support/] + log "RCON failed to initialize: #{line}", level: :warn + kill_server_process + elsif !@rcon_listening && line.include?('LogRCON: RCON server listening') && @monitor.nil? + @rcon_listening = true + log "RCON listening - Ending server start/stop lock", level: :info + create_monitor + Thread.new do + sleep 0.5 until @exit_requested || (@monitor && @monitor.all_green?) + log "Server is ready (RCON and Query connected)", level: :info + @server_started = true + end + end + elsif last_line_was_rcon + if line =~ /^\[\d{4}\.\d{2}\.\d{2}-\d{2}\.\d{2}\.\d{2}:/ || line =~ /^Log/ + last_line_was_rcon = false + end + end + if line.include? 'LogChat' + @chat_buffer[:filters].each { |filter| filter.call(line) } # Remove color codes; add server ID + @chat_buffer.synchronize { @chat_buffer.push line.chomp } + elsif last_line_was_rcon + @buffer[:filters].each { |filter| filter.call(line) } # Remove color codes; add server ID + @rcon_buffer.synchronize { @rcon_buffer.push line.chomp } + end + end + end + rescue EOFError + rescue => e + log "Error in RCON tail thread!", e + raise e + ensure + log "RCON tail thread stopped" + end + end + log "RCON tailing thread started." + end + log 'Game process exited', level: :info + ensure + @rcon_tail_thread.kill rescue nil + end + + def get_game_server_thread + Thread.new do + if !@exit_requested + run_game_server + end + rescue => e + @server_failed = true + log "Game server failed", e + Thread.new { @monitor.stop if @monitor } + @threads.delete :game_server unless @server_started # If we can't even start the server, don't keep trying + kill_server_process + ensure + @server_thread_exited = true + begin + @monitor.stop unless @monitor.nil? + @monitor = nil + @game_pid = nil + @log_file = nil + @rcon_listening = false + socket = @rcon_client.sockets["127.0.0.1:#{@active_rcon_port}"] + @rcon_client.delete_socket(socket) unless socket.nil? + rescue => e + log "Error while cleaning up game server thread", e + end + log "Game server thread exiting" + end + end + + def start_daemon(thread_check_interval: 2) + @daemon_thread = Thread.new do + while true + while @threads.empty? || @threads.values.all?(&:alive?) + sleep thread_check_interval + end + dead_threads = @threads.select { |_, t| !t.alive? }.keys + log "Dead daemon thread(s) detected: #{dead_threads.join(' ')}" + dead_threads.each do |key| + if @threads[key] + log "Starting #{key} thread", level: :info + @threads[key] = public_send("get_#{key.to_s}_thread") + end + end + sleep thread_check_interval + end + rescue => e + log "Error in daemon's self-monitoring thread", e + raise + end + end +end diff --git a/admin-interface/lib/logger.rb b/admin-interface/lib/logger.rb new file mode 100644 index 0000000..989c655 --- /dev/null +++ b/admin-interface/lib/logger.rb @@ -0,0 +1,91 @@ +# encoding: UTF-8 + +require 'logger' + +Dir.mkdir 'log' unless Dir.exist? 'log' +LOG_FILE = File.join('log', 'ohd-admin-wrapper.log') +SEVERITY_JUSTIFY = Logger::Severity.constants.map(&:length).max # [:DEBUG, :INFO, :WARN, :ERROR, :FATAL, :UNKNOWN] +DATETIME_FORMAT = "%Y/%m/%d %H:%M:%S.%L %z" +USER_HOME ||= ENV['HOME'] +$caller_justification = 25 + +class MultiTargetLogger + attr_reader :level + attr_reader :loggers + + def initialize(loggers) + @level = Logger::DEBUG + loggers.each do |name, logger| + logger.formatter = proc do |severity, datetime, progname, message| + "#{datetime} | #{severity.ljust SEVERITY_JUSTIFY}#{" | #{progname}" if progname} | #{message}\n" + end + logger.level = @level + end + @loggers = loggers + end + + Logger::Severity.constants.each do |severity| + severity = severity.downcase + define_method(severity) do |*args| + # Suppress FATAL error log on intentional exit + if severity == :fatal + severity = :debug if args.first.is_a? SystemExit + end + # Suppress SSL error for self-generated certificate + if args.first.to_s.end_with? ': sslv3 alert certificate unknown' + severity = :debug + args[0] = args.first.to_s + end + @loggers.each { |_, logger| logger.send(severity, *args) if Logger.const_get(severity.to_s.upcase) >= logger.level } + if args.first.is_a? Exception + @loggers.each { |_, logger| logger.send(:error, "Backtrace:#{args.first.backtrace.join("\n ").prepend("\n ")}") if Logger.const_get(severity.to_s.upcase) >= logger.level } + end + + nil + end + define_method("#{severity}?") do |*args| + Logger.const_get(severity.to_s.upcase) >= @level + end + end + + def puts(*args) + log(:debug, *args) + end + + def log(severity, *args) + severity = severity.downcase + @loggers.each { |_, logger| logger.send(severity, *args) if Logger.const_get(severity.to_s.upcase) >= logger.level } + nil + end + + def threshold(severity=nil, logger: :stdout) + return @loggers[:stdout].level if severity.nil? + level = severity.is_a?(Integer) ? severity : Logger.const_get(severity.to_s.upcase) + @loggers[:stdout].level = level + prev_level = @level + @level = level + prev_level + end + + def <<(message, severity: :debug) + log(severity, message.chomp) # Thanks, WEBrick AccessLog... + nil + end +end + +LOGGER_FILE = Logger.new(LOG_FILE, 10, 1024 * 5000) +LOGGER_STDOUT = Logger.new($stdout) +LOGGER = MultiTargetLogger.new({stdout: LOGGER_STDOUT, file: LOGGER_FILE}) + +def datetime # Helper function used elsewhere + Time.now.strftime(DATETIME_FORMAT) +end + +def log(message, exception=nil, level: nil) + unless exception.nil? + message = message + " | Exception occurred (#{exception.class}): #{exception.message}\n #{exception.backtrace.to_a.map { |l| l.sub USER_HOME, '~'}.join("\n ")}" + level ||= :error + end + level ||= :debug + LOGGER.log level, message +end diff --git a/admin-interface/lib/rcon-client.rb b/admin-interface/lib/rcon-client.rb new file mode 100644 index 0000000..17003cf --- /dev/null +++ b/admin-interface/lib/rcon-client.rb @@ -0,0 +1,396 @@ +#!/usr/bin/env ruby + +require 'socket' +require 'monitor' +require_relative '../ext/string' +require_relative 'logger' + +# https://developer.valvesoftware.com/wiki/Source_RCON_Protocol +# https://apidock.com/ruby/Array/pack +# https://apidock.com/ruby/String/unpack + +# Packet structure: +# Field | Type | Value +# ---------------------------------------------------------------------- +# Size | 32-bit little-endian Signed Integer (l<) | Varies, see below. +# ID | 32-bit little-endian Signed Integer (l<) | Varies, see below. +# Type | 32-bit little-endian Signed Integer (l<) | Varies, see below. +# Body | Null-terminated ASCII String (Z*) | Varies, see below. +# Empty String | Null-terminated ASCII String (Z*) | 0x00 + +# Packet size: +# The packet size field is a 32-bit little endian integer, representing the length of the request in bytes. +# Note that the packet size field itself is not included when determining the size of the packet, so the value +# of this field is always 4 less than the packet's actual length. The minimum possible value for packet size is 10: + +# Size | Containing +# 4 Bytes | ID Field +# 4 Bytes | Type Field +# At least 1 Byte | Packet body (potentially empty) +# 1 Bytes | Empty string terminator + +class NoTCPResponseError < StandardError + def initialize(host=nil) + super "Could not read a TCP response from server#{host ? " #{host}" : '!'}" + end +end + +class TCPSocketError < StandardError + def initialize(msg=nil) + super msg + end +end + +class RconSocket < Socket + attr_reader :mutex + + def initialize(ip, port, password, timeout=3) + @mutex = Mutex.new + @rcon_ip = ip + @rcon_port = port + @rcon_password = password + + addr = Socket.getaddrinfo(ip, nil) + sockaddr = Socket.pack_sockaddr_in(port, addr[0][3]) + + super(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket| + socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) + begin + socket.connect_nonblock(sockaddr) + rescue IO::WaitWritable + if IO.select(nil, [socket], nil, timeout) + begin + socket.connect_nonblock(sockaddr) + rescue Errno::EISCONN + # Connected + rescue + socket.close + raise + end + else + # IO.select returns nil when the socket is not ready before timeout + # seconds have elapsed + socket.close + raise "Connection to #{socket.remote_host} timed out." + end + end + end + end + + def info + return @rcon_ip, @rcon_port, @rcon_password + end + + def remote_host + "#{@rcon_ip}:#{@rcon_port}" + end +end + +# Handles holding open RCON connections to each server and sending commands +class RconClient + attr_reader :sockets + + @@pack_string = 'l socket + put_socket socket.remote_address.inspect_sockaddr, socket + return socket + end + rescue => e + log "Failed to open socket to #{server_ip}:#{port} (#{e.class}) #{e.message}", level: :warn + raise + end + + def authenticate(socket, password) + # "If the rcon_password cvar is not set, or if it is set to empty string, all SERVERDATA_AUTH requests will be refused." + # Currently we assume there is always a password. + log "#{socket.remote_host.ljust(21)} Authenticating RCON connection" + packet = build_packet(password, 3, hide_content: true) # Type 3 for auth packet + id = send_receive_wrapper socket, packet, sensitive: true + raise Errno::ENOTCONN if id.nil? + raise "Failed to authenticate. Bad RCON password?" if id == -1 + log "#{socket.remote_host.ljust(21)} Successfully authenticated." + true + rescue Errno::ENOTCONN => e + log "#{socket.remote_host.ljust(21)} Failed to connect with RCON: (#{e.class}) #{e.message}", :warn + delete_socket socket + raise + end + + def close + @sockets.each do |host, socket| + log "Closing socket to #{host}" + delete_socket socket + end + log "All sockets closed." + end + + def get_socket_for_host(server_ip, port, password) + socket = get_socket "#{server_ip}:#{port}" + socket = open_socket server_ip, port, password if socket.nil? + begin + socket.remote_address # see if we're connected + rescue Errno::ENOTCONN + socket = reopen_socket socket + end + socket + end + + def build_packet(body, type=2, id=1, hide_content: false) + # packet = [0xFF, 0xFF, 0xFF, 0xFF, a2s_info_header, content].pack('c5Z*') + # packet = [0xFF, 0xFF, 0xFF, 0xFF, 0x55, -1].pack('cccccl_') + packet_id = id # This can be any positive integer and can be used to match responses with requests if desired. Need not be unique. + packet_type = type + packet_body = body + packet_empty_string = '' + packet = [packet_id, packet_type, packet_body, packet_empty_string] # Skip size for now + size = packet.pack(@@pack_string[1..]).length # Get packet size by packing what we have and checking length. + packet.unshift(size) + # log "Packet: " << packet.inspect + packed = packet.pack(@@pack_string) + # log "Packet: " << packet.inspect.utf8 unless hide_content + # log "Packed: " << packed.inspect.utf8 unless hide_content + packed + end + + def delete_socket(socket) + if socket.nil? + log "Tried to delete nil socket!", level: :warn + return + end + log "#{socket.remote_host.ljust(21)} Removing socket" + socket.close rescue nil + @sockets.delete @sockets.key(socket) + end + + def reopen_socket(socket) + ip, port, pass = socket.info + log "#{socket.remote_host.ljust(21)} Reopening socket", level: :warn unless socket.nil? + delete_socket socket unless socket.nil? + socket = get_socket_for_host ip, port, pass + socket + end + + def send_receive_wrapper(socket, packet, timeout=2, retries=1, sensitive: false) + log "#{socket.remote_host.ljust(21)} Attempting to gain mutex lock" + synchronize(socket.mutex) do + log "#{socket.remote_host.ljust(21)} Sucessfully gained mutex lock" + log "#{socket.remote_host.ljust(21)} Sending packet: #{sensitive ? 'REDACTED' : packet.inspect.utf8}" + response = send_receive(socket, packet, timeout, retries, sensitive: sensitive) + response.gsub!("\x00", '') if response.is_a? String # Int for auth + log "#{socket.remote_host.ljust(21)} Got response: #{response.inspect.utf8}" + log "#{socket.remote_host.ljust(21)} Ending mutex lock" + response + end + end + + def send_receive(socket, packet, timeout=3, retries=1, sensitive: false) + begin + socket.write packet + rescue Errno::EPIPE # broken pipe + log "#{socket.remote_host.ljust(21)} Broken pipe. Reopening socket.", level: :warn + socket = reopen_socket socket + socket.write packet + end + log "#{socket.remote_host.ljust(21)} Receiving response" + header, _ = if IO.select([socket], nil, nil, timeout) + socket.recv 12 + end + if header.to_s.empty? + # delete_socket socket + # raise "#{socket.remote_host.ljust(21)} Nil response for RCON." + # Unlike Insurgency: Sandstorm, some commands have a nil/empty header + # such as AddBluforBots/AddOpforBots. + return nil + end + log "#{socket.remote_host.ljust(21)} Header: #{header.inspect}" + size, id, type = header.unpack('l 0 + log "#{socket.remote_host.ljust(21)} No response; retrying" + return send_receive(socket, packet, timeout, retries - 1) + else + log "#{socket.remote_host.ljust(21)} No response; no retries remain" + # Reopen socket? Could harm server if this happens often. + raise NoTCPResponseError.new socket.remote_host + end + end + + log "#{socket.remote_host.ljust(21)} Read initial response: #{response.inspect}" + + # Ensure no paginated responses waiting + log "#{socket.remote_host.ljust(21)} Writing empty packet: #{@@empty_packet.inspect}" + socket.write @@empty_packet + additional_responses = false + loop do + additional_header, _ = if IO.select([socket], nil, nil, timeout) + socket.recv 12 + end + log "#{socket.remote_host.ljust(21)} Additional header: #{additional_header.inspect}" + break if additional_header.nil? + size, id, type = additional_header.unpack('l e + log "#{socket.remote_host.ljust(21)} Remote host closed/reset the connection. #{e.class}: #{e.message}", level: :warn + log "#{socket.remote_host.ljust(21)} Removing closed socket", level: :warn + delete_socket socket + raise e + end + + # User interface + def send(server_ip, port, password, command, buffer: nil, outcome_buffer: nil, no_rx: false, ignore_status: false, ignore_message: false, timeout: 2, retries: 1) + command.strip! + socket = get_socket_for_host server_ip, port, password + raise "Couldn't get socket for #{server_ip}:#{port}!" if socket.nil? + packet = build_packet command + if buffer + formatted_output = "#{datetime} | RCON #{server_ip}:#{port} (TX >>) #{command}" + buffer[:filters].each { |filter| filter.call(formatted_output) } + buffer.synchronize { buffer.push formatted_output } + end + response = send_receive_wrapper socket, packet, timeout, retries + if command == 'exit' + # The connection will be broken. Start fresh next time. + log "#{socket.remote_host.ljust(21)} Exit command detected. Deleting socket." + delete_socket socket + end + if buffer && !no_rx + buffer.synchronize do + formatted_output = "#{datetime} | RCON #{server_ip}:#{port} (RX <<) #{response}" + buffer[:filters].each { |filter| filter.call(formatted_output) } + buffer.push formatted_output + end + end + if outcome_buffer + outcome_buffer.synchronize do + outcome_buffer[:status] = true unless ignore_status + outcome_buffer[:message] = "RCON response received from [#{server_ip}:#{port}]." unless ignore_message + end + end + response + rescue => e + log "Error while sending RCON", e + if outcome_buffer + outcome_buffer.synchronize do + buffer[:status] = false unless ignore_status + buffer[:message] = e.message unless ignore_message + end + end + raise e + end + + def get_players_and_bots(server_ip, port, password, buffer: nil, ignore_status: false, ignore_message: false, timeout: 2, retries: 1) + resp = send(server_ip, port, password, 'status', buffer: buffer, ignore_status: ignore_status, ignore_message: ignore_message, timeout: timeout, retries: retries) + raise "#{server_ip}:#{port} Response was nil!" if resp.nil? + raise "#{server_ip}:#{port} Map is changing! (Invalid gamestate)" if resp.strip == "Invalid gamestate" + _, info, players_and_bots, _ = resp.split("\n========================================\n") + info = info.split("\n") + return [], [] if players_and_bots.nil? + players_and_bots = players_and_bots.split("\n") + players_and_bots.shift # Remove header row + players = [] + bots = [] + players_and_bots.each do |pb| + id, name_and_unique_id = pb.split("\t") + parts = name_and_unique_id.split(/\s+/) + unique_id = parts.pop + name = parts.join + is_invalid_entry = id.to_s.empty? || unique_id.to_s.empty? || name.to_s.empty? + throw "Invalid player or bot: #{pb}" if is_invalid_entry + pb = { + 'id' => id, + 'name' => name, + 'unique_id' => unique_id + } + if (unique_id === "BOT") + bots.push(pb) + else + players.push(pb) + end + end + return players, bots + end +end + +if __FILE__ == $0 + require 'pp' + require 'pry' + server_ip = ARGV[0] + port = ARGV[1] + password = ARGV[2] + client = RconClient.new + players, bots = client.get_players_and_bots(server_ip, port, password) + binding.pry +end diff --git a/admin-interface/lib/self-updater.rb b/admin-interface/lib/self-updater.rb new file mode 100644 index 0000000..54cd8ed --- /dev/null +++ b/admin-interface/lib/self-updater.rb @@ -0,0 +1,56 @@ +require 'fileutils' +require 'json' +require 'net/http' +require 'open-uri' +require 'pathname' +require 'zip' + +class SelfUpdater + UPDATE_ZIP = File.join WRAPPER_ROOT, 'update.zip' + IGNORE_FILES = [ + 'config/config.toml' + ] + + def self.download(url, path) + case io = URI.open(url) + when StringIO + File.open(path, 'w') { |f| f.write(io) } + when Tempfile + io.close + FileUtils.mv(io.path, path) + else + log "Unhandled IO type: #{io}", :warn + end + end + + def self.update_to_latest + log "Determining latest release" + releases = JSON.parse Net::HTTP.get(URI('https://api.github.com/repos/Joe-Klauza/ohd-admin-wrapper/releases')) + latest = releases.first + version = latest['name'] + zip_download_url = latest['zipball_url'] + log "Downloading #{version}: #{zip_download_url}" + + Dir.chdir WRAPPER_ROOT do + SelfUpdater.download(zip_download_url, UPDATE_ZIP) + log "Downloaded #{version} to update.zip" + log "Extracting update.zip" + Zip::File.open(UPDATE_ZIP) do |zip_file| + zip_file.each do |f| + filename = File.join Pathname(f.name).each_filename.to_a[1..] # Ignore project dir + filepath = File.join(WRAPPER_ROOT, filename) + next if IGNORE_FILES.include?(filename) + zip_file.extract(f, filepath) { true } # Overwrite + end + end + end + log "Extracted update.zip" + log "Deleting update.zip" + FileUtils.rm(UPDATE_ZIP) + log "Deleted update.zip" + version + rescue => e + log "Failed to update to latest", e + raise "Failed to update. (#{e.class}): #{e.message}" + end +end diff --git a/admin-interface/lib/server-monitor.rb b/admin-interface/lib/server-monitor.rb new file mode 100644 index 0000000..c41ea6b --- /dev/null +++ b/admin-interface/lib/server-monitor.rb @@ -0,0 +1,386 @@ +require 'benchmark' +# require 'geocoder' +require_relative 'logger' +require_relative 'rcon-client' +require_relative 'server-query' +require_relative 'steam-api-client' + +# Geocoder.configure(ip_lookup: :ipapi_com) # :ipinfo_io (default, 1,000/day) :ipapi_com (150/min) #:geoip2 (no actual lookup; not reliable) + +class ServerMonitor + attr_reader :info + attr_reader :name + attr_reader :ip + attr_reader :query_port + attr_reader :rcon_port + attr_reader :rcon_pass + attr_reader :rcon_buffer + + def initialize(ip, query_port, rcon_port, rcon_pass, interval: 15.0, delay: 5, rcon_fail_limit: 60, query_fail_limit: 30, name: '', rcon_buffer: nil, daemon_handle: nil, welcome_message_delay: 20) + @stop = false + @ip = ip + @query_port = query_port + @rcon_port = rcon_port + @rcon_pass = rcon_pass + @interval = interval + @rcon_fail_limit = rcon_fail_limit + @query_fail_limit = query_fail_limit + @name = name + @rcon_buffer = rcon_buffer + @rcon_buffer[:persistent] = true + @daemon_handle = daemon_handle + @steam_api_client = SteamApiClient.new(@daemon_handle.steam_api_key) unless @daemon_handle.nil? || @daemon_handle.steam_api_key.to_s.empty? + + @rcon_client = RconClient.new + @info = { + a2s_connection_problem: true, + rcon_connection_problem: true, + server_down: true, + rcon_players: [], + rcon_bots: nil, + rcon_last_success: Time.now.to_i, + a2s_info: nil, + a2s_player: nil, + a2s_rules: nil, + a2s_last_success: Time.now.to_i + } + @welcome_message_delay = welcome_message_delay + @host = "#{ip}:[#{query_port},#{rcon_port}]" + @thread = Thread.new do + if delay > 0 + log "Waiting #{delay} seconds to monitor" + sleep delay + end + @thread = monitor unless @stop + end + log "Initialized monitor" + end + + def [](thing) + @info[thing] + end + + def log(message, exception=nil, level: nil) + super("#{@host} Monitor | #{message}", exception, level: level) # Call the log function created by logger + end + + def get_uptime(original_start, now=Time.now.to_i) + seconds_lapsed = now - original_start + uptime = '' + hours = seconds_lapsed / (60 * 60) + minutes = (seconds_lapsed / 60) % 60 + seconds = seconds_lapsed % 60 + uptime << ("%d hours " % hours) if hours > 0 + uptime << ("%d minutes " % minutes) if hours > 0 || minutes > 0 + uptime << ("%d seconds" % seconds) + uptime + end + + def steam_duration_to_seconds(duration) + duration.split(':').map { |a| a.to_i }.inject(0) do |total, current| + total * 60 + current # Convert hours to minutes, add minutes, convert minutes to seconds, add seconds + end + end + + def seconds_to_steam_duration(seconds) + hours = seconds / (60 * 60) + minutes = (seconds / 60) % 60 + seconds = seconds % 60 + "%02d:%02d:%02d" % [hours, minutes, seconds] + end + + def time_ago(timestamp) + delta = Time.now.utc.to_i - timestamp.to_i + value, unit = case delta + when -1..45 then [nil, 'just now'] + when 46..60 then [nil, 'about a minute ago'] + when 61..3599 then [(delta / 60).round, 'minute'] + when 3600..86399 then [(delta / 3600.0), 'hour'] + when 86400..31535999 then [(delta / 86400.0), 'day'] + else [(delta / 31536000.0), 'year'] + end + if value.nil? + unit + else + if unit == 'minute' + "%d minute#{'s' if value > 1} ago" % value + else + "%.1f #{unit}#{'s' if ("%.1f" % value).to_f >= 1.1} ago" % value + end + end + end + + def process_rcon_players(rcon_players, prev_rcon_players) + return if [rcon_players, prev_rcon_players].any?(&:nil?) + players_gone = prev_rcon_players.reject { |prev| rcon_players.map { |current| current['unique_id'] }.include?(prev['unique_id']) } + players_joined = rcon_players.reject { |current| prev_rcon_players.map { |prev| prev['unique_id'] }.include?(current['unique_id']) } + + now = Time.now.to_i + # Look up players we haven't in the past 24 hours + if @daemon_handle && (@steam_api_client || !@daemon_handle.steam_api_key.empty?) + @steam_api_client = SteamApiClient.new(@daemon_handle.steam_api_key) if @steam_api_client.nil? + ids_to_query = rcon_players.select { |p| now - $config_handler.players.dig(p['unique_id'], 'last_steam_lookup').to_i > 60 * 60 * 24 }.map { |p| p['unique_id'] } + steam_users = @steam_api_client.get_info(ids_to_query) + steam_bans = @steam_api_client.get_bans(ids_to_query) + steam_users.each do |user| + next unless user['steamid'] + # Add their Steam data to the RCON player to merge into all players later + matching_player = rcon_players.select { |player| player['unique_id'] == user['steamid'] }.first + matching_player['steam_info'] = { + 'steamid' => user['steamid'], + 'name' => user['personaname'] || '', + 'created' => user['timecreated'].to_s || '', + 'avatar' => user['avatar'] || '', + 'avatar_medium' => user['avatarmedium'] || '', + 'avatar_full' => user['avatarfull'] || '', + 'persona_state' => user['personastate'] || '', + 'primary_clan_id' => user['primaryclanid'] || '', + 'community_visibility_state' => user['communityvisibilitystate'] || '', + 'last_logoff' => user['lastlogoff'] || '', + 'comment_permission' => user['commentpermission'] || '', + 'profile_url' => user['profileurl'] || '', + 'persona_state_flags' => user['personastateflags'] || '', + 'game_server_ip' => user['gameserverip'] || '', + 'game_server_unique_id' => user['gameserversteamid'] || '', + 'game_extra_info' => user['gameextrainfo'] || '', + 'game_id' => user['gameid'] || '' + } + ban_info = steam_bans.select { |u| u['SteamId'] == user['steamid'] }.first + matching_player['steam_info']['bans'] = { + 'community' => ban_info['CommunityBanned'], # Bool + 'vac' => ban_info['VACBanned'], # Bool + 'vac_number' => ban_info['NumberOfVACBans'].to_s, + 'days_since_last' => ban_info['DaysSinceLastBan'].to_s, + 'game_number' => ban_info['NumberOfGameBans'].to_s, + 'economy' => ban_info['EconomyBan'] # String + } + matching_player['last_steam_lookup'] = now + end + end + + # Welcome joined players + players_joined.each do |player| + if @daemon_handle + is_admin = @daemon_handle.is_ohd_admin?(player['unique_id']) + message_option = is_admin ? 'admin_join_message' : 'join_message' + unless @daemon_handle.config[message_option].empty? + Thread.new(message_option) do |message_option| + message = @daemon_handle.config[message_option] + message = message.gsub('${player_name}', player.dig('steam_info', 'name') || player['name']).gsub('${player_id}', player['unique_id'] || 'NULL') + sleep @welcome_message_delay # Allow time to select a loadout and see the chat + @rcon_client.send(@ip, @rcon_port, @rcon_pass, "say #{message}") + end + end + log "Player joined: #{player['name']} (#{player['unique_id']})#{' (admin)' if is_admin}", level: :info + else + log "Player joined: #{player['name']} (#{player['unique_id']})", level: :info + end + end + + # players_needing_ip_query = rcon_players.select do |p| + # now - $config_handler.players.dig(p['unique_id'], 'last_ip_lookup', p['ip']).to_i > 60 * 60 * 24 + # end + # players_needing_ip_query.each do |player| + # if LOCAL_IP_PREFIXES.any?{ |prefix| player['ip'].start_with?(prefix) } + # # The user is likely within the same network as the server, so use the external IP + # if @daemon_handle + # # Local server external IP + # ip = EXTERNAL_IP + # else + # # Remote monitor external IP + # ip = @ip.dup + # end + # next if ip.empty? + # else + # ip = player['ip'] + # end + # begin + # log "Looking up IP #{ip} for player #{player['name']} (#{player['unique_id']})" + # ip_info = Geocoder.search(ip).first || Geocoder.search(ip).first # Often fails on the first try with "Geocoding API's response was not valid JSON" + # if ip_info.nil? || !ip_info.respond_to?(:data) + # log "Couldn't find IP info for #{ip} for player #{player['name']} (#{player['unique_id']})" + # next + # end + # ip_info = ip_info.data + # log "Got info about IP #{ip} for player #{player['name']} (#{player['unique_id']}): #{ip_info}" + # $config_handler.players[player['unique_id']]['last_ip_lookup'] = {} if $config_handler.players[player['unique_id']]['last_ip_lookup'].nil? + # $config_handler.players[player['unique_id']]['ip_info'] = {} if $config_handler.players[player['unique_id']]['ip_info'].nil? + # $config_handler.players[player['unique_id']]['last_ip_lookup'][player['ip']] = now + # $config_handler.players[player['unique_id']]['ip_info'][player['ip']] = ip_info + # rescue => e + # log "Failed to look up IP #{player['ip']} (#{player['unique_id']})" + # end + # end + + # Merge the current data + rcon_players.map do |player| + if $config_handler.players[player['unique_id']].nil? + $config_handler.players[player['unique_id']] = player + else + $config_handler.players[player['unique_id']].merge!(player) # Merge the current data + player.merge!($config_handler.players[player['unique_id']]) # Merge back the Steam info in case we don't have it + end + player + end + + players_gone.each do |player| + if @daemon_handle + is_admin = @daemon_handle.is_ohd_admin?(player['unique_id']) + log "Player left: #{player['name']} (#{player['unique_id']})#{' (admin)' if is_admin}", level: :info + unless @daemon_handle.config['leave_message'].empty? + Thread.new do + message = @daemon_handle.config['leave_message'].gsub('${player_name}', player.dig('steam_info', 'name') || player['name']).gsub('${player_id}', player['unique_id'] || 'NULL') + @rcon_client.send(@ip, @rcon_port, @rcon_pass, "say #{message}") + end + end + end + saved_player = $config_handler.players[player['unique_id']] + score = player['score'].to_i + saved_player['total_score'] = saved_player['total_score'].to_i + score + saved_player['high_score'] = score if saved_player['high_score'].to_i <= score + saved_player['last_seen'] = now + saved_player['last_server'] = @info.dig(:a2s_info, 'name') || (@daemon_handle && @daemon_handle.name) + begin + matching_a2s_player = @info[:a2s_player].select { |p| p['name'] == player['name'] }.first + if matching_a2s_player.nil? && @info[:a2s_player].map { |p| p['name'].empty? }.size == 1 + # Sometimes A2S_PLAYER has one or more blank player names for a while (bug) + # If there's only one, we can assume that this is the player we're unable to match by name + matching_a2s_player = @info[:a2s_player].map { |p| p['name'].empty? }.first + end + duration_steam = matching_a2s_player['duration'] rescue nil + raise "Couldn't match by player name (#{player['name']}) to get duration. A2S_PLAYER: #{@info[:a2s_player]}" if duration_steam.nil? + duration_seconds = steam_duration_to_seconds(duration_steam) + (@interval / 2.0).floor # Assume they left ~halfway between the last check and now + saved_player['last_duration'] = seconds_to_steam_duration(duration_seconds) + saved_player['longest_duration'] = seconds_to_steam_duration(duration_seconds) if saved_player['longest_duration'].to_i <= duration_seconds + saved_player['total_duration'] = saved_player['total_duration'].to_i + duration_seconds + rescue => e + log "Failed to calculate duration_seconds for saved player info", e + end + saved_player['known_ips'] = saved_player['known_ips'].to_a.push(player['ip']).uniq + end + rescue => e + log "Error occurred during RCON player processing", e + end + + def do_rcon_query + rcon_players, rcon_bots = @rcon_client.get_players_and_bots(@ip, @rcon_port, @rcon_pass, buffer: @rcon_buffer, ignore_status: true, ignore_message: true) + process_rcon_players(rcon_players, @info[:rcon_players]) + log "Got RCON players: #{rcon_players}" + @info.merge!({ + rcon_connection_problem: false, + server_down: false, + rcon_players: rcon_players, + rcon_bots: rcon_bots, + rcon_last_success: Time.now.to_i + }) + rescue => e + if e.message.include?('Invalid gamestate') + log "Skipping RCON status parsing (map is changing)" + return + end + log "RCON query failed", e + @info[:rcon_connection_problem] = true + rcon_fail_time = Time.now.to_i - @info[:rcon_last_success] + log "Time since last RCON success: #{rcon_fail_time.to_s << 's'}", level: rcon_fail_time > @rcon_fail_limit ? :error : :warn + if rcon_fail_time > @rcon_fail_limit + @info[:server_down] = true + if @daemon_handle && @daemon_handle.frozen_config['hang_recovery'].to_s.casecmp('true').zero? + Thread.new do + log "Restarting server due to repeated RCON failure", level: :warn + response = @daemon_handle.do_restart_server + log "Daemon response: #{response}" + end + end + end + end + + def do_server_query + a2s_info = ServerQuery::a2s_info(@ip, @query_port) + log "Got A2S_INFO: #{a2s_info}" + a2s_player = ServerQuery::a2s_player(@ip, @query_port) + log "Got A2S_PLAYER: #{a2s_player}" + a2s_rules = ServerQuery::a2s_rules(@ip, @query_port) + log "Got A2S_RULES: #{a2s_rules}" + + prev_map = @info.dig(:a2s_info, 'map') + if a2s_info['map'] != prev_map + log "Map changed: #{prev_map} => #{a2s_info['map']}", level: :info + end + + # Sometimes the server can be in a zombie state where server query succeeds + # but nothing else works (including RCON); i.e. we shouldn't set server_down: false + # based on a successful server query response if RCON is reporting as working (but + # failure is more often indicative of an issue than RCON, which is more buggy) + @info.merge!({ + a2s_connection_problem: false, + a2s_info: a2s_info, + a2s_player: a2s_player, + a2s_rules: a2s_rules, + a2s_last_success: Time.now.to_i + }) + @info[:server_down] = @info[:rcon_connection_problem] + rescue => e + log "Server query failed", e + @info[:a2s_connection_problem] = true + query_fail_time = Time.now.to_i - @info[:a2s_last_success] + log "Time since last server query success: #{query_fail_time.to_s << 's'}", level: query_fail_time > @query_fail_limit ? :error : :warn + if query_fail_time > @query_fail_limit + @info[:server_down] = true + if @daemon_handle && @daemon_handle.frozen_config['query_recovery'].to_s.casecmp('true').zero? + Thread.new do + log "Restarting server due to repeated Server Query failure", level: :warn + response = @daemon_handle.do_restart_server + log "Daemon response: #{response}" + end + end + end + end + + def stop + @stop = true + @rcon_buffer[:status] = true + @rcon_buffer[:message] = "#{@host} Monitor stopped" + @thread.kill if @thread.respond_to?('kill') + end + + def all_green? + # RCON and Query successfully reached + !@info[:a2s_connection_problem] && !@info[:rcon_connection_problem] + end + + def monitor + return nil if @stop + Thread.new do + @rcon_buffer.reset + original_start = Time.now.to_i + loop do + lapsed = Benchmark.realtime do + begin + start = Time.now.to_i + log "Retrieving RCON players" + time_taken = Benchmark.realtime { do_rcon_query } + log "Took #{"%.3f" % time_taken}s (Retrieving RCON players)" + log "Retrieving Server Query info, players, and rules" + time_taken = Benchmark.realtime { do_server_query } + log "Took #{"%.3f" % time_taken}s (Retrieving Server Query info, players, and rules)" + rescue => e + log "error during monitoring!", e + break + end + end + log "Uptime: #{get_uptime(original_start)}" + sleep_seconds = [@interval - lapsed, 0.0].max # Ensure we don't try to sleep with a negative value + log "Server monitoring took #{"%.1f" % lapsed}s. Sleeping #{"%.1f" % sleep_seconds}s." + sleep sleep_seconds + if @stop + log "Stopping monitor" + next + end + end + rescue => e + log "Error while monitoring", e + ensure + log "Monitoring stopped." + end + end +end diff --git a/admin-interface/lib/server-query.rb b/admin-interface/lib/server-query.rb new file mode 100644 index 0000000..2081862 --- /dev/null +++ b/admin-interface/lib/server-query.rb @@ -0,0 +1,134 @@ +#!/usr/bin/env ruby + +require 'socket' +require_relative 'logger' +require_relative '../ext/string' + +# https://developer.valvesoftware.com/wiki/Server_queries +# https://apidock.com/ruby/Array/pack +# https://apidock.com/ruby/String/unpack + +class NoUDPResponseError < StandardError + def initialize(host=nil) + super "Could not read a UDP response from server#{host ? " #{host}" : '!'}" + end +end + +class ServerQuery + def self.send_recv_udp(packet, server_ip, server_port, socket_opts: 0, timeout: 2, retries: 1) + s = UDPSocket.new + s.send(packet, socket_opts, server_ip, server_port) + resp, from = if IO.select([s], nil, nil, timeout) + s.recvfrom(60000) + end + if resp.nil? + if retries > 0 + s.close + return send_recv_udp(packet, server_ip, server_port, socket_opts: socket_opts, timeout: timeout, retries: retries - 1) + else + raise NoUDPResponseError.new "#{server_ip}:#{server_port}" + end + end + return resp, from + ensure + s.close + end + + def self.a2s_info(server_ip, server_port = 27015) + # https://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO + a2s_info_header = 0x54 + content = "Source Engine Query\0" + packet = [0xFF, 0xFF, 0xFF, 0xFF, a2s_info_header, content].pack('c5Z*') + resp, _ = send_recv_udp(packet, server_ip, server_port) + log "[#{server_ip}:#{server_port} A2S_INFO response: #{resp.inspect}" + # "\xFF\xFF\xFF\xFFAH\x85]\xBF" + info = {} + log "[#{server_ip}:#{server_port} A2S_INFO parsed: #{info}" + info + rescue NoUDPResponseError => e + log "[#{server_ip}:#{server_port}] Couldn't get UDP response (#{e.class} raised)", level: :warn + raise + rescue => e + log "[#{server_ip}:#{server_port}] Rescued error while querying info", e, level: :warn + raise + end + + def self.a2s_player(server_ip, server_port = 27015) + # https://developer.valvesoftware.com/wiki/Server_queries#A2S_PLAYER + players = [] + packet = [0xFF, 0xFF, 0xFF, 0xFF, 0x55, -1].pack('cccccl_') + resp, _ = send_recv_udp(packet, server_ip, server_port) + if resp.unpack('xxxxcl').first == 65 # Challenge detected ('A' response); request again with given long + packet = [0xFF, 0xFF, 0xFF, 0xFF, 0x55, resp.unpack('xxxxcl').last].pack('cccccl') + resp, _ = send_recv_udp(packet, server_ip, server_port) + end + log "[#{server_ip}:#{server_port} A2S_PLAYER response: #{resp.inspect}" + resp = resp[6..] # Remove padding, header, player count + until resp.empty? + begin + pack_string = 'xZ*lf' + player_data = resp.unpack(pack_string) + resp = resp[player_data.pack(pack_string).length..] # Remove the read player info so we can iterate through the response (arbitrary length) + player_info = { + 'name' => player_data[0].to_s.utf8.strip, # Can be empty + 'score' => player_data[1], + 'duration' => Time.at(player_data[2]).utc.strftime("%H:%M:%S"), + } + players << player_info + rescue StandardError => e + log "[#{server_ip}:#{server_port}] Rescued error while iterating players", e + break + end + end + log "[#{server_ip}:#{server_port} A2S_PLAYER parsed: #{players}" + players + rescue NoUDPResponseError => e + log "[#{server_ip}:#{server_port}] Couldn't get UDP response (#{e.class} raised)", level: :warn + raise + rescue => e + log "[#{server_ip}:#{server_port}] Rescued error while querying players", e, level: :warn + raise + end + + def self.a2s_rules(server_ip, server_port = 27015) + # https://developer.valvesoftware.com/wiki/Server_queries#A2S_RULES + packet = [0xFF, 0xFF, 0xFF, 0xFF, 0x56, -1].pack('cccccl_') + resp, _ = send_recv_udp(packet, server_ip, server_port) + if resp.unpack('xxxxcl').first == 65 # Challenge detected ('A' response); request again with given long + packet = [0xFF, 0xFF, 0xFF, 0xFF, 0x56, resp.unpack('xxxxcl').last].pack('cccccl') + resp, _ = send_recv_udp(packet, server_ip, server_port) + end + log "[#{server_ip}:#{server_port} A2S_RULES response: #{resp.inspect}" + data = resp.unpack('xxxxxxxA*').first + rules = data.split("\x00").each_slice(2).to_h + raise "Unable to parse rules from response: #{resp.inspect}" unless rules.length > 1 + # {"Coop_b"=>"true", # For mutators this can incorrectly report as false after a player joins + # "GameMode_s"=>"Checkpoint", # For mutators this can incorrectly report as regular Checkpoint until a player joins + # "MatchServer_b"=>"false", + # "Mutated_b"=>"false", # For mutators this can incorrectly report as false until a player joins + # "OfficialRuleset_b"=>"false", + # "PlrC_i"=>"0", + # "PlrM_i"=>"8", + # "Pwd_b"=>"false", + # "RankedServer_b"=>"false", + # "S"=>"523", + # "Versus_b"=>"false"} + log "[#{server_ip}:#{server_port} A2S_RULES parsed: #{rules}" + rules + rescue NoUDPResponseError => e + log "[#{server_ip}:#{server_port}] Couldn't get UDP response (#{e.class} raised)", level: :warn + raise + rescue => e + log "[#{server_ip}:#{server_port}] Rescued error while querying rules: #{resp.inspect}", e, level: :warn + raise + end +end + +if __FILE__ == $0 + require 'pp' + # Parse ip/port from args. Allows 'ip:port' or 'ip' 'port' + ip, port = ARGV[1].nil? ? ARGV[0].split(':') : [ARGV[0], ARGV[1]] + pp ServerQuery::a2s_info(ip, port) + pp ServerQuery::a2s_rules(ip, port) + pp ServerQuery::a2s_player(ip, port) +end diff --git a/admin-interface/lib/server-updater.rb b/admin-interface/lib/server-updater.rb new file mode 100644 index 0000000..94522b1 --- /dev/null +++ b/admin-interface/lib/server-updater.rb @@ -0,0 +1,164 @@ +#!/usr/bin/env ruby + +require 'fileutils' +require 'open3' +require_relative 'subprocess' + +class ServerUpdater + attr_reader :update_available + attr_reader :thread + + def initialize(server_root_dir, steamcmd_path, steam_appinfovdf_path) + @server_root_dir = server_root_dir + @app_manifest = File.join server_root_dir, 'steamapps', 'appmanifest_950900.acf' + # raise Errno::ENOENT, @app_manifest unless File.exist? @app_manifest + @steamcmd_path = steamcmd_path + # raise Errno::ENOENT, @steamcmd_path unless File.exist? @steamcmd_path + @steam_appinfovdf_path = steam_appinfovdf_path + + @update_available = false + @installed_build_id = nil + @available_build_id = nil + Thread.new { update_available? } # Populate update availability (still pretty slow sometimes) + end + + def back_up_app_cache + FileUtils.mv(@steam_appinfovdf_path, @steam_appinfovdf_path + '.bak') if File.exist?(@steam_appinfovdf_path) + rescue => e + log "Error backing up app cache", e + end + + def restore_app_cache + FileUtils.cp(@steam_appinfovdf_path + '.bak', @steam_appinfovdf_path) if File.exist?(@steam_appinfovdf_path + '.bak') && !File.exist?(@steam_appinfovdf_path) + rescue => e + log "Error restoring app cache", e + end + + def get_update_info + return [@update_available, @installed_build_id, @available_build_id] + end + + def get_latest_build_id + back_up_app_cache + stdout, stderr, status = Open3.capture3(@steamcmd_path, + '+login anonymous', + '+app_info_print 950900', + '+exit' + ) + # Convert SteamCMD output to JSON for better traversal + output = stdout[stdout.index('"950900"')..stdout.index(/^\}$/)] + # Strip irrelevant characters, add colon separators for JSON + lines = output.gsub("\t", '').gsub('""', '":"').gsub(/"(\s*)\{/, '":\1{').split("\n") + # Add comma unless next line is an object start/end + converted = lines.each_with_index.map do |line, index| + # Don't add a comma to any line containing { or when {/} is on the following line + (line[/[{]/] || lines[index + 1].nil? || lines[index + 1][/[{}]/]) ? line : "#{line}," + end.join("\n") + json = JSON.parse "{#{converted}}" + build_id = json.dig('950900', 'depots', 'branches', 'public', 'buildid') + if build_id.nil? + log "Unable to get build ID from converted JSON. See log file for debug information.", level: :warn + log "SteamCMD STDOUT: #{stdout}\nSteamCMD STDERR: #{stderr}" + log "Converted JSON: #{json}" + return nil + end + log "Got latest build ID: #{build_id}" + @available_build_id = build_id + rescue => e + log "Rescued error while getting latest build ID. See log file for SteamCMD output", e + log "SteamCMD STDOUT: #{stdout}\nSteamCMD STDERR: #{stderr}" + nil + ensure + restore_app_cache + end + + def get_installed_build_id + open(@app_manifest) do |file| + build_id = file.grep(/buildid/).first + build_id = build_id[/\d+/] unless build_id.nil? + log "Got installed build ID: #{build_id}" + @installed_build_id = build_id + end + rescue => e + log "Rescued error while getting installed build ID", e + nil + end + + # Returns true if update is required, false otherwise (including when checks failed) + def update_available?(installed_build_id=get_installed_build_id, latest_build_id=get_latest_build_id) + if installed_build_id.nil? || latest_build_id.nil? + available = false + else + available = installed_build_id == latest_build_id ? false : true + end + log (available ? 'Update is available!' : 'Server is up-to-date!') + @update_available = available + end + + def run_steamcmd(command, buffer: nil, ignore_status: false, ignore_message: false) + command.unshift @steamcmd_path + thread = Thread.new do + # Start a thread so we can change the environment... + log "Running SteamCMD command: #{command}", level: :info + SubprocessRunner.run( + command, + buffer: buffer, + ignore_status: ignore_status, + ignore_message: ignore_message + ) + end + thread.join + output = if buffer.nil? + thread.value + else + buffer[:data].join("\n") + end + update_text = nil + updated = ['fully installed.', 'already up to date.'].any? do |it| + if output.include? it + update_text = it + update_text.prepend 'update ' if update_text.include? 'fully' + true + else + false + end + end + response = "Server #{updated ? update_text : 'failed to update!' }" + log response, level: updated ? :info : :error + if buffer + buffer.synchronize do + buffer[:status] = updated + buffer[:message] = response + end + end + [updated, response] + end + + # Returns true if an update was performed, false if already up-to-date + def update_server(buffer=nil, validate: nil, ignore_status: true, ignore_message: true) + log 'Updating server', level: :info + command = [ + '+login anonymous', + "+force_install_dir \"#{@server_root_dir}\"", + "+app_update 950900#{' validate' if validate}", + '+exit' + ] + updated, response = run_steamcmd(command, buffer: buffer, ignore_status: ignore_status, ignore_message: ignore_message) + update_available? + [updated, response] + end + + def monitor_update(minutes_between_checks: 3) + while true + begin + if update_available? + log 'A new server update is available!', level: :info + yield if block_given? + end + rescue => e + log "Rescued error during update check", e + end + sleep 60 * minutes_between_checks + end + end +end diff --git a/admin-interface/lib/steam-api-client.rb b/admin-interface/lib/steam-api-client.rb new file mode 100644 index 0000000..eda5e49 --- /dev/null +++ b/admin-interface/lib/steam-api-client.rb @@ -0,0 +1,48 @@ +# encoding: UTF-8 + +require 'json' +require 'net/http' + +class SteamApiClient + + def initialize(api_key, timeout: 4) + @api_key = api_key + @timeout = timeout + end + + def call_api(uri, timeout: @timeout) + uri = URI(uri) + Net::HTTP.start(uri.host, uri.port, read_timeout: timeout, open_timeout: timeout) do |http| + request = Net::HTTP::Get.new uri + http.request request + end.body + end + + def get(path, ids) + if ids.empty? + log "Skipping Steam check (no IDs provided)" + return {} + end + log "Getting Steam #{path.include?('GetPlayerBans') ? 'bans' : 'info'} for IDs: #{ids.join(', ')}" + raw_response = call_api "http://api.steampowered.com/#{path}?key=#{@api_key}&steamids=#{ids.join(',')}" + JSON.parse raw_response + rescue => e + if e.is_a?(JSON::ParserError) && raw_response.include?('429 Too Many Requests') + log "Failed to get ban information; too many Steam requests. (IDs: #{ids})", level: :warn + else + log "Failed to get ban information for ID(s) #{ids}: #{raw_response}", e + end + {} + end + + def get_info(ids) + path = "ISteamUser/GetPlayerSummaries/v0002/" + get(path, ids).dig('response', 'players') || [] + end + + def get_bans(ids) + path = "ISteamUser/GetPlayerBans/v1/" + get(path, ids).dig('players') || [] + end + +end diff --git a/admin-interface/lib/subprocess.rb b/admin-interface/lib/subprocess.rb new file mode 100644 index 0000000..ae09ca4 --- /dev/null +++ b/admin-interface/lib/subprocess.rb @@ -0,0 +1,92 @@ +# PTY doesn't work on windows, but on Linux it gets us concurrent progress output from steamcmd since steamcmd detects shell interactivity for this +# https://github.com/ValveSoftware/Source-1-Games/issues/1684 +PTY_AVAILABLE = WINDOWS ? false : (require 'pty') +require_relative 'logger' + +class SubprocessRunner + def self.run_via_pty(command) + read, write, pid = PTY.spawn(*command) + return [pid, read, nil, write] + end + + def self.run_via_process(command, out, err, input=nil) + opts = { + out: out, + err: err, + in: input + }.reject { |_, v| v.nil? } + pid = Process.spawn(*command, opts) + end + + def self.run(command, buffer: nil, ignore_status: false, ignore_message: false, out: IO.pipe, err: IO.pipe, input: nil, shell: [], pty: PTY_AVAILABLE, no_prefix: false, formatter: nil) + origin = File.basename command.first + origin = "#{File.basename shell.first}(#{origin})" unless shell.empty? + command = command.split(' ') unless command.is_a? Array + + log "Running subprocess via (#{pty ? 'PTY' : 'Process'}): #{command}" + command = shell.concat command + + pid, stdout, stderr, stdin = if pty + [out, err, input].each { |pipe| pipe.close if pipe.respond_to?('close') } + run_via_pty(command) + else + pid = run_via_process(command, out.last, err.last, input) + [pid, out.first, err.first] + end + yield(pid) if block_given? + captured_output = [] + [stdout, stderr].reject(&:nil?).each do |stream| + Thread.new do + loop do + output = stream.gets.utf8 + break if output.nil? + formatted_output = if formatter + formatter.call(output, origin) + else + no_prefix ? output.chomp : "#{datetime} | #{origin} | #{output.chomp}" + end + if buffer.nil? + captured_output.push output + else + buffer[:filters].each { |filter| filter.call(formatted_output) } + buffer[:mutex].synchronize do # Synchronize with the reading thread to avoid mismatched indices when truncating, etc. + buffer.push formatted_output + end + end + log formatted_output # Ensure this is after filters to avoid NWI's lack of color code resets + rescue Errno::EIO, IOError, EOFError => e + break + end + end + end + pid, process_status = Process.wait2(pid) + + log "Checking exit status" + status, message = if process_status.exitstatus + [process_status.exitstatus.zero? ? true : false, "PID (#{pid}) #{process_status.exitstatus.zero? ? 'completed successfully' : 'exited unsuccessfully'} (#{process_status.exitstatus})."] + else + if process_status.signaled? + signal = process_status.termsig || process_status.stopsig + [true, "PID (#{pid}) stopped with signal #{Signal.list.key signal} (#{signal})."] + else + [false, "PID (#{pid}) stopped for an unknown reason."] + end + end + + log "Exit status/message: #{status} - #{message}" + + if buffer.nil? + captured_output.join("\n") + else + buffer.synchronize do + buffer[:status] = status unless ignore_status + buffer[:message] = message unless ignore_message + end + end + rescue => e + log "Error running subprocess: #{command}", e + raise e + ensure + [out.first, out.last, err.first, err.last, input, stdout, stderr, stdin].each { |pipe| pipe.close if pipe.respond_to?('close') } + end +end diff --git a/admin-interface/lib/user.rb b/admin-interface/lib/user.rb new file mode 100644 index 0000000..5eaaa91 --- /dev/null +++ b/admin-interface/lib/user.rb @@ -0,0 +1,61 @@ +require 'bcrypt' +require 'sysrandom' + +class User + attr_accessor :name + attr_reader :role + attr_reader :id + attr_reader :initial_password + + ROLES = { + host: 4, + admin: 3, + moderator: 2, + user: 1 + } + + def initialize(name, role, password: nil, initial_password: nil, id: nil) + @name = name # Name will also be our GUID, since having duplicate user names is confusing without emails + @role = role + @initial_password = initial_password + @id = id || Sysrandom.uuid + if password + # User info is being read from file + @password = BCrypt::Password.new(password).to_s + else + generate_initial_password + end + end + + def first_login? + return false if @initial_password.nil? + password_matches?(@initial_password) + end + + def generate_initial_password + @initial_password = ConfigHandler.generate_password + @password = BCrypt::Password.create(@initial_password).to_s + end + + def password # So we can user.password == 'password' + BCrypt::Password.new(@password) + end + + def password=(new_password) + @initial_password = nil + @password = BCrypt::Password.create(new_password).to_s + end + + def password_matches?(password) + BCrypt::Password.new(@password) == password + end + + def role=(new_role) + new_role = new_role.to_sym + if ROLES.include? new_role + @role = new_role + else + raise "Failed to assign role: #{new_role} is not a valid role!" + end + end +end diff --git a/admin-interface/lib/webapp.rb b/admin-interface/lib/webapp.rb new file mode 100644 index 0000000..ebc8c91 --- /dev/null +++ b/admin-interface/lib/webapp.rb @@ -0,0 +1,1381 @@ +WINDOWS = Gem.win_platform? + +require 'pry' +require 'cgi' +require 'net/http' +require 'openssl' +require 'sinatra/base' +require 'socket' +require 'sys/proctable' +require 'sysrandom' +require 'toml-rb' +require 'webrick' +require 'webrick/https' +require_relative '../ext/thread' +require_relative 'logger' +require_relative 'buffer' +require_relative 'certificate-generator' +require_relative 'daemon' +require_relative 'config-handler' +require_relative 'user' +require_relative 'rcon-client' +require_relative 'self-updater' +require_relative 'server-updater' + +Encoding.default_external = "UTF-8" +LOGGER.threshold :info # Changes STDOUT only +log "Loading config" +$config_handler = ConfigHandler.new + +class AdminWrapperSite < Sinatra::Base + def self.set_up + log "Initializing webserver" + @@config = load_webapp_config + @@daemons = {} + @@daemons_mutex = Mutex.new + @@monitors = {} + @@buffers = {} + @@buffer_mutex = Mutex.new + @@wrapper_user_log = create_buffer.last + @@wrapper_connection_log = create_buffer.last + @@rcon_client = RconClient.new + @@server_updater = ServerUpdater.new(SERVER_ROOT, STEAMCMD_EXE, STEAM_APPINFO_VDF) + @@update_thread = nil + @@prereqs_complete = false + @@lan_access_bind_ip = Socket.ip_address_list.detect{ |intf| intf.ipv4_private? }.ip_address rescue '?' + @@loaded_wrapper_version = @@config['wrapper_version'] + trap 'EXIT' do + Thread.new do + if @@daemons.any? + log "Stopping daemons", level: :info + @@daemons.each { |_, daemon| daemon.implode } + end + end.join + end + handle_arguments unless ARGV.empty? + end + + def self.load_webapp_config + FileUtils.cp(WEBAPP_CONFIG_SAMPLE, WEBAPP_CONFIG) unless File.exist?(WEBAPP_CONFIG) + log "Loading wrapper config from #{File.basename WEBAPP_CONFIG}" + config = TomlRB.load_file WEBAPP_CONFIG + config['automatic_updates'] = true if config['automatic_updates'].nil? + config['steam_api_key'] = '' if config['steam_api_key'].nil? + config + rescue => e + log "Couldn't load config from #{config_file}", e + raise + end + + def self.save_webapp_config(config, config_file = WEBAPP_CONFIG) + log "Saving wrapper config" + File.write(config_file, TomlRB.dump(config)) + end + + def self.handle_arguments + args = ARGV.dup + while true + arg = args.shift + break if arg.nil? + case arg + when '--start', '-s' + config_name_or_id = args.shift + break if config_name_or_id.nil? + @@daemons_mutex.synchronize do + Thread.new(config_name_or_id) do |config_name_or_id| + config = $config_handler.server_configs.values.select{|conf| conf['id'] == config_name_or_id || conf['server-config-name'] == config_name_or_id }.first.dup rescue nil + sleep 2 # Allow webrick SSL cert to be logged before starting servers + if config + log "Starting daemon for #{config_name_or_id}", level: :info + init_daemon(config, start: true) + else + log "Unknown server config name/ID: #{config_name_or_id}", level: :warn + end + end + end + when '--log-level', '-l' + val = args.shift.to_s.upcase.to_sym + if Logger::Severity.constants.include? val + log "Setting STDOUT logger threshold to #{val}", level: :info + LOGGER.threshold val + else + log "Unknown log level: #{val}. Try one of these: #{Logger::Severity.constants.map(&:to_s).join(', ')}", level: :warn + end + else + log "Unknown argument: #{arg}", level: :warn + end + end + end + + def self.init_daemon(config, start: false) + id = config['id'] + @@daemons_mutex.synchronize do + if @@daemons[id] + log "Daemon with config ID #{id} already exists", level: :info + else + log "Initializing daemon with config ID #{id}", level: :info + @@daemons[id] = ServerDaemon.new( + config, + @@daemons, + @@daemons_mutex, + @@rcon_client, + create_buffer.last, # Server log + create_buffer.last, # RCON + create_buffer.last, # Chat + steam_api_key: @@config['steam_api_key'] + ) + end + end + @@daemons[id].do_start_server if start + @@daemons[id] + end + + def self.create_buffer(uuid=nil) + @@buffer_mutex.synchronize do + return [uuid, @@buffers[uuid]] unless @@buffers[uuid].nil? + uuid = Sysrandom.uuid if uuid.nil? + buffer = Buffer.new(uuid) + @@buffers[uuid] = buffer + [uuid, buffer] + end + end + + # def which(command) + # exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] + # ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| + # exts.each do |ext| + # exe = File.join(path, "#{command}#{ext}") + # return exe if File.executable?(exe) && !File.directory?(exe) + # end + # end + # nil + # end + + def steamcmd_installed? + # on_path = WINDOWS ? which("steamcmd.exe") : (which("steamcmd") || which("steamcmd.sh")) + # return on_path unless on_path.nil? + STEAMCMD_EXE if File.exist? STEAMCMD_EXE + end + + def game_server_installed? + BINARY if File.exist? BINARY + end + + def get_server_status(config_id) + daemon = @@daemons[config_id] + return 'OFF' if daemon.nil? + daemon.server_running? ? 'ON' : 'OFF' + end + + def get_update_status + return 'OFF' if @@update_thread.nil? + @@update_thread.alive? ? 'ON' : 'OFF' + end + + def check_prereqs + steamcmd_path = steamcmd_installed? + game_server_path = game_server_installed? + @@prereqs_complete = steamcmd_path && game_server_path + @@update_thread = get_game_update_thread if @@prereqs_complete && @@update_thread.nil? && @@config['automatic_updates'] + return [steamcmd_path, game_server_path] + end + + def get_update_info + @@server_updater.get_update_info + end + + def install_server(buffer=nil, validate: nil) + log "Installing server..." + success, message = @@server_updater.update_server(buffer, validate: validate) + message + end + + def update_server(buffer=nil, validate: nil) + was_running = [] + if WINDOWS + @@daemons.each do |id, daemon| + if daemon.server_running? + daemon.do_pre_update_warning + daemon.do_stop_server + was_running << id + end + end + end + success, message = @@server_updater.update_server(buffer, validate: validate) + @update_pending = !success + @@daemons.each do |id, daemon| + if WINDOWS + next unless was_running.include?(id) + daemon.do_start_server + else + next unless daemon.server_running? + daemon.do_pre_update_warning + daemon.do_restart_server + end + end + message + end + + def run_steamcmd(command, buffer: nil) + @@server_updater.run_steamcmd(command, buffer: buffer) + end + + def get_game_update_thread + Thread.new do + begin + @@server_updater.monitor_update do + update_server if @@config['automatic_updates'] + end + rescue => e + log "Game update thread failed", e + end + end + end + + def start_updates + if @@update_thread + log "Restarting updates", level: :info + @@update_thread.kill + @@update_thread = get_game_update_thread + "Automated updates restarted" + else + log "Starting updates", level: :info + @@update_thread = get_game_update_thread + "Automated updates started" + end + end + + def stop_updates + if @@update_thread + log "Stopping updates", level: :info + @@update_thread.kill + @@update_thread = nil + "Automated updates stopped" + else + "Automated updates not running" + end + end + + def zip_files(zip_path, glob) + log "Zipping logs from #{glob} into #{zip_path.sub(USER_HOME, '~')}" + files_to_zip = Dir.glob(glob).map { |f| File.expand_path f } + Zip::File.open(zip_path, Zip::File::CREATE) do |zipfile| + files_to_zip.each do |f| + log "Zipping #{f.sub(USER_HOME, '~')}" + zipfile.add(File.basename(f), f) + end + end + end + + def get_rcon_info(id: nil) + if @@daemons[id] + ['127.0.0.1', @@daemons[id].active_rcon_port, @@daemons[id].active_rcon_pass] + elsif @@monitors[id] + [@@monitors[id].ip, @@monitors[id].rcon_port, @@monitors[id].rcon_pass] + else + nil + end + end + + set_up + + configure do + working_directory = File.expand_path File.join File.dirname(__FILE__), '..', 'docroot' + log "Setting webserver root dir to: #{working_directory.sub(USER_HOME, '~')}", level: :info + set :root, working_directory + enable :sessions, :dump_errors #, :raise_errors, :show_exceptions #, :logging + set :raise_errors, false + set :show_exceptions, false + set :session_secret, @@config['admin_interface_session_secret'] unless @@config['admin_interface_session_secret'].empty? + end + + # Add a condition that we can use for various routes + register do + def auth(role) + condition do + begin + unless has_role?(role) + message = "IP: #{request.ip} | User unauthorized: #{"'#{@user.name}' [#{@user.role}] (#{session[:user_id]})" rescue '[logged out]'} requesting #{role}-privileged content: #{request.path_info}" + @@wrapper_user_log << "#{datetime} | #{message}" + log message, level: :warn + status 403 + redirect "/login#{CGI.escape(request.path_info) unless request.path_info.casecmp('/').zero?}" if request.request_method == 'GET' + error = "403 Unauthorized - You don't have permission to do this." + redirect "/error?status=403&message=#{CGI.escape error}" + false + end + rescue => e + log "#{request.ip} | Error checking auth status for role: #{role}", e + status 500 + redirect "/login/#{CGI.escape(request.path_info) unless request.path_info.casecmp('/').zero?}" if request.request_method == 'GET' + error = "500 Error - Unknown role: #{role}" + redirect "/error?status=500&message=#{CGI.escape error}" + false + end + end + end + end + + # Add helper functions for user authentication, etc. + helpers do + def logged_in? + !@user.nil? + end + + def has_role?(role) + raise "Invalid role: #{role}" unless User::ROLES.keys.include?(role) + logged_in? && User::ROLES[@user.role] >= User::ROLES[role] + end + + def is_host? + has_role?(:host) + end + + def is_admin? + has_role?(:admin) + end + + def is_moderator? + has_role?(:moderator) + end + + def is_user? + has_role?(:user) + end + + def get_active_config + # log "Getting active server config using ID #{session[:active_server_config]}", level: :fatal + if $config_handler.server_configs.empty? + $config_handler.add_server_config(get_default_config) + end + # binding.pry + active_config = $config_handler.server_configs.select { |id, _| id == session[:active_server_config] }.to_h.values.first || $config_handler.server_configs.values.last + # log "Got active server config with name #{active_config['server-config-name']} (ID: #{active_config['id']})", level: :fatal + active_config + end + + def get_config(config_id) + halt 400, 'Invalid config ID format' unless config_id.to_s.is_uuid? + config = $config_handler.server_configs[config_id] + halt 400, "Unable to find config for ID #{config_id}" if config.nil? + config + end + + def redirect_to_config(config_id, path) + if config_id && config_id.is_uuid? && $config_handler.server_configs.keys.include?(config_id) + session[:active_server_config] = config_id + else + config_id = session[:active_server_config] + if config_id && config_id.is_uuid? && $config_handler.server_configs.keys.include?(config_id) + redirect "#{path}?config-id=#{session[:active_server_config]}" + else + session[:active_server_config] = nil + end + end + end + end + + error do + e = env['sinatra.error'] + log "#{request.ip} | Error occurred in route #{request.path}", e + if is_host? + "An error occurred (#{CGI.escapeHTML(e.class.to_s)}). Only hosts can see the following message and backtrace: #{CGI.escapeHTML(e.message)} | Backtrace:
#{e.backtrace.map{|l| CGI.escapeHTML(l.gsub(USER_HOME, '~')) }.join('
')}" + else + CGI.escapeHTML "An error occurred (#{e.class.to_s}). Please view the logs or contact the maintainer." + end + end + + before do + env['rack.logger'] = LOGGER + env['rack.errors'] = LOGGER + @user = $config_handler.users[session[:user_id]] if session[:user_id] + check_prereqs unless @@prereqs_complete + request.body.rewind + # body = request.body.read + # request.body.rewind # Be kind + timestamp = datetime + message = "IP: #{request.ip} | #{"User: #{@user.name} | " if @user}Request: #{request.request_method}#{' ' << request.script_name unless request.script_name.strip.empty? } #{request.path_info}#{'?' << request.query_string unless request.query_string.strip.empty?}" # #{(' | Body: ' << body) unless body.strip.empty?}" + log message + @@wrapper_user_log.push "#{timestamp} | #{message}" if request.request_method != 'GET' + @@wrapper_connection_log.push "#{timestamp} | #{message} | Agent: #{request.user_agent}" + nil + end + + # after do + # log "Responding: #{response.body}" + # end + + %i(get post put).each do |method| + send method, '/error' do + status params['status'] + params['message'] + end + end + + get '/confirm' do + @yes = CGI.unescape params[:yes] + @no = CGI.unescape params[:no] + @title = CGI.unescape params[:title] + @body = CGI.unescape params[:body] + @input_label = CGI.unescape params[:input_label] + erb :confirm + end + + get %r{/login(/)?(.*)} do + @destination = '/' + params['captures'].last.sub('login', '') + @destination = nil if @destination == '/' + erb :login + end + + post '/login' do + data = Oj.load(request.body.read) + request.body.rewind + user = data['user'] + password = data['pass'] + destination = data['destination'] + if user && password + known_user = $config_handler.users.values.select { |u| u.name == user }.first + if known_user && known_user.password == password # BCrypt::Password == string comparison + message = "IP: #{request.ip} | #{known_user.name} [#{known_user.role}] logged in (#{known_user.id})" + log message, level: :info + @@wrapper_user_log << "#{datetime} | #{message}" + session[:user_id] = known_user.id + return known_user.first_login? ? "/change-password#{destination}" : destination + end + end + status 401 + "Failed to log in." + end + + get '/logout' do + user = $config_handler.users[session[:user_id]] + halt 400, 'Not logged in' if user.nil? + message = "IP: #{request.ip} | #{user.name} [#{user.role}] logged out (#{user.id})" + log message, level: :info + @@wrapper_user_log << "#{datetime} | #{message}" + session[:user_id] = nil + redirect '/login' + end + + get '/status', auth: :user do + @daemons = @@daemons + @monitors = @@monitors + erb :'server-status', layout: :'layout-main' do + erb :'server-list' + end + end + + get '/server-list', auth: :user do + @daemons = @@daemons + @monitors = @@monitors + erb :'server-list' + end + + get '/server-daemons', auth: :admin do + @daemons = @@daemons + erb :'server-daemons', layout: :'layout-main' + end + + get '/change-password(/:destination)?', auth: :user do + @destination = "/#{params['destination']}".sub('/change-password', '') + @first_login = !@user.initial_password.nil? + erb :'change-password', layout: :'layout-main' + end + + post '/change-password', auth: :user do + data = Oj.load(request.body.read) + request.body.rewind + password = data['pass'] + destination = "#{data['destination']}" + if password.strip.empty? || @user.password_matches?(password) + status 400 + return "Invalid password. The password must be new and not blank!" + end + @user.password = password + $config_handler.write_user_config + destination + end + + get '/wrapper-log', auth: :host do + @user_log_id = @@wrapper_user_log[:uuid] + @conn_log_id = @@wrapper_connection_log[:uuid] + erb :'wrapper-log', layout: :'layout-main' + end + + get '/wrapper-config', auth: :host do + @config = @@config + @lan_access_bind_ip = @@lan_access_bind_ip + @wrapper_version = @@loaded_wrapper_version + erb :'wrapper-config', layout: :'layout-main' + end + + put '/wrapper-config/:action', auth: :host do + wrapper_config = @@config + variable = params['variable'] + value = params['value'] + value = value == 'true' if ['true', 'false'].include?(value) + if params['action'] == 'set' + begin + if wrapper_config.keys.include?(variable) + sensitive = ['admin_interface_session_secret', 'steam_api_key'].include? variable + old = sensitive ? '[REDACTED]' : wrapper_config[variable] + wrapper_config[variable] = value + value = sensitive ? '[REDACTED]' : wrapper_config[variable] + self.class.save_webapp_config(wrapper_config) + @@daemons.values.each { |d| d.steam_api_key = wrapper_config[variable] } if variable == 'steam_api_key' + "Changed #{variable}: #{old} => #{value}" + else + status 400 + msg + end + rescue => e + msg = "Failed to set #{variable + ' -> ' + variable == 'admin_interface_session_secret' ? '[REDACTED]' : value}" + log msg, e + status 400 + "#{msg} | #{e.class}: #{e.message}" + end + elsif params['action'] == 'get' + value = wrapper_config[variable] + if value.nil? + status 404 + "Could not find value for #{variable}" + else + value.to_s + end + else + status 400 + 'Unknown action' + end + end + + get '/wrapper-users-list', auth: :host do + @users = $config_handler.users + erb :'wrapper-users-list' + end + + get '/wrapper-users', auth: :host do + @users = $config_handler.users + erb :'wrapper-users', layout: :'layout-main' do + erb :'wrapper-users-list' + end + end + + post '/wrapper-users/:action', auth: :host do + action = params['action'] + data = Oj.load(request.body.read) + request.body.rewind + id = data['id'] + name = data['name'] + role = data['role'].to_s.downcase.to_sym + + case action + when 'create' + if name.to_s.empty? || role.to_s.empty? + status 400 + 'Missing name/role' + elsif $config_handler.users.values.select { |u| u.name == name }.size > 0 + status 400 + 'A user with that name already exists' + else + user = User.new(name, role) + $config_handler.users[user.id] = user + $config_handler.write_user_config + 'User created' + end + when 'delete' + if id.to_s.empty? + status 400 + 'Missing ID' + elsif $config_handler.users[id].nil? + status 400 + 'No such user' + elsif $config_handler.users[id].role == :host && $config_handler.users.values.select { |u| u.role == :host }.size == 1 + status 400 + 'Cannot delete last Host' + else + $config_handler.users.delete id + $config_handler.write_user_config + 'User deleted' + end + when 'save' + if name.to_s.empty? || role.to_s.empty? + status 400 + 'Missing name/role' + elsif $config_handler.users[id].nil? + status 400 + 'No such user' + elsif !User::ROLES.keys.include?(role) + status 400 + 'No such role' + elsif role != :host && $config_handler.users[id].role == :host && $config_handler.users.values.select { |u| u.role == :host }.size == 1 + status 400 + 'Cannot change role of last Host' + else + user = $config_handler.users[id] + if user.name == name && user.role == role + status 400 + 'Nothing was changed' + else + user.name = name + user.role = role + $config_handler.write_user_config + 'User saved' + end + end + else + status 400 + 'Unknown action' + end + end + + get '/pry', auth: :host do + @buffers = @@buffers + prev_threshold = LOGGER.threshold + Thread.new do + LOGGER.threshold :fatal # Turn down STDOUT logging + `stty echo` unless WINDOWS || !$stdout.isatty # Ensure we have echoing enabled; something from logging turns it off... + + # Stuff + + binding.pry + ensure + `stty echo` unless WINDOWS || !$stdout.isatty + LOGGER.threshold prev_threshold + end.join + nil + rescue Interrupt + end + + get '/threads/:id', auth: :user do + daemon = @@daemons[params[:id]] + @pid = daemon.game_pid if daemon + process = Sys::ProcTable.ps(pid: @pid) if @pid + threads = (WINDOWS ? process.thread_count : process.nlwp) if process + @threads = threads || 0 + monitor = daemon.monitor rescue nil + @info = monitor.info rescue nil + erb :threads + end + + get '/players/:id', auth: :user do + daemon = @@daemons[params[:id]] + @monitor = daemon.monitor rescue @@monitors[params[:id]] + @info = @monitor.info rescue nil + erb :'players' + end + + get '/update-info', auth: :user do + @update_available, @old_build, @new_build = get_update_info + erb(:'update-info') + end + + post '/restart-wrapper', auth: :host do + @@daemons.each { |_, daemon| daemon.do_stop_server } + ENV['HOME'] = USER_HOME + # Exit with a particular code, to be handled by the start script + at_exit do + exit 2 + end + log "Restart invoked", level: :info + Thread.new do + log "Replacing the current process...", level: :info + sleep 0.2 + exit + end + '' + end + + post '/update-wrapper', auth: :host do + version = SelfUpdater.update_to_latest + @@config['wrapper_version'] = version + self.class.save_webapp_config @@config + "Updated to #{version}! Restart the wrapper to apply." + rescue => e + status 500 + e.message + end + + get '/', auth: :user do + @steamcmd_path, @game_server_path = check_prereqs + if is_admin? + redirect '/setup' unless @steamcmd_path && @game_server_path + redirect '/control' + else + redirect '/status' + end + end + + get '/about', auth: :user do + erb(:about, layout: :'layout-main') + end + + get '/setup', auth: :admin do + @steamcmd_path, @game_server_path = check_prereqs + @automatic_updates = @@config['automatic_updates'] + erb(:'server-setup', layout: :'layout-main') + end + + get '/maplist', auth: :admin do + @config = get_config(params['config-id']) + config_id = @config['id'] # Needed in ERB binding + erb(:maplist) + end + + get '/config', auth: :admin do + redirect '/setup' unless @@prereqs_complete + config_id = params['config-id'] + redirect_to_config(config_id, '/config') + active_config = get_active_config + # We _should_ always have a config, as config_handler should ensure that at least the Default config exists at all times + @config = $config_handler.server_configs[active_config['id']] || $config_handler.server_configs.values.last + unless @config + status 400 + return "Unable to find config" + end + config_id = @config['id'] + $config_handler.init_server_config_files config_id + @game_ini = File.read ERB.new(CONFIG_FILES[:game_ini][:local_erb]).result(binding) + @engine_ini = File.read ERB.new(CONFIG_FILES[:engine_ini][:local_erb]).result(binding) + @game_user_settings_ini = File.read ERB.new(CONFIG_FILES[:game_user_settings_ini][:local_erb]).result(binding) + @admins_cfg = File.read ERB.new(CONFIG_FILES[:admins_cfg][:local_erb]).result(binding) + @mapcycle_cfg = File.read ERB.new(CONFIG_FILES[:mapcycle_cfg][:local_erb]).result(binding) + @bans_cfg = File.read ERB.new(CONFIG_FILES[:bans_cfg][:local_erb]).result(binding) + @motd_txt = File.read ERB.new(CONFIG_FILES[:motd_txt][:local_erb]).result(binding) + @notes_txt = File.read ERB.new(CONFIG_FILES[:notes_txt][:local_erb]).result(binding) + erb(:'server-config', layout: :'layout-main') + end + + get '/control', auth: :admin do + redirect '/setup' unless @@prereqs_complete + config_id = params['config-id'] + redirect_to_config(config_id, '/control') + @config = get_active_config + @config_id = @config['id'] + daemon = @@daemons[@config_id] + if daemon + @config = daemon.frozen_config + end + @game_port = daemon.server_running? ? daemon.active_game_port : @config['server_game_port'] rescue @config['server_game_port'] + @rcon_port = daemon.server_running? ? daemon.active_rcon_port : @config['server_rcon_port'] rescue @config['server_rcon_port'] + @query_port = daemon.server_running? ? daemon.active_query_port : @config['server_query_port'] rescue @config['server_query_port'] + @server_status = get_server_status(@config_id) + @pid = daemon.game_pid if daemon + process = Sys::ProcTable.ps(pid: @pid) if @pid + threads = (WINDOWS ? process.thread_count : process.nlwp) if process + @threads = threads || 0 + @monitor = daemon.monitor rescue nil + @info = @monitor.info rescue nil + erb(:'server-control', layout: :'layout-main') + end + + get '/tools/:resource', auth: :admin do + @config = get_active_config + resource = params['resource'] + case resource + when 'rcon' + erb(:'rcon-tool', layout: :'layout-main') + when 'steamcmd' + redirect '/setup' unless steamcmd_installed? + @server_root_dir = SERVER_ROOT + erb(:'steamcmd-tool', layout: :'layout-main') + when 'monitor' + config = $config_handler.monitor_configs.first + @name, @config = config ? config : [@config['server-config-name'], @config] + erb(:'monitor-tool', layout: :'layout-main') + else + status 500 + "Unknown resource: #{resource}" + end + end + + post '/tools/:resource', auth: :admin do + resource = params['resource'] + body = request.body.read + options = Oj.load body, symbol_keys: true + request.body.rewind + case resource + when 'steamcmd' + uuid, buffer = self.class.create_buffer + Thread.new { run_steamcmd(options[:command].split("\n"), buffer: buffer) } + uuid + else + status 400 + "Unknown resource: #{resource}" + end + end + + get '/server-control-status' do + @config = get_active_config + @id = @config['id'] + daemon = @@daemons[@id] + if daemon + @config = daemon.frozen_config + log "/server-control-status working with daemon ID #{daemon.config['id']}" + else + log "/server-control-status Failed to get running daemon for config with id #{@id}" + end + @game_port = daemon.server_running? ? daemon.active_game_port : @config['server_game_port'] rescue @config['server_game_port'] + @rcon_port = daemon.server_running? ? daemon.active_rcon_port : @config['server_rcon_port'] rescue @config['server_rcon_port'] + @query_port = daemon.server_running? ? daemon.active_query_port : @config['server_query_port'] rescue @config['server_query_port'] + @server_status = get_server_status(@id) + @pid = daemon.game_pid if daemon + process = Sys::ProcTable.ps(pid: @pid) if @pid + threads = (WINDOWS ? process.thread_count : process.nlwp) if process + @threads = threads || 0 + @monitor = daemon.monitor rescue nil + @info = @monitor.info rescue nil + erb :'server-control-status' + end + + get '/server-status/:id', auth: :user do + id = params[:id] + get_server_status(id) + end + + get '/buffer/:uuid(/:bookmark)?', auth: :admin do # Sensitive information could be contained in these buffers (passwords, paths); admins only. + uuid = params['uuid'] + unless @@buffers.keys.include? uuid + status 400 + return "Unknown UUID: #{uuid}" + end + buffer = @@buffers[uuid] + @bookmark_uuid = params['bookmark'] + limit = buffer[:limit] + + buffer[:mutex].synchronize do # Synchronize with the writing thread to avoid mismatched indices when truncating, etc. + buffer[:iterator] = buffer[:iterator].nil? ? 1 : buffer[:iterator] + 1 + # log "Buffer [#{uuid}][#{buffer[:iterator]}] arrived with bookmark: [#{@bookmark_uuid}] -> #{buffer[:bookmarks][@bookmark_uuid]}" + # log "Buffer [#{uuid}][#{buffer[:iterator]}] Bookmarks: #{buffer[:bookmarks]}" + if buffer[:bookmarks].length > 100 + log "Buffer has many bookmarks! Are that many clients connected? #{buffer[:uuid]} (#{buffer[:bookmarks].length} bookmarks)", level: :warn + log "Purging first 20 bookmarks", level: :warn + 20.times { buffer[:bookmarks].shift } + end + unless buffer[:bookmarks].keys.include?(@bookmark_uuid) || @bookmark_uuid.nil? + status 400 + return "Failed to tail log (Unknown Bookmark UUID: #{@bookmark_uuid})." + end + if buffer[:bookmarks][@bookmark_uuid] == -1 # Client read everything; ready for outcome + obj = { + :status => buffer[:status].dup, + :message => buffer[:message].dup + } + log "Responding status/message: #{obj[:status]} - #{obj[:message]}" + @@buffer_mutex.synchronize do + buffer[:bookmarks].delete @bookmark_uuid + @@buffers[uuid][:persistent] ? @@buffers[uuid].reset : @@buffers.delete(uuid) + end + return Oj.dump(obj, mode: :compat) + end + + start_index = buffer[:bookmarks][@bookmark_uuid] || 0 + start_index = 0 if start_index > buffer.size + # log "Buffer [#{uuid}][#{buffer[:iterator]}] start_index unexpectedly negative" if start_index < 0 + new_bookmark_uuid = Sysrandom.uuid + new_bookmark = (buffer.size - start_index > limit) ? (start_index + limit) : buffer.size + # log "Buffer - Calculated new_bookmark: #{new_bookmark}" + if new_bookmark == buffer.size && !buffer[:status].nil? + # Process is done. The next bookmark will be an indicator to send status and message next time + # as well as slice to the end of the array below + new_bookmark = -1 + end + if new_bookmark == start_index && @bookmark_uuid # No data will be given; have them request the same bookmark if we were given one + new_bookmark_uuid = @bookmark_uuid + else + buffer[:bookmarks][new_bookmark_uuid] = new_bookmark + buffer[:bookmarks].delete @bookmark_uuid unless @bookmark_uuid.nil? + end + # log "Buffer - Command done. Moved to : #{new_bookmark}" if new_bookmark == -1 + + data_response = start_index == new_bookmark ? [] : buffer[:data][start_index..new_bookmark] + response_object = { + :bookmark => new_bookmark_uuid, + :data => data_response + } + # log "Buffer [#{uuid}][#{buffer[:iterator]}] Responding #{start_index}..#{new_bookmark}: #{response_object}" + # log "Buffer [#{uuid}][#{buffer[:iterator]}] Bookmarks: #{buffer[:bookmarks]}" + Oj.dump(response_object, mode: :compat) + end + end + + post '/control/server/:action(/:id)?', auth: :admin do + id = params['id'] + action = params['action'] + body = request.body.read + request.body.rewind + options = Oj.load body, symbol_keys: true + daemon = @@daemons[id] + if daemon.nil? && !['install', 'update', 'start'].include?(action) + status 400 + return "Could not find an active daemon for ID #{id}!" + end + validate = params['validate'].to_s == "true" + case action + when 'install' + uuid, buffer = self.class.create_buffer + log "Installing server" + Thread.new do + install_server(buffer, validate: validate) + end + log "Server install thread started. Returning UUID: #{uuid}" + uuid + when 'update' + uuid, buffer = self.class.create_buffer + log "Updating server" + Thread.new do + update_server(buffer, validate: validate) + end + log "Server update thread started. Returning UUID: #{uuid}" + uuid + when 'start' + config = $config_handler.server_configs.select{ |_, config| config['id'] == id }.first.last rescue nil + if config.nil? + status 400 + return "Unknown config ID: #{id}" + end + daemon = self.class.init_daemon config # Returns existing daemon if present + session[:active_daemon_uuid] = daemon.buffer[:uuid] + daemon.do_start_server + when 'stop' + body daemon.do_stop_server + session[:active_daemon_uuid] = nil if daemon.buffer[:uuid] == session[:active_daemon_uuid] + when 'delete' + @@daemons.delete(@@daemons.key daemon).implode + when 'restart' + daemon.config.merge!($config_handler.server_configs[daemon.id]) if $config_handler.server_configs[daemon.id] + if daemon.server_running? + daemon.do_restart_server + else + status 400 + "Server is not running" + end + when 'rcon' + begin + uuid, buffer = self.class.create_buffer + Thread.new { daemon.do_send_rcon(options[:command], host: options[:host] || '127.0.0.1', port: options[:port], pass: options[:pass], buffer: daemon.rcon_buffer, outcome_buffer: buffer) } + uuid + rescue => e + log "Error while sending RCON", e + status 500 + e.message + end + when 'chat' + begin + uuid, buffer = self.class.create_buffer + Thread.new { daemon.do_send_rcon("say #{options[:command]}", host: options[:host], port: options[:port], pass: options[:pass], buffer: daemon.chat_buffer, outcome_buffer: buffer, no_rx: true) } + uuid + rescue => e + log "Error while sending chat RCON", e + status 500 + e.message + end + else + status 400 + "Unknown action: #{action}" + end + end + + get '/config/file/:file', auth: :admin do + config = get_config(params['config-id']) + file_type = params['file'] + halt(400, "File type not found: #{file_type}") unless CONFIG_FILES[file_type.to_sym] + file = ERB.new(CONFIG_FILES[:bans_cfg][:local_erb]).result(binding) + halt(400, "File not found: #{file.sub(USER_HOME, '~')}") unless File.exist? file + File.read(file) + end + + post '/config/file', auth: :admin do + config_id = params['config_id'] + config = get_config(config_id) + file_type = params['file'] + halt(400, "File type not found: #{file_type}") unless CONFIG_FILES[file_type.to_sym] + file = ERB.new(CONFIG_FILES[:bans_cfg][:local_erb]).result(binding) + content = params['content'] + content << "\n" unless content.end_with? "\n" + FileUtils.mkdir_p(File.dirname(file)) + File.write(file, content) + "Wrote #{file.sub(USER_HOME, '~')}." + end + + put '/config/:action', auth: :admin do + if params['action'] == 'set' + begin + value = case params['variable'] + when 'server_mutators' + params['value'].split(',') + else + params['value'] + end + config_id = params['config-id'] + config = get_config(config_id) + status, msg, current, old = $config_handler.set config['id'], params['variable'], value + if status + daemon = @@daemons.select { |id, _| id == config['id'] }.first.last rescue nil + if daemon + daemon.config.merge!($config_handler.server_configs[config_id]) # Merge the current config for next restart + log "Merged config to active daemon for config ID #{daemon.config['id']}" + end + "Changed #{params['variable']}: #{old} => #{current}" + else + status 400 + msg + end + rescue => e + msg = "Failed to set #{params['variable'] + ' -> ' + params['value']}" + log msg, e + status 400 + "#{msg} | #{e.class}: #{e.message}" + end + elsif params['action'] == 'get' + value = $config_handler.get params['config-id'], params['variable'] + if value.nil? + status 404 + "Could not find value for #{params['variable']}" + else + value.to_s + end + else + halt 400, 'Unknown action' + end + end + + get '/daemons', auth: :admin do + @daemons = @@daemons + erb :daemons + end + + get '/daemon/:config_id', auth: :admin do + daemon = @@daemons[params[:config_id]] + if daemon.nil? + status 400 + "Could not find server daemon with ID #{params[:config_id]}" + else + session[:active_server_config] = daemon.config['id'] + nil + end + end + + get '/monitors', auth: :admin do + @monitors = @@monitors + erb :monitors + end + + get '/monitor-config/:name', auth: :admin do + name = params['name'] + config = $config_handler.monitor_configs[name] + running = !@@monitors[config['id']].nil? + Oj.dump({'running' => running}.merge(config)) + end + + post '/monitor-config/:name', auth: :admin do + name = params['name'] + data = Oj.load(request.body.read) + request.body.rewind + config = data['config'] + if config['ip'] && config['query_port'] && config['rcon_port'] && config['rcon_password'] + $config_handler.monitor_configs[name] = { + 'id' => $config_handler.monitor_configs.dig(name, 'id') || Sysrandom.uuid, + 'ip' => config['ip'], + 'name' => name, + 'query_port' => config['query_port'], + 'rcon_port' => config['rcon_port'], + 'rcon_password' => config['rcon_password'], + } + $config_handler.write_monitor_configs + Oj.dump({message: 'Monitor config saved'}.merge($config_handler.monitor_configs[name])) + else + status 400 + 'Missing parameter(s)' + end + end + + delete '/monitor-config/:name', auth: :admin do + name = params['name'] + if $config_handler.monitor_configs[name] + $config_handler.monitor_configs.delete name + "Monitor config deleted" + else + code 400 + "Unknown monitor config" + end + end + + get '/monitor-configs', auth: :admin do + @configs = $config_handler.monitor_configs + erb :'monitor-configs' + end + + get '/monitor/:id', auth: :admin do + # Get UUID for RCON buffer for tailing + if @@monitors[params['id']] + @@monitors[params['id']].rcon_buffer[:uuid] + else + status 400 + 'Unknown monitor' + end + end + + post '/monitor/:id/:action', auth: :admin do + data = Oj.load(request.body.read) + request.body.rewind + id = params['id'] + action = params['action'] + monitor_config = $config_handler.monitor_configs.select { |_, config| config['id'] == id }.first.last rescue nil + if monitor_config.nil? + status 404 + return "Could not find monitor with ID: #{id}" + end + case action + when 'start' + if @@monitors[id] + status 409 + "Monitor with ID #{id} already exists" + else + @@monitors[id] = ServerMonitor.new(monitor_config['ip'], monitor_config['query_port'], monitor_config['rcon_port'], monitor_config['rcon_password'], rcon_buffer: self.class.create_buffer.last, interval: 10, delay: 0, name: monitor_config['name']) + "Started monitor with ID #{id}" + end + when 'stop' + if @@monitors[id] + @@monitors[id].stop + @@monitors.delete id + "Monitor stopped" + else + status 400 + "Monitor with ID #{id} doesn't exist" + end + else + status 400 + 'Unknown action' + end + end + + get '/monitoring-details/:id', auth: :admin do + @info = {} + @id = params[:id] + matching_daemons = @@daemons[@id] + @monitor = @@daemons[@id] && @@daemons[@id].monitor || @@monitors[@id] + @info = @monitor.info rescue nil + erb :'monitoring-details' + end + + post '/moderator/:action/:unique_id', auth: :moderator do + data = Oj.load(request.body.read) + request.body.rewind + reason = data['reason'].gsub('"', '\"') + unique_id = params[:unique_id] + ip, port, password = get_rcon_info(id: data['id']) + unless password + halt 400, "Could not find an RCON password for ID: #{data['id']}" + end + case params[:action] + when 'ban' + uuid, buffer = self.class.create_buffer + Thread.new { @@rcon_client.send(ip, port, password, "banid #{unique_id} #{reason}", buffer: buffer) } + uuid + when 'kick' + uuid, buffer = self.class.create_buffer + Thread.new { @@rcon_client.send(ip, port, password, "kickid #{unique_id} #{reason}", buffer: buffer) } + uuid + else + status 400 + 'Unknown action' + end + end + + post '/rcon', auth: :admin do + body = request.body.read + request.body.rewind + options = Oj.load body, symbol_keys: true + log "Calling RCON client for command: [#{options[:host]}:#{options[:port]}] (TX >>) #{options[:command]}" + uuid, buffer = self.class.create_buffer + Thread.new { @@rcon_client.send(options[:host], options[:port], options[:pass], options[:command], buffer: buffer) } + uuid + end + + get '/server-configs', auth: :admin do + @configs = $config_handler.server_configs + erb :'server-configs' + end + + get '/server-config', auth: :admin do + config_id = params['config-id'] + config = get_config(config_id) + session[:active_server_config] = config_id + Oj.dump(config) + end + + post '/server-config', auth: :admin do + config = Oj.load(request.body.read) + config_id = config['id'] + if config_id && !config_id.is_uuid? + halt 400, "Invalid config ID format" + end + config_name = config['server-config-name'] + request.body.rewind + new_config = $config_handler.create_server_config config + overwrote = new_config['id'] == config_id + Oj.dump({ + message: "#{overwrote ? 'Overwrote' : 'Created'} #{new_config['id']}", + id: new_config['id'], + }, mode: :compat) + end + + delete '/server-config', auth: :admin do + config_id = params['config-id'] + halt 400, "Server config not found for ID #{config_id}" unless $config_handler.server_configs[config_id] + $config_handler.delete_server_config config_id + "Deleted #{params['name']}" + end + + get '/get-buffer/:id/:type', auth: :admin do + id = params[:id] + daemon = @@daemons[id] + if daemon.nil? + status 400 + return "No daemon exists for config ID #{id}" + end + type = params[:type] + case type + when 'server' + daemon.buffer[:uuid] + when 'rcon' + daemon.rcon_buffer[:uuid] + when 'chat' + daemon.chat_buffer[:uuid] + else + status 400 + "Unknown buffer type: #{type}" + end + end + + post '/automatic-updates/:action', auth: :admin do + action = params['action'] + case action + when 'disable' + @@config['automatic_updates'] = false + self.class.save_webapp_config @@config + stop_updates + when 'enable' + @@config['automatic_updates'] = true + self.class.save_webapp_config @@config + start_updates + else + status 400 + "Unknown action: #{action}" + end + end + + get '/generate-password', auth: :admin do + ConfigHandler.generate_password + end + + get '/download-server-config', auth: :admin do + config_id = params['config-id'] + unless config_id.is_uuid? + halt 400, "Invalid config ID format" + end + config_dir = File.join CONFIG_FILES_DIR, config_id + unless File.directory?(config_dir) + halt 400, "No files found for this config ID" + end + zip_path = File.expand_path File.join CONFIG_FILES_DIR, "ohdaw-config_#{config_id}_#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S')}.zip" + FileUtils.touch zip_path + zip_files zip_path, File.join(config_dir, '**/*') + begin + send_file zip_path, filename: File.basename(zip_path), disposition: :attachment + ensure + Thread.new { FileUtils.rm zip_path } + end + end + + get '/download-server-log/:config_id', auth: :admin do + log_file = File.expand_path File.join SERVER_LOG_DIR, "#{params['config_id']}.log" + if File.exist? log_file + send_file log_file, filename: File.basename(log_file), disposition: :attachment + else + status 400 + "Unable to find log file: #{params['config_name']}.log" + end + end + + get '/download-server-logs(/:config_id)?', auth: :admin do + config_id = params['config_id'] + zip_path = File.expand_path File.join SERVER_LOG_DIR, "#{config_id + '-' if config_id}ohd-logs-#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S')}.zip" + zip_files zip_path, File.join(SERVER_LOG_DIR, config_id ? "#{config_id}*.log" : '*.log') + begin + send_file zip_path, filename: File.basename(zip_path), disposition: :attachment + ensure + Thread.new { FileUtils.rm zip_path } + end + end + + get '/download-wrapper-logs', auth: :host do + zip_path = File.expand_path File.join WEBAPP_ROOT, 'log', "ohdaw-logs-#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S')}.zip" + zip_files zip_path, File.join(WEBAPP_ROOT, 'log', '*.log*') + begin + send_file zip_path, filename: File.basename(zip_path), disposition: :attachment + ensure + Thread.new { FileUtils.rm zip_path } + end + end +end + +def get_webrick_options(config = AdminWrapperSite.load_webapp_config) + webrick_options = { + AccessLog: [[LOGGER, WEBrick::AccessLog::COMMON_LOG_FORMAT], [LOGGER, WEBrick::AccessLog::REFERER_LOG_FORMAT]], + Host: config['admin_interface_bind_ip'], + Port: config['admin_interface_bind_port'], + Logger: LOGGER, # Logger.new(IO::NULL), + app: AdminWrapperSite, # app must be lowercase + SSLEnable: config['admin_interface_use_ssl'] + } + + if config['admin_interface_use_ssl'] + webrick_options.merge!({ + SSLVerifyClient: config['admin_interface_verify_ssl'] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE, + SSLCertName: [[ 'CN', WEBrick::Utils::getservername ]] + }) + if File.exist?(config['admin_interface_ssl_cert']) && File.exist?(config['admin_interface_ssl_key']) + webrick_options.merge!({ + SSLCertificate: OpenSSL::X509::Certificate.new(File.read config['admin_interface_ssl_cert']), + SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read config['admin_interface_ssl_key']) + }) + else + # Make temporary cert/key, since WEBrick's defaults won't work with modern browsers + cert, key = CertificateGenerator.generate + log "Writing generated certs to file", level: :info + config['admin_interface_ssl_cert'] = GENERATED_SSL_CERT + config['admin_interface_ssl_key'] = GENERATED_SSL_KEY + AdminWrapperSite.save_webapp_config(config) + File.write GENERATED_SSL_CERT, cert + File.write GENERATED_SSL_KEY, key + webrick_options.merge!({ + SSLCertificate: cert, + SSLPrivateKey: key, + }) + end + end + webrick_options +rescue => e + log "Couldn't create webrick options", e + raise +end + +begin + config = AdminWrapperSite.load_webapp_config + options = get_webrick_options(config) + log "Starting webserver with options: #{options}" + $server = Rack::Server.new(options) + Thread.new { sleep 1; log "Webserver initialized! Visit: http#{'s' if config['admin_interface_use_ssl']}://#{config['admin_interface_bind_ip'] == '0.0.0.0' ? '127.0.0.1' : config['admin_interface_bind_ip']}:#{config['admin_interface_bind_port']}", level: :info } + $server.start +rescue => e + unless e.is_a? SystemExit + log "Exception caused webserver exit", e + at_exit { exit 1 } + end +ensure + log "Webserver stopped", level: :info + $config_handler.write_config + log "Config written", level: :info + `stty echo` unless WINDOWS || !$stdout.isatty +end diff --git a/admin-interface/log/.gitignore b/admin-interface/log/.gitignore new file mode 100644 index 0000000..55f8b93 --- /dev/null +++ b/admin-interface/log/.gitignore @@ -0,0 +1,2 @@ +*.log* + diff --git a/extras/systemd/sandstorm-admin-wrapper.service b/extras/systemd/sandstorm-admin-wrapper.service new file mode 100644 index 0000000..9533450 --- /dev/null +++ b/extras/systemd/sandstorm-admin-wrapper.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=OHD Admin Wrapper + +[Service] +User=wrapper-user +Type=simple +WorkingDirectory=/home/wrapper-user/ohd-admin-wrapper/admin-interface +ExecStartPre=/home/wrapper-user/.rbenv/bin/rbenv exec bundle install +ExecStart=/home/wrapper-user/.rbenv/bin/rbenv exec bundle exec ruby lib/webapp.rb +Restart=always diff --git a/linux_start.sh b/linux_start.sh new file mode 100755 index 0000000..1d40dd4 --- /dev/null +++ b/linux_start.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +wrapper_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cd "$wrapper_root"/admin-interface + +while true; do + bundle && bundle exec ruby "$wrapper_root"/admin-interface/lib/webapp.rb "$@" + CODE=$? + [ $CODE -eq 2 ] || exit $CODE # Restart if exit code 2 +done + diff --git a/windows_start.bat b/windows_start.bat new file mode 100644 index 0000000..47788f0 --- /dev/null +++ b/windows_start.bat @@ -0,0 +1,32 @@ +@echo off +cd %~dp0\admin-interface + +:bundle +echo Bundling +call bundle +if ERRORLEVEL 1 goto bundle_error +echo Starting webapp + +:run_webapp +call bundle exec ruby lib/webapp.rb %* +echo Error level: %errorlevel% +if errorlevel 2 goto :bundle +if errorlevel 1 goto exit_error +if errorlevel 0 goto exit_success + +:webapp_error +echo Failed to run OHD Admin Wrapper. Ensure Ruby is version 2.6.3+. Logs are located in admin-interface/log. +goto exit_error + +:bundle_error +echo Failed to run Ruby Bundler. Ensure Ruby is installed with the bundler gem. https://rubyinstaller.org/downloads/ +goto exit_error + +:exit_error +pause +exit 1 + +:exit_success +echo OHD Admin Wrapper exited successfully. +pause +exit 0