commit 01ce4b09935a67f5975d355d6fca83fdaa0c7016
Author: Leah Thein <leah@toaster.fritz.box>
Date: Tue, 24 Nov 2020 18:37:07 +0100
Author: Leah Thein <leah@toaster.fritz.box>
Date: Tue, 24 Nov 2020 18:37:07 +0100
init
125 files changed, 8696 insertions(+), 0 deletions(-)
A
|
84
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
688
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
79
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
92
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
237
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
333
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
74
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
225
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
124
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
103
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
347
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
76
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
205
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
91
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
333
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
106
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
813
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
214
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
80
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
199
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
67
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
78
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
73
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
84
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
203
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
96
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
197
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
273
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
128
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
218
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
95
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
118
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
133
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/.gitignore b/.gitignore @@ -0,0 +1,5 @@ +oeffisearch +oeffisearch_nojs +cache +data +.DS_Store
diff --git a/LICENSE b/LICENSE @@ -0,0 +1,619 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + + 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. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + 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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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
diff --git a/README.md b/README.md @@ -0,0 +1,17 @@ + +## Öffisearch + +Öffisearch is a progressive web app for querying public transport information for the DB (and in the future BVG and nah.sh) networks. A hosted version of Öffisearch is available at [oeffisear.ch](https://oeffisear.ch). + +This repository consists of multiple modules, which are more or less independent. The HAFAS backend `src/backend/hafas` can be used to query the HAFAS mgate.exe endpoint directly. The cache and webserver modules allow serving an HTTP API. A unique id is generated for each request, so that the data can be requested again at a later time. + +### Development + +- Install the nim compiler >=1.0.4 and nimble language package manager from your distribution's package repositories. +- Run `nimble run oeffisearch` + +Or `nix-shell`, to set up the Öffisearch development server using the Nix package manager. + +### Attribution + +Thanks a lot to [Jannis Redmann](https://github.com/derhuerst/) for his work on [hafas-client](https://github.com/public-transport/hafas-client/). While Öffisearch does not use any code from hafas-client, it borrows a lot of the concepts and knowledge about the HAFAS APIs.
diff --git a/assets/client/css/product_selector.css b/assets/client/css/product_selector.css @@ -0,0 +1,84 @@ +.product_selector > label { + width: 32px; + height: 32px; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + + -o-user-select: none; + user-select: none; +} + +.product_selector > input { + display: none; +} + +input[id=national] + label[for=national] { + content: url("../img/product_highspeed_grey.svg"); +} + +input[id=national]:checked + label[for=national] { + content: url("../img/product_highspeed_color.svg"); +} + + +input[id=regional] + label[for=regional] { + content: url("../img/product_train_grey.svg"); +} + +input[id=regional]:checked + label[for=regional] { + content: url("../img/product_train_color.svg"); +} + + +input[id=suburban] + label[for=suburban] { + content: url("../img/product_suburban_grey.svg"); +} + +input[id=suburban]:checked + label[for=suburban] { + content: url("../img/product_suburban_color.svg"); +} + + +input[id=subway] + label[for=subway] { + content: url("../img/product_subway_grey.svg"); +} + +input[id=subway]:checked + label[for=subway] { + content: url("../img/product_subway_color.svg"); +} + +input[id=tram] + label[for=tram] { + content: url("../img/product_tram_grey.svg"); +} + +input[id=tram]:checked + label[for=tram] { + content: url("../img/product_tram_color.svg"); +} + + +input[id=bus] + label[for=bus] { + content: url("../img/product_bus_grey.svg"); +} + +input[id=bus]:checked + label[for=bus] { + content: url("../img/product_bus_color.svg"); +} + + +input[id=ferry] + label[for=ferry] { + content: url("../img/product_ferry_grey.svg"); +} + +input[id=ferry]:checked + label[for=ferry] { + content: url("../img/product_ferry_color.svg"); +} + +input[id=taxi] + label[for=taxi] { + content: url("../img/product_call_grey.svg"); +} + +input[id=taxi]:checked + label[for=taxi] { + content: url("../img/product_call_color.svg"); +}
diff --git a/assets/client/css/style.css b/assets/client/css/style.css @@ -0,0 +1,687 @@ +html, body { + margin: 0; + font-family: Roboto, Arial, sans-serif; +} + +.hidden { + display: none !important; +} + +* { + box-sizing: border-box; + border-collapse: collapse; +} + +canvas { + flex-grow: 1; +} + +table { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + width: 100%; +} + +table, tr { + background-color: #fff; + margin: 0 0 15px 0; +} + +#journeysView table { + margin: 15px auto; +} + +td, th { + text-align: center; + padding: 5px 3px; + overflow: hidden; +} + +tr:nth-child(odd) { + background-color: #f2f2f2; +} + +tbody tr { + cursor: pointer; +} + +tbody tr:hover { + background-color: #ddd; +} + +tbody tr:hover td { + background-color: transparent; +} + + +input[type="date"], +input[type="time"], +input[type="text"], +#deparr { + box-sizing: border-box; + width: 100%; + padding: .3em .5em; + border-radius: 3px; + font-size: 1.5em; + padding: 7px; + border: none; + outline: none; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + background-color: white; + color: black; + margin-top: 8px; +} + +#datetime { + display: flex; + flex-direction: row; +} + +#deparr { + padding: 0 !important; + overflow: hidden; + width: 84px; + flex-shrink: 0; + display: inline-block; +} + +.switch { + position: relative; + display: inline-block; + width: 84px; + height: 100%; +} + +/* Hide default HTML checkbox */ +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +/* The slider */ +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #bbb; + height: 100%; +} + +.slider:before { + position: absolute; + font-size: 13px; + padding-top: calc(25% - 7px); + line-height: 100%; + text-align: center; + content: "DEP"; + height: 100%; + width: 42px; + background-color: white; + transition: .2s; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); +} + +input:checked + .slider:before { + content: "ARR"; + transform: translateX(42px); +} + +input:active, +input:focus{ + box-shadow: 0 .1em .5em rgba(0, 0, 0, .6); +} + +#header { + position: relative; + box-shadow: 0 0 15px rgba(0, 0, 0, .6); + background-color: #43a047; + color: white; + padding: 0 0 0 9vw; +} + +#departuresView, +#searchView, +#journeyView, +#journeysView { + display: flex; + flex-direction: column; +} + +#settingsView { + padding: 10px; +} + +#journeyView tbody td:nth-child(3) { + text-align: left; +} + +#journeyView tbody:not(:last-child) { + border-bottom: 1px solid rgba(0, 0, 0, .2); +} + +#journeyView p { + color: white; + width: 100%; +} + +#journeyView p::before { + -webkit-filter: drop-shadow( 0 0 5px rgba(0, 0, 0, .6) ); + filter: drop-shadow( 0 0 5px rgba(0, 0, 0, .6) ); + margin-right: 4px; + vertical-align: sub; +} + +#journeyView p.change, +#journeyView p.walk, +#journeyView p.transfer { + text-shadow: 0 0 15px rgba(0, 0, 0, .6); + text-align: center; +} + +#journeyView p.change::before { + content: url("../img/baseline-import_export-24px.svg"); +} + +#journeyView p.walk::before { + content: url("../img/baseline-directions_walk-24px.svg"); +} + +#journeyView p.transfer::before { + content: url("../img/baseline-directions-24px_white.svg"); +} + +#searchView { + background-color: rgba(67, 160, 71, 0.6); + color: white; +} + +#searchView table { + width: 100%; + color: black; +} + +#searchView .button, +#searchView label:not(.switch) { + cursor: pointer; + border-radius: 3px; + background-color: white; + width: 40px; + padding: 3px; + height: 40px; + display: inline-block; + margin-top: 8px; + margin-bottom: 8px; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +#searchView #date { + flex-grow: 1; + margin-left: 8px; +} + +#searchView .product_selector { + margin-right: auto; +} + +#searchView .row { + display: flex; + flex-direction: row; +} + + +#searchView .swap { + margin-left: 5px; + content: url("../img/baseline-swap_vert-24px.svg"); +} + +#searchView .settings { + margin-left: 5px; + content: url("../img/baseline-settings-20px.svg"); +} + +#searchView .search { + margin-left: 5px; + content: url("../img/baseline-navigation-24px.svg"); + color: blue; +} + +#searchView .departures { + content: url("../img/baseline-departure_board-24px.svg"); +} + +#searchView .directions { + content: url("../img/baseline-directions-24px.svg"); +} + +#departuresView tbody td { + text-align: right; +} + +#departuresView tbody td:first-child { + text-align: left; +} + +.suggestionsbox { + border-radius: 3px; + width: 100%; + box-shadow: 0 .4em .8em rgba(0, 0, 0, .5); +} +.suggestions { + position: relative; + display: none; + overflow: visible; + z-index: 999; + height: 0; +} + +.suggestions.typing, +.suggestions.mouseover { + display: block; +} + +.loadMore { + cursor: pointer; + content: url("../img/baseline-expand_more-24px.svg"); + border-radius: 100%; + height: 48px; + width: 48px; + background-color: #eee; + margin: 0 auto; + transition: box-shadow 150ms; + border: 1px solid rgba(0, 0, 0, .1); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.flipped { + transform: rotate(180deg); +} + +.loadMore:hover { + box-shadow: 0 1px 5px 0 rgba(0, 0, 0, .3); +} +.loadMore.flipped { + margin-top: 15px; +} + +.suggestionsbox p { + font-size: 1.2em; + background-color: white; + color: black; + margin: 0; + border-top: 1px solid rgba(0, 0, 0, .2); + padding: .3em .6em; + cursor: pointer; +} + +.back { + cursor: pointer; + position: absolute; + left: 17px; + top: 17px; + width: 32px; + height: 32px; + content: url("../img/back.svg"); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.reload { + cursor: pointer; + position: absolute; + right: 17px; + top: 17px; + width: 32px; + height: 32px; + content: url("../img/baseline-refresh-24px.svg"); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.reload.spinning { + animation: spin 2s linear infinite; +} + +.btn { + color: #fff; + position: relative; + + margin-top: 30px; + padding: 0; + + overflow: hidden; + + border-width: 0; + outline: none; + border-radius: 2px; + + content: 'OK'; + border-radius: 4px; + color: white; + width: fit-content; + margin-left: 5px; + margin-top: 10px; + transition: background-color 100ms; + cursor: pointer; + background-color: rgba(20, 30, 255, .7); +} + +.btn:hover, .btn:focus { + background-color: rgba(70, 100, 255, .8); + } +.btn > * { + position: relative; +} + +.btn span { + display: block; + padding: 12px 24px; +} + +.btn.orange { + background-color: #e36420;; +} + +.btn.orange:hover, .btn.orange:focus { + background-color: #e67e22; +} + +.buttons { + justify-content: flex-end; + display: flex; +} + +.btn.red { + background-color: #d0493b; +} + +.btn.red:hover, .btn.red:focus { + background-color: #e74c3c; +} + +#spinner { + margin: calc(50vh - 60px) auto; + border: 2px solid rgba(255, 255, 255, .7); /* Light grey */ + border-top: 4px solid #3498db; /* Blue */ + border-radius: 50%; + width: 120px; + height: 120px; + animation: spin 2s linear infinite; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +#journeysView { + min-height: 100vh; +} + +#journeysCanvas { + flex-grow: 1; + flex-direction: column; + display: flex; +} + +#modal { + display: flex; +} + +#modal-box { + margin: auto; + border-radius: 4px; + background-color: white; + width: fit-content; + width: -moz-fit-content; + padding: 15px; + box-shadow: 0 1px 4px rgba(0, 0, 0, .6); +} + +#dismiss { + content: 'OK'; + border-radius: 4px; + background-color: rgba(20, 30, 255, .7); + color: white; + width: fit-content; + width: -moz-fit-content; + padding: 8px 20px; + margin-left: auto; + margin-top: 10px; + transition: background-color 300ms; +} + +#dismiss:hover { + background-color: rgba(70, 100, 255, .8); + cursor: pointer; +} + +@media (max-width: 799px) { + #searchView { + padding: 10px; + } + div#settings { + padding: 15px 5vw; + } + #header { + padding: 0 0 0 50px; + } + .back { + left: 10px; + } + #datetime { + flex-wrap: wrap; + } + #searchView #date { + width: initial; + } + #searchView #time { + width: 100%; + flex-shrink: 0; + } + #searchView table { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .4); + border-radius: 5px; + overflow: hidden; + border: none; + } +} + +@media (min-width: 800px) { + #searchView { + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, .4); + padding: 50px; + margin: auto; + width: 80vw; + max-width: 800px; + color: white; + } + #searchView #date { + margin-right: 8px; + } + #searchView #time { + width: 40%; + } + div#settings { + padding: 30px 30px; + margin: 0 8vw; + } + #header { + padding: 0 10vw; + } + td p { + display: inline; + margin-right: 5px; + } + td, th { + padding: 10px 5px; + } + table { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .4); + border-radius: 5px; + overflow: hidden; + border: none; + margin: 50px auto; + width: 80vw; + } +} + + +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} + +.modal-header { + background-color: #43a047; + color: white; + border-radius: 6px 6px 0px 0px; + min-height: 16.4; + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} + +.modal-header .close { + margin-top: -2px; +} + +.modal-header .modal-close { + width:53px; + float:right; + margin:-15px; + margin-left:0px; + height:53px; + border-left: 1px solid #00000040; + + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAABO0lEQVR42u3bURKDIAwEUNiLoyfXC3Ss4mYTh81Xv4R90wqEad+2ra1caIuXAQxgAAMYwAAGMIABDGAAA0zVGOMYYxzqibPGxdtJ/PqsCM8aF4xJKBHY40IxwcrPngbY970rJ3r1zKu5hH4DVAhR4Sk/gWiEyPC0d0AUQnR46kuQjaAIT18FWAiq8CHL4FsEZfiws8Asgjp86GHoKUJG+PDT4F2ErPCttdYVd4OzS2F0eFk/YCaIIry0IfIkkCq8FOBuMGV4OUDFkgK83Qh9GoC1Ff4kAPsw9CmAf5scdWdJCnB3h5eJgOzw2QioED4TAVXCZyGgUvgMBFQLr0ZAxfBKBFQNr0JA5fAKBFQPH40gbYtXfDb1dljRzGCPS7sdVnZymON2/2Nk8TKAAQxgAAMYwAAGMIABDLBmnWRS+u5G6HkFAAAAAElFTkSuQmCC') center no-repeat; + background-size:30px; + cursor:pointer; +} + +.modal-header .modal-close:hover { + border-radius: 0px 6px 0px 0px; +} + +.modal-title { + margin: 0; + line-height: 1.4; +} + +.modal-open { + overflow: hidden; +} + +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} + +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} + +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} + +.modal-body { + position: relative; +} + +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + + .modal-content { + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } +} + +.cancelled { + text-decoration-line: line-through; +} + +.showremarks { + vertical-align: bottom; + cursor: pointer; +} +.remark { + vertical-align: middle; +} +.showremarks.hint, +.remark.hint { + content: url("../img/info-24px.svg"); +} +.showremarks.status, +.remark.status { + content: url("../img/warning-24px.svg"); +} +.showremarks.other, +.remark.other { + content: url("../img/help-24px.svg"); +} +.remarks td { + margin: 0 10px; + text-align: left; + display: block; +} +/*.remarks { + display: none; + position: absolute; + z-index: 1; +}*/ +.remarks { + /*background: #000000d0;*/ + border: 1px solid #ddd; + padding: 0; + width: 100%; + margin: 0; + box-shadow: none; +} +/*.showremarks:hover+.remarks { + display: inline-block; +}*/ + + +.travelynx { + vertical-align: bottom; + cursor: pointer; + content: url("../img/travelynx.svg"); +}+ \ No newline at end of file
diff --git a/assets/client/img/apple-touch-icon.png b/assets/client/img/apple-touch-icon.png Binary files differ.
diff --git a/assets/client/img/back.svg b/assets/client/img/back.svg @@ -0,0 +1 @@ +<svg height="100%" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g color="white"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" fill="currentColor"></path></g></svg>
diff --git a/assets/client/img/baseline-beenhere-24px.svg b/assets/client/img/baseline-beenhere-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 1H5c-1.1 0-1.99.9-1.99 2L3 15.93c0 .69.35 1.3.88 1.66L12 23l8.11-5.41c.53-.36.88-.97.88-1.66L21 3c0-1.1-.9-2-2-2zm-9 15l-5-5 1.41-1.41L10 13.17l7.59-7.59L19 7l-9 9z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-departure_board-24px.svg b/assets/client/img/baseline-departure_board-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M16 1c-2.4 0-4.52 1.21-5.78 3.05.01-.01.01-.02.02-.03C9.84 4 9.42 4 9 4c-4.42 0-8 .5-8 4v10c0 .88.39 1.67 1 2.22V22c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22v-3.08c3.39-.49 6-3.39 6-6.92 0-3.87-3.13-7-7-7zM4.5 19c-.83 0-1.5-.67-1.5-1.5S3.67 16 4.5 16s1.5.67 1.5 1.5S5.33 19 4.5 19zM3 13V8h6c0 1.96.81 3.73 2.11 5H3zm10.5 6c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm2.5-6c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm.5-9H15v5l3.62 2.16.75-1.23-2.87-1.68z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-directions-24px.svg b/assets/client/img/baseline-directions-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21.71 11.29l-9-9c-.39-.39-1.02-.39-1.41 0l-9 9c-.39.39-.39 1.02 0 1.41l9 9c.39.39 1.02.39 1.41 0l9-9c.39-.38.39-1.01 0-1.41zM14 14.5V12h-4v3H8v-4c0-.55.45-1 1-1h5V7.5l3.5 3.5-3.5 3.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-directions-24px_white.svg b/assets/client/img/baseline-directions-24px_white.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M21.71 11.29l-9-9c-.39-.39-1.02-.39-1.41 0l-9 9c-.39.39-.39 1.02 0 1.41l9 9c.39.39 1.02.39 1.41 0l9-9c.39-.38.39-1.01 0-1.41zM14 14.5V12h-4v3H8v-4c0-.55.45-1 1-1h5V7.5l3.5 3.5-3.5 3.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-directions_walk-24px.svg b/assets/client/img/baseline-directions_walk-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path style="fill: white;" d="M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6l1.8-.7"/></svg>
diff --git a/assets/client/img/baseline-expand_more-24px.svg b/assets/client/img/baseline-expand_more-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-import_export-24px.svg b/assets/client/img/baseline-import_export-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
diff --git a/assets/client/img/baseline-navigation-24px.svg b/assets/client/img/baseline-navigation-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-place-24px.svg b/assets/client/img/baseline-place-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-refresh-24px.svg b/assets/client/img/baseline-refresh-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-settings-20px.svg b/assets/client/img/baseline-settings-20px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="none" d="M0 0h20v20H0V0z"/><path d="M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/baseline-swap_vert-24px.svg b/assets/client/img/baseline-swap_vert-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"/><path d="M0 0h24v24H0z" fill="none"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/bg.webp b/assets/client/img/bg.webp Binary files differ.
diff --git a/assets/client/img/favicon-16x16.png b/assets/client/img/favicon-16x16.png Binary files differ.
diff --git a/assets/client/img/favicon-32x32.png b/assets/client/img/favicon-32x32.png Binary files differ.
diff --git a/assets/client/img/favicon-512x512.png b/assets/client/img/favicon-512x512.png Binary files differ.
diff --git a/assets/client/img/favicon-64x64.png b/assets/client/img/favicon-64x64.png Binary files differ.
diff --git a/assets/client/img/help-24px.svg b/assets/client/img/help-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/info-24px.svg b/assets/client/img/info-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_bus_color.svg b/assets/client/img/product_bus_color.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#a3007c"/> + + <g transform="scale(0.93, 0.93)"> + <path d="M178.20792 263.87558C178.20776 271.38825 176.67741 278.10092 173.61686 284.0136C170.62558 289.92634 166.48668 294.83041 161.20016 298.72583C155.07863 303.31689 148.33118 306.58627 140.9578 308.53399C133.65374 310.48171 124.36731 311.45557 113.09846 311.45557L45.276115 311.45557L45.276115 156.09022L105.58583 156.09022C118.10679 156.09037 127.2541 156.50774 133.0278 157.34232C138.87084 158.17721 144.64443 160.02059 150.34858 162.87245C156.26117 165.86374 160.64353 169.8983 163.49568 174.97613C166.41712 179.98469 167.87791 185.72349 167.87805 192.19258C167.87791 199.70532 165.89541 206.34842 161.93055 212.12191C157.96542 217.82604 152.36574 222.27796 145.13148 225.4777L145.13148 226.31243C155.28731 228.3298 163.32164 232.50348 169.2345 238.83348C175.21663 245.16364 178.20776 253.51099 178.20792 263.87558M126.87162 200.01823C126.87151 197.44458 126.21068 194.87081 124.88912 192.29692C123.63691 189.72327 121.37617 187.81033 118.10688 186.5581C115.18521 185.44525 111.53325 184.85398 107.15096 184.78429C102.83808 184.64529 96.751466 184.57573 88.891101 184.57561L85.134787 184.57561L85.134787 217.44336L91.395311 217.44336C97.725325 217.44345 103.11633 217.33911 107.56833 217.13033C112.02017 216.92174 115.53302 216.22613 118.10688 215.04349C121.72398 213.44368 124.08906 211.39162 125.20214 208.88731C126.31502 206.31364 126.87151 203.35729 126.87162 200.01823M136.67977 263.24953C136.67966 258.31072 135.7058 254.51963 133.75819 251.87624C131.87993 249.16341 128.64533 247.14613 124.05438 245.8244C120.92402 244.92017 116.61122 244.43324 111.11596 244.36361C105.62053 244.29412 99.881725 244.25934 93.899521 244.25927L85.134787 244.25927L85.134787 282.97018L88.056365 282.97018C99.325235 282.97021 107.39435 282.93543 112.26373 282.86584C117.13293 282.79631 121.61964 281.89201 125.72385 280.15294C129.89743 278.41394 132.74945 276.11842 134.2799 273.26637C135.8797 270.34483 136.67966 267.00589 136.67977 263.24953M344.11181 255.21519C344.11166 274.41417 338.26851 289.12639 326.58235 299.35189C314.89591 309.57741 297.67948 314.69017 274.93302 314.69017C252.18638 314.69017 234.96996 309.57741 223.28369 299.35189C211.66692 289.12639 205.85855 274.44895 205.85857 255.31953L205.85857 156.09022L246.13461 156.09022L246.13461 253.02401C246.13455 263.80607 248.39529 271.8404 252.91684 277.12702C257.43826 282.41372 264.77698 285.05705 274.93302 285.05702C284.94976 285.05705 292.2537 282.51806 296.84486 277.44005C301.50535 272.36211 303.83566 264.22344 303.83577 253.02401L303.83577 156.09022L344.11181 156.09022L344.11181 255.21519M506.05073 262.62348C506.05059 277.92701 499.5466 290.37849 486.53876 299.97794C473.60023 309.50785 456.00122 314.2728 433.74167 314.2728C420.87276 314.2728 409.63861 313.15982 400.03918 310.93386C390.50925 308.63833 381.57062 305.75154 373.22327 302.27346L373.22327 265.02334L377.60564 265.02334C385.88342 271.63171 395.13507 276.70969 405.36063 280.25729C415.65566 283.80494 425.53337 285.57876 434.99378 285.57873C437.42835 285.57876 440.62817 285.37007 444.59325 284.95268C448.55816 284.53534 451.79276 283.83973 454.29706 282.86584C457.35767 281.61376 459.86188 280.04863 461.80969 278.17045C463.82687 276.29232 464.83551 273.50987 464.83561 269.82308C464.83551 266.41462 463.37472 263.49304 460.45324 261.05835C457.60113 258.55419 453.39267 256.64125 447.82785 255.31953C441.98462 253.92836 435.79366 252.64148 429.25497 251.45887C422.7857 250.20683 416.69908 248.6417 410.9951 246.76348C397.91753 242.52031 388.49197 236.7815 382.7184 229.54704C377.01435 222.24318 374.16234 213.20021 374.16235 202.4181C374.16234 187.94946 380.63154 176.15881 393.56998 167.04614C406.57791 157.86419 423.27262 153.27314 443.65417 153.27298C453.8796 153.27314 463.96599 154.28178 473.91337 156.2989C483.93009 158.24678 492.59047 160.7162 499.89455 163.70719L499.89455 199.49652L495.61652 199.49652C489.35587 194.48822 481.66935 190.31454 472.55693 186.97547C463.51384 183.56709 454.26219 181.86284 444.80193 181.86271C441.46291 181.86284 438.12396 182.10631 434.78509 182.59311C431.51564 183.0106 428.3506 183.84534 425.28997 185.09732C422.57701 186.14086 420.24671 187.74077 418.29905 189.89705C416.35127 191.98401 415.37742 194.38388 415.37747 197.09665C415.37742 201.20089 416.94255 204.36593 420.07286 206.59178C423.20306 208.74829 429.11577 210.73079 437.81102 212.53928C443.51497 213.72192 448.97553 214.86968 454.19272 215.98257C459.47929 217.09565 465.14853 218.62599 471.20048 220.57362C483.09535 224.46915 491.86008 229.79059 497.49468 236.53796C503.19857 243.21592 506.05059 251.91108 506.05073 262.62348" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_bus_grey.svg b/assets/client/img/product_bus_grey.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#a9a9a9"/> + + <g transform="scale(0.93, 0.93)"> + <path d="M178.20792 263.87558C178.20776 271.38825 176.67741 278.10092 173.61686 284.0136C170.62558 289.92634 166.48668 294.83041 161.20016 298.72583C155.07863 303.31689 148.33118 306.58627 140.9578 308.53399C133.65374 310.48171 124.36731 311.45557 113.09846 311.45557L45.276115 311.45557L45.276115 156.09022L105.58583 156.09022C118.10679 156.09037 127.2541 156.50774 133.0278 157.34232C138.87084 158.17721 144.64443 160.02059 150.34858 162.87245C156.26117 165.86374 160.64353 169.8983 163.49568 174.97613C166.41712 179.98469 167.87791 185.72349 167.87805 192.19258C167.87791 199.70532 165.89541 206.34842 161.93055 212.12191C157.96542 217.82604 152.36574 222.27796 145.13148 225.4777L145.13148 226.31243C155.28731 228.3298 163.32164 232.50348 169.2345 238.83348C175.21663 245.16364 178.20776 253.51099 178.20792 263.87558M126.87162 200.01823C126.87151 197.44458 126.21068 194.87081 124.88912 192.29692C123.63691 189.72327 121.37617 187.81033 118.10688 186.5581C115.18521 185.44525 111.53325 184.85398 107.15096 184.78429C102.83808 184.64529 96.751466 184.57573 88.891101 184.57561L85.134787 184.57561L85.134787 217.44336L91.395311 217.44336C97.725325 217.44345 103.11633 217.33911 107.56833 217.13033C112.02017 216.92174 115.53302 216.22613 118.10688 215.04349C121.72398 213.44368 124.08906 211.39162 125.20214 208.88731C126.31502 206.31364 126.87151 203.35729 126.87162 200.01823M136.67977 263.24953C136.67966 258.31072 135.7058 254.51963 133.75819 251.87624C131.87993 249.16341 128.64533 247.14613 124.05438 245.8244C120.92402 244.92017 116.61122 244.43324 111.11596 244.36361C105.62053 244.29412 99.881725 244.25934 93.899521 244.25927L85.134787 244.25927L85.134787 282.97018L88.056365 282.97018C99.325235 282.97021 107.39435 282.93543 112.26373 282.86584C117.13293 282.79631 121.61964 281.89201 125.72385 280.15294C129.89743 278.41394 132.74945 276.11842 134.2799 273.26637C135.8797 270.34483 136.67966 267.00589 136.67977 263.24953M344.11181 255.21519C344.11166 274.41417 338.26851 289.12639 326.58235 299.35189C314.89591 309.57741 297.67948 314.69017 274.93302 314.69017C252.18638 314.69017 234.96996 309.57741 223.28369 299.35189C211.66692 289.12639 205.85855 274.44895 205.85857 255.31953L205.85857 156.09022L246.13461 156.09022L246.13461 253.02401C246.13455 263.80607 248.39529 271.8404 252.91684 277.12702C257.43826 282.41372 264.77698 285.05705 274.93302 285.05702C284.94976 285.05705 292.2537 282.51806 296.84486 277.44005C301.50535 272.36211 303.83566 264.22344 303.83577 253.02401L303.83577 156.09022L344.11181 156.09022L344.11181 255.21519M506.05073 262.62348C506.05059 277.92701 499.5466 290.37849 486.53876 299.97794C473.60023 309.50785 456.00122 314.2728 433.74167 314.2728C420.87276 314.2728 409.63861 313.15982 400.03918 310.93386C390.50925 308.63833 381.57062 305.75154 373.22327 302.27346L373.22327 265.02334L377.60564 265.02334C385.88342 271.63171 395.13507 276.70969 405.36063 280.25729C415.65566 283.80494 425.53337 285.57876 434.99378 285.57873C437.42835 285.57876 440.62817 285.37007 444.59325 284.95268C448.55816 284.53534 451.79276 283.83973 454.29706 282.86584C457.35767 281.61376 459.86188 280.04863 461.80969 278.17045C463.82687 276.29232 464.83551 273.50987 464.83561 269.82308C464.83551 266.41462 463.37472 263.49304 460.45324 261.05835C457.60113 258.55419 453.39267 256.64125 447.82785 255.31953C441.98462 253.92836 435.79366 252.64148 429.25497 251.45887C422.7857 250.20683 416.69908 248.6417 410.9951 246.76348C397.91753 242.52031 388.49197 236.7815 382.7184 229.54704C377.01435 222.24318 374.16234 213.20021 374.16235 202.4181C374.16234 187.94946 380.63154 176.15881 393.56998 167.04614C406.57791 157.86419 423.27262 153.27314 443.65417 153.27298C453.8796 153.27314 463.96599 154.28178 473.91337 156.2989C483.93009 158.24678 492.59047 160.7162 499.89455 163.70719L499.89455 199.49652L495.61652 199.49652C489.35587 194.48822 481.66935 190.31454 472.55693 186.97547C463.51384 183.56709 454.26219 181.86284 444.80193 181.86271C441.46291 181.86284 438.12396 182.10631 434.78509 182.59311C431.51564 183.0106 428.3506 183.84534 425.28997 185.09732C422.57701 186.14086 420.24671 187.74077 418.29905 189.89705C416.35127 191.98401 415.37742 194.38388 415.37747 197.09665C415.37742 201.20089 416.94255 204.36593 420.07286 206.59178C423.20306 208.74829 429.11577 210.73079 437.81102 212.53928C443.51497 213.72192 448.97553 214.86968 454.19272 215.98257C459.47929 217.09565 465.14853 218.62599 471.20048 220.57362C483.09535 224.46915 491.86008 229.79059 497.49468 236.53796C503.19857 243.21592 506.05059 251.91108 506.05073 262.62348" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_call_color.svg b/assets/client/img/product_call_color.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#a3007c"/> + + <g transform="translate(45, 45) scale(17, 17)"> + <path d="M 20 15.5 c -1.25 0 -2.45 -.2 -3.57 -.57 -.35 -.11 -.74 -.03 -1.02 .24 l -2.2 2.2 c -2.83 -1.44 -5.15 -3.75 -6.59 -6.58 l 2.2 -2.21 c .28 -.27 .36 -.66 .25 -1.01 C 8.7 6.45 8.5 5.25 8.5 4 c 0 -.55 -.45 -1 -1 -1 H 4 c -.55 0 -1 .45 -1 1 0 9.39 7.61 17 17 17 .55 0 1 -.45 1 -1 v -3.5 c 0 -.55 -.45 -1 -1 -1 z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_call_grey.svg b/assets/client/img/product_call_grey.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#a9a9a9"/> + + <g transform="translate(45, 45) scale(17, 17)"> + <path d="M 20 15.5 c -1.25 0 -2.45 -.2 -3.57 -.57 -.35 -.11 -.74 -.03 -1.02 .24 l -2.2 2.2 c -2.83 -1.44 -5.15 -3.75 -6.59 -6.58 l 2.2 -2.21 c .28 -.27 .36 -.66 .25 -1.01 C 8.7 6.45 8.5 5.25 8.5 4 c 0 -.55 -.45 -1 -1 -1 H 4 c -.55 0 -1 .45 -1 1 0 9.39 7.61 17 17 17 .55 0 1 -.45 1 -1 v -3.5 c 0 -.55 -.45 -1 -1 -1 z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_ferry_color.svg b/assets/client/img/product_ferry_color.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#ffffff"/> + + <g transform="translate(-124, -282.36217)"> + <path d="M 530.96544,727.09056 C 518.61233,731.51828 424.32729,729.55598 371.47722,713.67181 C 242.6438,674.95072 188.03985,698.09969 188.71925,698.44999 C 234.50268,749.59823 301.00643,781.86217 375.00001,781.86217 C 433.98426,781.86217 488.2424,761.35276 530.96544,727.09056 z M 553.7215,706.36522 C 506.77439,716.60935 450.5039,712.13823 401.70643,703.18706 C 354.10678,691.99951 300.55231,671.99455 270.35714,674.50504 L 298.92857,540.21932 L 467.14285,540.21932 L 478.92857,480.93318 L 311.07143,480.93318 L 328.21428,397.36218 L 500.71428,397.36218 L 511.42857,339.50504 L 270,339.50504 L 199.28571,673.07647 C 177.5,676.64789 174.84375,681.51396 174.76786,681.49928 C 143.87047,639.76479 125.49999,588.19576 125.49999,532.36218 C 125.49999,394.63817 237.276,282.86218 375.00001,282.86218 C 512.72399,282.86218 624.5,394.63817 624.5,532.36218 C 624.5,600.02229 597.49914,661.40668 553.7215,706.36522 z" fill="#0080c0" stroke-width="1"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_ferry_grey.svg b/assets/client/img/product_ferry_grey.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 249.5 -0.5 C 387.571187458 -0.5 499.5 111.428812542 499.5 249.5 C 499.5 387.571187458 387.571187458 499.5 249.5 499.5 C 111.428812542 499.5 -0.5 387.571187458 -0.5 249.5 C -0.5 111.428812542 111.428812542 -0.5 249.5 -0.5 Z" fill="#ffffff"/> + + <g transform="translate(-124, -282.36217)"> + <path d="M 530.96544,727.09056 C 518.61233,731.51828 424.32729,729.55598 371.47722,713.67181 C 242.6438,674.95072 188.03985,698.09969 188.71925,698.44999 C 234.50268,749.59823 301.00643,781.86217 375.00001,781.86217 C 433.98426,781.86217 488.2424,761.35276 530.96544,727.09056 z M 553.7215,706.36522 C 506.77439,716.60935 450.5039,712.13823 401.70643,703.18706 C 354.10678,691.99951 300.55231,671.99455 270.35714,674.50504 L 298.92857,540.21932 L 467.14285,540.21932 L 478.92857,480.93318 L 311.07143,480.93318 L 328.21428,397.36218 L 500.71428,397.36218 L 511.42857,339.50504 L 270,339.50504 L 199.28571,673.07647 C 177.5,676.64789 174.84375,681.51396 174.76786,681.49928 C 143.87047,639.76479 125.49999,588.19576 125.49999,532.36218 C 125.49999,394.63817 237.276,282.86218 375.00001,282.86218 C 512.72399,282.86218 624.5,394.63817 624.5,532.36218 C 624.5,600.02229 597.49914,661.40668 553.7215,706.36522 z" fill="#a9a9a9" stroke-width="1"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_highspeed_color.svg b/assets/client/img/product_highspeed_color.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="2200" width="2200" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="1100" android:pivotY="1100" transform="scale(0.93, 0.93)"> + <path d="M0,2200L2200,2200L2200,0l-2200,0Z" fill="#ff0000"/> + <path d="M270,1203.2c0,0,-6.8,8.3,-20,24.5c-13.2,16.2,-20,24.5,-20,24.5l-47.6,60.3c0,0,-5.9,9,-17.3,26.4c-11.4,17.4,-17.3,26.3,-17.3,26.3l-58.3,108.2c0,0,-2.6,10.1,-7.6,29.8c-5,19.6,-7.6,29.7,-7.6,29.7l-0.7,87c0,0,2.4,10.2,6.9,30c4.5,19.8,6.8,30,6.8,30l7.5,15.2c0,0,6.5,8.2,19.1,24.3c12.6,16,19.1,24.3,19.1,24.3l31.3,26c0,0,8.5,5.9,24.9,17.3c16.4,11.3,24.9,17.2,24.9,17.2l1.1,0.6c0,0,9.4,3.9,27.8,11.6c18.4,7.6,27.9,11.6,27.9,11.6l49.4,13.6c0,0,10.6,1.9,31.1,5.4c20.4,3.5,31,5.3,31,5.3l36.8,2.6c0,0,10.8,0.4,31.6,1.3c20.9,0.8,31.7,1.3,31.7,1.3l1725.6,19.3l-2,-1640.9l-585.4,0.9c0,0,-10.7,0.5,-31.5,1.6c-20.9,1.1,-31.6,1.6,-31.6,1.6l-196.4,20c0,0,-10.4,2.3,-30.7,6.8c-20.3,4.4,-30.7,6.7,-30.7,6.7l-111.3,38.2c0,0,-9.8,4.4,-28.7,13c-18.9,8.6,-28.7,13,-28.7,13l-62.7,36c0,0,-8.8,6.2,-25.9,18c-17.1,11.9,-25.9,18,-25.9,18L936.1,528.9c0,0,-7.8,7.4,-23,21.6c-15.2,14.3,-23,21.6,-23,21.6L675.9,799c0,0,-7.2,8,-21.1,23.6c-13.9,15.6,-21,23.6,-21,23.6Z" fill="#ffffff"/> + <path d="M528.4,1342.5l-0.9,-1.3l-1.1,-1.2l-1,-1.2l-1.1,-1.1l-1.2,-1.2l-1.2,-1.1l-1.2,-1.2l-1.3,-1.1l-1.3,-1.1l-1.4,-1l-1.4,-1.1l-1.4,-1l-1.5,-1.1l-1.5,-1l-1.6,-0.9l-1.6,-1l-1.6,-0.9l-1.7,-0.9l-1.7,-0.9l-1.8,-0.9l-1.8,-0.9l-1.8,-0.8l-1.9,-0.8l-1.9,-0.8l-1.9,-0.8l-1.9,-0.7l-2,-0.7l-2.1,-0.7l-2,-0.7l-2.1,-0.6l-2.1,-0.6l-2.1,-0.6l-2.2,-0.6l-2.2,-0.5l-2.2,-0.6l-2.3,-0.5l-2.2,-0.4l-2.3,-0.5l-2.4,-0.4l-2.3,-0.4l-2.3,-0.3l-2.4,-0.4l-2.4,-0.3l-2.4,-0.3l-2.5,-0.2l-2.4,-0.2l-2.5,-0.2l-2.5,-0.2l-2.5,-0.2l-2.5,-0.1l-2.5,-0.1l-2.5,-0.1l-2.6,0l-2.5,0l-2.6,0l-2.6,0.1l-2.5,0l-2.6,0.1l-2.6,0.1l-2.6,0.2l-2.6,0.2L404,1307l-2.6,0.2l-2.6,0.3l-2.6,0.3l-2.6,0.3l-2.6,0.3l-2.6,0.4l-2.5,0.4l-2.6,0.4l-2.6,0.4l-2.6,0.5l-2.5,0.5l-2.6,0.5l-2.5,0.6l-2.6,0.5l-2.5,0.6l-2.5,0.6l-2.5,0.7l-2.5,0.7l-2.4,0.7l-2.5,0.7l-2.4,0.7l-2.4,0.8l-2.4,0.8l-2.4,0.8l-2.4,0.8l-2.3,0.9l-2.3,0.8l-2.3,0.9l-2.3,1l-2.2,0.9l-2.2,1l-2.2,0.9l-2.2,1l-2.1,1.1l-2.1,1l-2.1,1.1l-2.1,1l-2,1.1l-2,1.1l-1.9,1.2l-2,1.1l-1.9,1.2l-1.8,1.1l-1.8,1.2l-1.8,1.3l-1.8,1.2l-1.7,1.2l-1.7,1.3l-1.6,1.2l-1.6,1.3l-1.6,1.3l-1.5,1.3l-1.5,1.3l-1.4,1.3l-1.4,1.4l-1.4,1.3l-1.3,1.4l-1.3,1.3l-1.2,1.4l-1.2,1.4l-1.2,1.4l-1.1,1.4l-1,1.4l-1,1.4l-1,1.4l-0.9,1.4l-0.9,1.5l-0.8,1.4l-0.8,1.4l-0.7,1.5l-0.7,1.4l-0.7,1.4l-0.6,1.5l-0.5,1.4l-0.5,1.5l-0.5,1.4l-0.4,1.5l-0.3,1.4l-0.3,1.4l-0.3,1.5l-0.2,1.4l-0.1,1.5l-0.2,1.4l0,1.4l0,1.4l0,1.5l0.1,1.4l0.1,1.4l0.2,1.4l0.2,1.4l0.3,1.4l0.4,1.3l0.3,1.4l0.5,1.4l0.4,1.3l0.6,1.3l0.5,1.4l0.7,1.3l0.6,1.3l0.7,1.3l0.8,1.3l0.8,1.3l0.9,1.2l0.9,1.3l0.9,1.2l1,1.2l1.1,1.2l1,1.2l1.2,1.2l1.1,1.1l1.2,1.1l1.3,1.2l1.3,1.1l1.3,1l1.4,1.1l1.5,1.1l1.4,1l1.5,1l1.6,1l1.6,1l1.6,0.9l1.6,0.9l1.7,0.9l1.8,0.9l1.8,0.9l1.8,0.8l1.8,0.8l1.9,0.8l1.9,0.8l1.9,0.8l2,0.7l2,0.7l2.1,0.7l2,0.6l2.1,0.7l2.1,0.6l2.2,0.6l2.2,0.5l2.2,0.5l2.2,0.5l2.3,0.5l2.3,0.5l2.3,0.4l2.3,0.4l2.3,0.4l2.4,0.3l2.4,0.4l2.4,0.3l2.4,0.2l2.5,0.3l2.4,0.2l2.5,0.2l2.5,0.1l2.5,0.2l2.5,0.1l2.5,0.1l2.6,0l2.5,0l2.6,0l2.5,0l2.6,0l2.6,-0.1l2.6,-0.1l2.6,-0.2l2.6,-0.1l2.5,-0.2l2.6,-0.3l2.6,-0.2l2.6,-0.3l2.6,-0.3l2.6,-0.3l2.6,-0.3l2.6,-0.4l2.6,-0.4l2.6,-0.5l2.6,-0.4l2.5,-0.5l2.6,-0.5l2.5,-0.5l2.6,-0.6l2.5,-0.6l2.5,-0.6l2.5,-0.6l2.5,-0.7l2.5,-0.7l2.4,-0.7l2.5,-0.7l2.4,-0.7l2.4,-0.8l2.4,-0.8l2.3,-0.8l2.4,-0.9l2.3,-0.9l2.3,-0.8l2.3,-1l2.3,-0.9l2.2,-0.9l2.2,-1l2.2,-1l2.1,-1l2.1,-1l2.1,-1.1l2.1,-1l2,-1.1l2,-1.1l2,-1.2l2,-1.1l1.9,-1.1l1.8,-1.2l1.9,-1.2l1.8,-1.2l1.8,-1.2l1.7,-1.3l1.7,-1.2l1.7,-1.3l1.6,-1.2l1.6,-1.3l1.5,-1.3l1.5,-1.3l1.5,-1.3l1.4,-1.4l1.4,-1.3l1.3,-1.4l1.3,-1.3l1.3,-1.4l1.2,-1.4l1.2,-1.4l1.1,-1.3l1.1,-1.4l1,-1.5l1,-1.4l0.9,-1.4l0.9,-1.4l0.9,-1.4l0.8,-1.5l0.8,-1.4l0.7,-1.4l0.6,-1.5l0.6,-1.4l0.6,-1.5l0.5,-1.4l0.5,-1.5l0.4,-1.4l0.4,-1.4l0.3,-1.5l0.3,-1.4l0.3,-1.5l0.1,-1.4l0.2,-1.4l0.1,-1.5l0,-1.4l0,-1.4l-0.1,-1.4l-0.1,-1.4l-0.2,-1.4l-0.2,-1.4l-0.2,-1.4l-0.3,-1.4l-0.4,-1.4l-0.4,-1.3l-0.4,-1.4l-0.5,-1.3l-0.6,-1.4l-0.6,-1.3l-0.6,-1.3l-0.7,-1.3l-0.8,-1.3l-0.7,-1.3l-0.9,-1.2l-0.9,-1.3l-0.9,-1.2Z" fill="#ff0000"/> + <path d="M431.6,1187.9l39.7,4.4c0,0,9.7,1.8,28.6,5.3c18.8,3.6,28.5,5.4,28.5,5.4l1.2,0.3c0,0,9.7,1.9,28.5,5.6c18.8,3.8,28.5,5.7,28.5,5.7l28.4,3.8L926.6,856.7c0,0,7.3,-7.8,21.7,-23C962.6,818.6,970,810.8,970,810.8L1237.5,553.7L1042.7,530.9L797.6,779.6c0,0,-7.4,7.8,-21.6,23.1c-14.3,15.2,-21.7,23,-21.7,23Z" fill="#ff0000"/> + <path d="M1614.8,2037.4l4.8,-0.1l4.8,-0.1l4.8,-0.3l4.7,-0.3l4.8,-0.4l4.8,-0.5l4.7,-0.6l4.7,-0.6l4.8,-0.8l4.7,-0.8l4.7,-1l4.6,-1l4.7,-1.1l4.6,-1.2l4.6,-1.3l4.6,-1.4l4.6,-1.5l4.5,-1.5l4.5,-1.7l4.5,-1.7l4.4,-1.8l4.4,-1.9l4.4,-2l4.3,-2l4.3,-2.1l4.2,-2.3l4.2,-2.3l4.2,-2.3l4.1,-2.5l4,-2.5l4,-2.6l4,-2.7l3.9,-2.7l3.9,-2.9l3.8,-2.9l3.7,-2.9l3.7,-3.1l3.7,-3.1l3.5,-3.2l3.6,-3.2l3.4,-3.3l3.4,-3.4l3.3,-3.4l3.3,-3.5l3.2,-3.6l3.1,-3.6l3.1,-3.7l3,-3.7l2.9,-3.8l2.8,-3.9l2.8,-3.9l2.7,-3.9l2.6,-4l2.6,-4.1l2.4,-4.1l2.4,-4.1l2.4,-4.2l2.2,-4.3l2.1,-4.2l2.1,-4.3l2,-4.4l1.9,-4.4l1.8,-4.4l1.8,-4.5l1.6,-4.5l1.6,-4.5l1.5,-4.5l1.4,-4.6l1.3,-4.6l1.2,-4.6l1.2,-4.7l1,-4.6l1,-4.7l0.9,-4.7l0.8,-4.7l0.7,-4.8l0.6,-4.7l0.5,-4.8l0.4,-4.8l0.4,-4.7l0.2,-4.8l0.2,-4.8l0,-4.8l0,-4.8l-0.1,-4.7l-0.2,-4.8l-0.3,-4.8l-0.4,-4.8l-0.5,-4.7l-0.5,-4.8l-0.7,-4.7L1865,1742l-0.8,-4.7l-1,-4.7l-1,-4.6l-1.1,-4.7l-1.2,-4.6l-1.2,-4.6l-1.4,-4.6l-1.4,-4.6l-1.6,-4.5l-1.6,-4.5l-1.7,-4.5l-1.8,-4.5l-1.8,-4.4l-2,-4.3l-2,-4.4l-2.1,-4.3l-2.2,-4.2l-2.3,-4.2l-2.3,-4.2l-2.5,-4.1l-2.5,-4.1l-2.6,-4l-2.6,-4l-2.8,-3.9l-2.8,-3.9l-2.9,-3.8l-2.9,-3.8l-3,-3.7l-3.1,-3.6l-3.2,-3.6l-3.2,-3.6l-3.3,-3.4l-3.4,-3.4l-3.4,-3.4l-3.5,-3.3l-3.5,-3.2l-3.6,-3.1l-3.7,-3.1l-3.7,-3l-3.8,-2.9l-3.8,-2.9l-3.9,-2.8l-4,-2.7l-4,-2.6l-4,-2.6l-4.1,-2.5l-4.1,-2.4l-4.2,-2.3l-4.2,-2.3l-4.3,-2.2l-4.3,-2.1l-4.3,-2l-4.4,-1.9l-4.4,-1.9l-4.5,-1.7l-4.4,-1.7l-4.6,-1.6l-4.5,-1.5l-4.6,-1.4l-4.6,-1.4l-4.6,-1.2l-4.6,-1.2l-4.7,-1l-4.7,-1l-4.7,-0.9l-4.7,-0.8l-4.7,-0.8l-4.8,-0.6l-4.7,-0.5l-4.8,-0.5l-4.8,-0.3l-4.7,-0.3l-4.8,-0.2l-4.8,-0.1l-4.8,0l-4.8,0.1l-4.8,0.2l-4.7,0.3l-4.8,0.3l-4.8,0.5l-4.7,0.5l-4.8,0.6l-4.7,0.8l-4.7,0.8l-4.7,0.9l-4.7,1l-4.7,1l-4.6,1.2l-4.6,1.2l-4.6,1.4l-4.6,1.4l-4.5,1.5l-4.5,1.6l-4.5,1.7l-4.5,1.7l-4.4,1.9l-4.4,1.9l-4.3,2l-4.3,2.1l-4.3,2.2l-4.2,2.3l-4.2,2.3l-4.1,2.4l-4.1,2.5l-4,2.6l-4,2.6l-4,2.7l-3.8,2.8l-3.9,2.9l-3.8,2.9l-3.7,3l-3.6,3.1l-3.7,3.1l-3.5,3.2l-3.5,3.3l-3.4,3.4l-3.4,3.4l-3.3,3.4l-3.2,3.6l-3.2,3.6l-3,3.6l-3.1,3.7l-2.9,3.8l-2.9,3.8l-2.8,3.9l-2.7,3.9l-2.7,4l-2.6,4l-2.5,4.1l-2.4,4.1l-2.4,4.2l-2.3,4.2l-2.2,4.2l-2.1,4.3l-2,4.4l-2,4.3l-1.8,4.4l-1.8,4.5l-1.7,4.5l-1.6,4.5l-1.6,4.5l-1.4,4.6l-1.4,4.6l-1.2,4.6l-1.2,4.6l-1.1,4.7l-1,4.6l-0.9,4.7l-0.9,4.7l-0.7,4.8l-0.7,4.7l-0.5,4.8l-0.5,4.7l-0.4,4.8l-0.3,4.8l-0.2,4.8l-0.1,4.7l0,4.8l0.1,4.8l0.1,4.8l0.3,4.8l0.3,4.7l0.4,4.8l0.5,4.8l0.7,4.7l0.7,4.8l0.7,4.7l0.9,4.7l1,4.7l1,4.6l1.2,4.7l1.2,4.6l1.3,4.6l1.4,4.6l1.5,4.5l1.6,4.5l1.6,4.5l1.8,4.5l1.8,4.4l1.9,4.4l2,4.4l2.1,4.3l2.1,4.2l2.3,4.3l2.3,4.2l2.4,4.1l2.4,4.1l2.6,4.1l2.6,4l2.7,3.9l2.8,3.9l2.8,3.9l2.9,3.8l3,3.7l3.1,3.7l3.1,3.6l3.2,3.6l3.3,3.5l3.3,3.4l3.4,3.4l3.5,3.3l3.5,3.2l3.5,3.2l3.7,3.1l3.7,3.1l3.7,2.9l3.8,2.9l3.9,2.9l3.9,2.7l4,2.7l4,2.6l4.1,2.5l4.1,2.5l4.1,2.3l4.2,2.3l4.3,2.3l4.2,2.1l4.4,2l4.3,2l4.4,1.9l4.5,1.8l4.4,1.7l4.5,1.7l4.5,1.5l4.6,1.5l4.6,1.4l4.6,1.3l4.6,1.2l4.7,1.1l4.6,1l4.7,1l4.7,0.8l4.8,0.8l4.7,0.6l4.8,0.6l4.7,0.5l4.8,0.4l4.8,0.3l4.7,0.3l4.8,0.1l4.8,0.1Z" fill="#ffffff" stroke="#ffffff" stroke-width="44"/> + <path d="M 1142,1168 L 2200,1162.3 l 0,-500.9 L 2013,677.3 c 0,0,-10.6,1.4,-31.2,4.1c-20.7,2.8,-31.3,4.2,-31.3,4.2l-142.2,31.2c0,0,-10.2,3.4,-29.9,9.9c-19.7,6.6,-29.8,9.9,-29.8,9.9L1499.4,849.5c0,0,-9,5.6,-26.6,16.6c-17.6,10.9,-26.6,16.5,-26.6,16.5l-182.9,150.8c0,0,-7.6,7.6,-22.4,22.2c-14.8,14.6,-22.4,22.1,-22.4,22.1Z" fill="#ff0000"/> + <path d="M 933.6,1457.5 L 2200,1469.1 L 2200,1333 l -1293.9,0 Z" fill="#ff0000"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_highspeed_grey.svg b/assets/client/img/product_highspeed_grey.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="2200" width="2200" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="1100" android:pivotY="1100" transform="scale(0.93, 0.93)"> + <path d="M0,2200L2200,2200L2200,0l-2200,0Z" fill="#a9a9a9"/> + <path d="M270,1203.2c0,0,-6.8,8.3,-20,24.5c-13.2,16.2,-20,24.5,-20,24.5l-47.6,60.3c0,0,-5.9,9,-17.3,26.4c-11.4,17.4,-17.3,26.3,-17.3,26.3l-58.3,108.2c0,0,-2.6,10.1,-7.6,29.8c-5,19.6,-7.6,29.7,-7.6,29.7l-0.7,87c0,0,2.4,10.2,6.9,30c4.5,19.8,6.8,30,6.8,30l7.5,15.2c0,0,6.5,8.2,19.1,24.3c12.6,16,19.1,24.3,19.1,24.3l31.3,26c0,0,8.5,5.9,24.9,17.3c16.4,11.3,24.9,17.2,24.9,17.2l1.1,0.6c0,0,9.4,3.9,27.8,11.6c18.4,7.6,27.9,11.6,27.9,11.6l49.4,13.6c0,0,10.6,1.9,31.1,5.4c20.4,3.5,31,5.3,31,5.3l36.8,2.6c0,0,10.8,0.4,31.6,1.3c20.9,0.8,31.7,1.3,31.7,1.3l1725.6,19.3l-2,-1640.9l-585.4,0.9c0,0,-10.7,0.5,-31.5,1.6c-20.9,1.1,-31.6,1.6,-31.6,1.6l-196.4,20c0,0,-10.4,2.3,-30.7,6.8c-20.3,4.4,-30.7,6.7,-30.7,6.7l-111.3,38.2c0,0,-9.8,4.4,-28.7,13c-18.9,8.6,-28.7,13,-28.7,13l-62.7,36c0,0,-8.8,6.2,-25.9,18c-17.1,11.9,-25.9,18,-25.9,18L936.1,528.9c0,0,-7.8,7.4,-23,21.6c-15.2,14.3,-23,21.6,-23,21.6L675.9,799c0,0,-7.2,8,-21.1,23.6c-13.9,15.6,-21,23.6,-21,23.6Z" fill="#ffffff"/> + <path d="M528.4,1342.5l-0.9,-1.3l-1.1,-1.2l-1,-1.2l-1.1,-1.1l-1.2,-1.2l-1.2,-1.1l-1.2,-1.2l-1.3,-1.1l-1.3,-1.1l-1.4,-1l-1.4,-1.1l-1.4,-1l-1.5,-1.1l-1.5,-1l-1.6,-0.9l-1.6,-1l-1.6,-0.9l-1.7,-0.9l-1.7,-0.9l-1.8,-0.9l-1.8,-0.9l-1.8,-0.8l-1.9,-0.8l-1.9,-0.8l-1.9,-0.8l-1.9,-0.7l-2,-0.7l-2.1,-0.7l-2,-0.7l-2.1,-0.6l-2.1,-0.6l-2.1,-0.6l-2.2,-0.6l-2.2,-0.5l-2.2,-0.6l-2.3,-0.5l-2.2,-0.4l-2.3,-0.5l-2.4,-0.4l-2.3,-0.4l-2.3,-0.3l-2.4,-0.4l-2.4,-0.3l-2.4,-0.3l-2.5,-0.2l-2.4,-0.2l-2.5,-0.2l-2.5,-0.2l-2.5,-0.2l-2.5,-0.1l-2.5,-0.1l-2.5,-0.1l-2.6,0l-2.5,0l-2.6,0l-2.6,0.1l-2.5,0l-2.6,0.1l-2.6,0.1l-2.6,0.2l-2.6,0.2L404,1307l-2.6,0.2l-2.6,0.3l-2.6,0.3l-2.6,0.3l-2.6,0.3l-2.6,0.4l-2.5,0.4l-2.6,0.4l-2.6,0.4l-2.6,0.5l-2.5,0.5l-2.6,0.5l-2.5,0.6l-2.6,0.5l-2.5,0.6l-2.5,0.6l-2.5,0.7l-2.5,0.7l-2.4,0.7l-2.5,0.7l-2.4,0.7l-2.4,0.8l-2.4,0.8l-2.4,0.8l-2.4,0.8l-2.3,0.9l-2.3,0.8l-2.3,0.9l-2.3,1l-2.2,0.9l-2.2,1l-2.2,0.9l-2.2,1l-2.1,1.1l-2.1,1l-2.1,1.1l-2.1,1l-2,1.1l-2,1.1l-1.9,1.2l-2,1.1l-1.9,1.2l-1.8,1.1l-1.8,1.2l-1.8,1.3l-1.8,1.2l-1.7,1.2l-1.7,1.3l-1.6,1.2l-1.6,1.3l-1.6,1.3l-1.5,1.3l-1.5,1.3l-1.4,1.3l-1.4,1.4l-1.4,1.3l-1.3,1.4l-1.3,1.3l-1.2,1.4l-1.2,1.4l-1.2,1.4l-1.1,1.4l-1,1.4l-1,1.4l-1,1.4l-0.9,1.4l-0.9,1.5l-0.8,1.4l-0.8,1.4l-0.7,1.5l-0.7,1.4l-0.7,1.4l-0.6,1.5l-0.5,1.4l-0.5,1.5l-0.5,1.4l-0.4,1.5l-0.3,1.4l-0.3,1.4l-0.3,1.5l-0.2,1.4l-0.1,1.5l-0.2,1.4l0,1.4l0,1.4l0,1.5l0.1,1.4l0.1,1.4l0.2,1.4l0.2,1.4l0.3,1.4l0.4,1.3l0.3,1.4l0.5,1.4l0.4,1.3l0.6,1.3l0.5,1.4l0.7,1.3l0.6,1.3l0.7,1.3l0.8,1.3l0.8,1.3l0.9,1.2l0.9,1.3l0.9,1.2l1,1.2l1.1,1.2l1,1.2l1.2,1.2l1.1,1.1l1.2,1.1l1.3,1.2l1.3,1.1l1.3,1l1.4,1.1l1.5,1.1l1.4,1l1.5,1l1.6,1l1.6,1l1.6,0.9l1.6,0.9l1.7,0.9l1.8,0.9l1.8,0.9l1.8,0.8l1.8,0.8l1.9,0.8l1.9,0.8l1.9,0.8l2,0.7l2,0.7l2.1,0.7l2,0.6l2.1,0.7l2.1,0.6l2.2,0.6l2.2,0.5l2.2,0.5l2.2,0.5l2.3,0.5l2.3,0.5l2.3,0.4l2.3,0.4l2.3,0.4l2.4,0.3l2.4,0.4l2.4,0.3l2.4,0.2l2.5,0.3l2.4,0.2l2.5,0.2l2.5,0.1l2.5,0.2l2.5,0.1l2.5,0.1l2.6,0l2.5,0l2.6,0l2.5,0l2.6,0l2.6,-0.1l2.6,-0.1l2.6,-0.2l2.6,-0.1l2.5,-0.2l2.6,-0.3l2.6,-0.2l2.6,-0.3l2.6,-0.3l2.6,-0.3l2.6,-0.3l2.6,-0.4l2.6,-0.4l2.6,-0.5l2.6,-0.4l2.5,-0.5l2.6,-0.5l2.5,-0.5l2.6,-0.6l2.5,-0.6l2.5,-0.6l2.5,-0.6l2.5,-0.7l2.5,-0.7l2.4,-0.7l2.5,-0.7l2.4,-0.7l2.4,-0.8l2.4,-0.8l2.3,-0.8l2.4,-0.9l2.3,-0.9l2.3,-0.8l2.3,-1l2.3,-0.9l2.2,-0.9l2.2,-1l2.2,-1l2.1,-1l2.1,-1l2.1,-1.1l2.1,-1l2,-1.1l2,-1.1l2,-1.2l2,-1.1l1.9,-1.1l1.8,-1.2l1.9,-1.2l1.8,-1.2l1.8,-1.2l1.7,-1.3l1.7,-1.2l1.7,-1.3l1.6,-1.2l1.6,-1.3l1.5,-1.3l1.5,-1.3l1.5,-1.3l1.4,-1.4l1.4,-1.3l1.3,-1.4l1.3,-1.3l1.3,-1.4l1.2,-1.4l1.2,-1.4l1.1,-1.3l1.1,-1.4l1,-1.5l1,-1.4l0.9,-1.4l0.9,-1.4l0.9,-1.4l0.8,-1.5l0.8,-1.4l0.7,-1.4l0.6,-1.5l0.6,-1.4l0.6,-1.5l0.5,-1.4l0.5,-1.5l0.4,-1.4l0.4,-1.4l0.3,-1.5l0.3,-1.4l0.3,-1.5l0.1,-1.4l0.2,-1.4l0.1,-1.5l0,-1.4l0,-1.4l-0.1,-1.4l-0.1,-1.4l-0.2,-1.4l-0.2,-1.4l-0.2,-1.4l-0.3,-1.4l-0.4,-1.4l-0.4,-1.3l-0.4,-1.4l-0.5,-1.3l-0.6,-1.4l-0.6,-1.3l-0.6,-1.3l-0.7,-1.3l-0.8,-1.3l-0.7,-1.3l-0.9,-1.2l-0.9,-1.3l-0.9,-1.2Z" fill="#a9a9a9"/> + <path d="M431.6,1187.9l39.7,4.4c0,0,9.7,1.8,28.6,5.3c18.8,3.6,28.5,5.4,28.5,5.4l1.2,0.3c0,0,9.7,1.9,28.5,5.6c18.8,3.8,28.5,5.7,28.5,5.7l28.4,3.8L926.6,856.7c0,0,7.3,-7.8,21.7,-23C962.6,818.6,970,810.8,970,810.8L1237.5,553.7L1042.7,530.9L797.6,779.6c0,0,-7.4,7.8,-21.6,23.1c-14.3,15.2,-21.7,23,-21.7,23Z" fill="#a9a9a9"/> + <path d="M1614.8,2037.4l4.8,-0.1l4.8,-0.1l4.8,-0.3l4.7,-0.3l4.8,-0.4l4.8,-0.5l4.7,-0.6l4.7,-0.6l4.8,-0.8l4.7,-0.8l4.7,-1l4.6,-1l4.7,-1.1l4.6,-1.2l4.6,-1.3l4.6,-1.4l4.6,-1.5l4.5,-1.5l4.5,-1.7l4.5,-1.7l4.4,-1.8l4.4,-1.9l4.4,-2l4.3,-2l4.3,-2.1l4.2,-2.3l4.2,-2.3l4.2,-2.3l4.1,-2.5l4,-2.5l4,-2.6l4,-2.7l3.9,-2.7l3.9,-2.9l3.8,-2.9l3.7,-2.9l3.7,-3.1l3.7,-3.1l3.5,-3.2l3.6,-3.2l3.4,-3.3l3.4,-3.4l3.3,-3.4l3.3,-3.5l3.2,-3.6l3.1,-3.6l3.1,-3.7l3,-3.7l2.9,-3.8l2.8,-3.9l2.8,-3.9l2.7,-3.9l2.6,-4l2.6,-4.1l2.4,-4.1l2.4,-4.1l2.4,-4.2l2.2,-4.3l2.1,-4.2l2.1,-4.3l2,-4.4l1.9,-4.4l1.8,-4.4l1.8,-4.5l1.6,-4.5l1.6,-4.5l1.5,-4.5l1.4,-4.6l1.3,-4.6l1.2,-4.6l1.2,-4.7l1,-4.6l1,-4.7l0.9,-4.7l0.8,-4.7l0.7,-4.8l0.6,-4.7l0.5,-4.8l0.4,-4.8l0.4,-4.7l0.2,-4.8l0.2,-4.8l0,-4.8l0,-4.8l-0.1,-4.7l-0.2,-4.8l-0.3,-4.8l-0.4,-4.8l-0.5,-4.7l-0.5,-4.8l-0.7,-4.7L1865,1742l-0.8,-4.7l-1,-4.7l-1,-4.6l-1.1,-4.7l-1.2,-4.6l-1.2,-4.6l-1.4,-4.6l-1.4,-4.6l-1.6,-4.5l-1.6,-4.5l-1.7,-4.5l-1.8,-4.5l-1.8,-4.4l-2,-4.3l-2,-4.4l-2.1,-4.3l-2.2,-4.2l-2.3,-4.2l-2.3,-4.2l-2.5,-4.1l-2.5,-4.1l-2.6,-4l-2.6,-4l-2.8,-3.9l-2.8,-3.9l-2.9,-3.8l-2.9,-3.8l-3,-3.7l-3.1,-3.6l-3.2,-3.6l-3.2,-3.6l-3.3,-3.4l-3.4,-3.4l-3.4,-3.4l-3.5,-3.3l-3.5,-3.2l-3.6,-3.1l-3.7,-3.1l-3.7,-3l-3.8,-2.9l-3.8,-2.9l-3.9,-2.8l-4,-2.7l-4,-2.6l-4,-2.6l-4.1,-2.5l-4.1,-2.4l-4.2,-2.3l-4.2,-2.3l-4.3,-2.2l-4.3,-2.1l-4.3,-2l-4.4,-1.9l-4.4,-1.9l-4.5,-1.7l-4.4,-1.7l-4.6,-1.6l-4.5,-1.5l-4.6,-1.4l-4.6,-1.4l-4.6,-1.2l-4.6,-1.2l-4.7,-1l-4.7,-1l-4.7,-0.9l-4.7,-0.8l-4.7,-0.8l-4.8,-0.6l-4.7,-0.5l-4.8,-0.5l-4.8,-0.3l-4.7,-0.3l-4.8,-0.2l-4.8,-0.1l-4.8,0l-4.8,0.1l-4.8,0.2l-4.7,0.3l-4.8,0.3l-4.8,0.5l-4.7,0.5l-4.8,0.6l-4.7,0.8l-4.7,0.8l-4.7,0.9l-4.7,1l-4.7,1l-4.6,1.2l-4.6,1.2l-4.6,1.4l-4.6,1.4l-4.5,1.5l-4.5,1.6l-4.5,1.7l-4.5,1.7l-4.4,1.9l-4.4,1.9l-4.3,2l-4.3,2.1l-4.3,2.2l-4.2,2.3l-4.2,2.3l-4.1,2.4l-4.1,2.5l-4,2.6l-4,2.6l-4,2.7l-3.8,2.8l-3.9,2.9l-3.8,2.9l-3.7,3l-3.6,3.1l-3.7,3.1l-3.5,3.2l-3.5,3.3l-3.4,3.4l-3.4,3.4l-3.3,3.4l-3.2,3.6l-3.2,3.6l-3,3.6l-3.1,3.7l-2.9,3.8l-2.9,3.8l-2.8,3.9l-2.7,3.9l-2.7,4l-2.6,4l-2.5,4.1l-2.4,4.1l-2.4,4.2l-2.3,4.2l-2.2,4.2l-2.1,4.3l-2,4.4l-2,4.3l-1.8,4.4l-1.8,4.5l-1.7,4.5l-1.6,4.5l-1.6,4.5l-1.4,4.6l-1.4,4.6l-1.2,4.6l-1.2,4.6l-1.1,4.7l-1,4.6l-0.9,4.7l-0.9,4.7l-0.7,4.8l-0.7,4.7l-0.5,4.8l-0.5,4.7l-0.4,4.8l-0.3,4.8l-0.2,4.8l-0.1,4.7l0,4.8l0.1,4.8l0.1,4.8l0.3,4.8l0.3,4.7l0.4,4.8l0.5,4.8l0.7,4.7l0.7,4.8l0.7,4.7l0.9,4.7l1,4.7l1,4.6l1.2,4.7l1.2,4.6l1.3,4.6l1.4,4.6l1.5,4.5l1.6,4.5l1.6,4.5l1.8,4.5l1.8,4.4l1.9,4.4l2,4.4l2.1,4.3l2.1,4.2l2.3,4.3l2.3,4.2l2.4,4.1l2.4,4.1l2.6,4.1l2.6,4l2.7,3.9l2.8,3.9l2.8,3.9l2.9,3.8l3,3.7l3.1,3.7l3.1,3.6l3.2,3.6l3.3,3.5l3.3,3.4l3.4,3.4l3.5,3.3l3.5,3.2l3.5,3.2l3.7,3.1l3.7,3.1l3.7,2.9l3.8,2.9l3.9,2.9l3.9,2.7l4,2.7l4,2.6l4.1,2.5l4.1,2.5l4.1,2.3l4.2,2.3l4.3,2.3l4.2,2.1l4.4,2l4.3,2l4.4,1.9l4.5,1.8l4.4,1.7l4.5,1.7l4.5,1.5l4.6,1.5l4.6,1.4l4.6,1.3l4.6,1.2l4.7,1.1l4.6,1l4.7,1l4.7,0.8l4.8,0.8l4.7,0.6l4.8,0.6l4.7,0.5l4.8,0.4l4.8,0.3l4.7,0.3l4.8,0.1l4.8,0.1Z" fill="#ffffff" stroke="#ffffff" stroke-width="44"/> + <path d="M 1142,1168 L 2200,1162.3 l 0,-500.9 L 2013,677.3 c 0,0,-10.6,1.4,-31.2,4.1c-20.7,2.8,-31.3,4.2,-31.3,4.2l-142.2,31.2c0,0,-10.2,3.4,-29.9,9.9c-19.7,6.6,-29.8,9.9,-29.8,9.9L1499.4,849.5c0,0,-9,5.6,-26.6,16.6c-17.6,10.9,-26.6,16.5,-26.6,16.5l-182.9,150.8c0,0,-7.6,7.6,-22.4,22.2c-14.8,14.6,-22.4,22.1,-22.4,22.1Z" fill="#a9a9a9"/> + <path d="M 933.6,1457.5 L 2200,1469.1 L 2200,1333 l -1293.9,0 Z" fill="#a9a9a9"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_suburban_color.svg b/assets/client/img/product_suburban_color.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="353" width="353" xmlns="http://www.w3.org/2000/svg"> + + <g transform="translate(-12, -12) scale(1.07, 1.07)"> + <path d="M175.4,341.586c-91.5,0-165.899-74.399-165.899-165.9c0-91.5,74.399-165.9,165.899-165.9 c91.501,0,165.901,74.4,165.901,165.9C341.303,267.187,266.901,341.586,175.4,341.586z" fill="#006f35"/> + <path d="M133.4,102.186c0-14.4,13.2-26.7,36.301-26.7c40.8,0,75.6,21.9,98.7,46.8v-43.5 c-26.7-20.7-60.301-33-97.801-33c-45,0-95.1,27.601-95.1,78.9c0,97.801,148.5,62.701,148.5,119.4c0,15-19.799,29.101-44.399,29.101 c-40.2,0-80.1-24.3-102-55.8v52.199c23.1,20.7,65.4,37.2,102,37.2c65.7,0,104.701-46.801,104.701-87.001 C284.303,120.186,133.4,162.784,133.4,102.186z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_suburban_grey.svg b/assets/client/img/product_suburban_grey.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="353" width="353" xmlns="http://www.w3.org/2000/svg"> + + <g transform="translate(-12, -12) scale(1.07, 1.07)"> + <path d="M175.4,341.586c-91.5,0-165.899-74.399-165.899-165.9c0-91.5,74.399-165.9,165.899-165.9 c91.501,0,165.901,74.4,165.901,165.9C341.303,267.187,266.901,341.586,175.4,341.586z" fill="#a9a9a9"/> + <path d="M133.4,102.186c0-14.4,13.2-26.7,36.301-26.7c40.8,0,75.6,21.9,98.7,46.8v-43.5 c-26.7-20.7-60.301-33-97.801-33c-45,0-95.1,27.601-95.1,78.9c0,97.801,148.5,62.701,148.5,119.4c0,15-19.799,29.101-44.399,29.101 c-40.2,0-80.1-24.3-102-55.8v52.199c23.1,20.7,65.4,37.2,102,37.2c65.7,0,104.701-46.801,104.701-87.001 C284.303,120.186,133.4,162.784,133.4,102.186z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_subway_color.svg b/assets/client/img/product_subway_color.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="378.32739" width="377.93851" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="189" android:pivotY="189" transform="scale(0.93, 0.93)"> + <g transform="translate(-161.03075, -343.19849)"> + <path d="M 161.03075,721.52588 L 538.96925,721.52588 L 538.96925,343.19849 L 161.03075,343.19849 L 161.03075,721.52588 z" fill="#156ab8"/> + <path d="M 477.26972,373.06996 L 477.26972,577.95324 C 477.26972,663.70307 407.03895,695.1301 349.60504,695.1301 C 291.79439,695.1301 222.73028,663.70307 222.73028,577.95324 L 222.73028,373.06996 L 297.22667,373.06996 L 297.22667,570.57652 C 297.22667,606.6702 310.03567,632.27605 349.60504,632.27605 C 388.79767,632.27605 401.60667,606.6702 401.60667,570.57652 L 401.60667,373.06996 L 477.26972,373.06996" fill="#ffffff"/> + </g> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_subway_grey.svg b/assets/client/img/product_subway_grey.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="378.32739" width="377.93851" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="189" android:pivotY="189" transform="scale(0.93, 0.93)"> + <g transform="translate(-161.03075, -343.19849)"> + <path d="M 161.03075,721.52588 L 538.96925,721.52588 L 538.96925,343.19849 L 161.03075,343.19849 L 161.03075,721.52588 z" fill="#a9a9a9"/> + <path d="M 477.26972,373.06996 L 477.26972,577.95324 C 477.26972,663.70307 407.03895,695.1301 349.60504,695.1301 C 291.79439,695.1301 222.73028,663.70307 222.73028,577.95324 L 222.73028,373.06996 L 297.22667,373.06996 L 297.22667,570.57652 C 297.22667,606.6702 310.03567,632.27605 349.60504,632.27605 C 388.79767,632.27605 401.60667,606.6702 401.60667,570.57652 L 401.60667,373.06996 L 477.26972,373.06996" fill="#ffffff"/> + </g> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_train_color.svg b/assets/client/img/product_train_color.svg @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="173.43799" width="173.45215" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 0,86.71875 C 0,38.82764 38.83301,0 86.71924,0 C 134.61914,0 173.45215,38.82764 173.45215,86.71875 C 173.45215,134.61914 134.61914,173.43799 86.71924,173.43799 C 38.83301,173.43799 0,134.61914 0,86.71875 z" fill="#444444"/> + <path d="M 74.12256,41.30908 C 76.16358,40.76172 80.04053,40.38086 86.14356,40.38086 C 99.24952,40.38086 106.83252,46.66065 106.83252,58.68164 C 106.83252,69.94189 98.5127,77.52002 84.64941,77.52002 L 74.12256,77.52002 L 74.12256,41.30908 z M 48.44385,146.25977 L 74.12256,146.25977 L 74.12256,96.54785 L 82.62354,96.54785 C 94.0835,96.54785 99.24952,101.18164 102.58448,117.0708 C 105.91456,132.22217 108.87354,142.74902 110.70948,146.25976 L 137.31055,146.25976 C 134.92383,141.45996 131.4126,125.93798 127.71143,111.51904 C 124.75245,99.51172 119.7627,91.20166 111.09034,87.68066 L 111.09034,87.31982 C 122.35938,83.07177 132.70167,71.80175 132.70167,56.45996 C 132.70167,45.19092 129.01075,36.68017 121.81251,30.59082 C 113.11183,23.56982 100.55372,20.80078 83.17042,20.80078 C 69.69386,20.80078 57.12062,21.90967 48.44386,23.3789 L 48.44386,146.25977 L 48.44385,146.25977 z" fill="#ffffff"/> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_train_grey.svg b/assets/client/img/product_train_grey.svg @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="173.43799" width="173.45215" xmlns="http://www.w3.org/2000/svg"> + + <path d="M 0,86.71875 C 0,38.82764 38.83301,0 86.71924,0 C 134.61914,0 173.45215,38.82764 173.45215,86.71875 C 173.45215,134.61914 134.61914,173.43799 86.71924,173.43799 C 38.83301,173.43799 0,134.61914 0,86.71875 z" fill="#a9a9a9"/> + <path d="M 74.12256,41.30908 C 76.16358,40.76172 80.04053,40.38086 86.14356,40.38086 C 99.24952,40.38086 106.83252,46.66065 106.83252,58.68164 C 106.83252,69.94189 98.5127,77.52002 84.64941,77.52002 L 74.12256,77.52002 L 74.12256,41.30908 z M 48.44385,146.25977 L 74.12256,146.25977 L 74.12256,96.54785 L 82.62354,96.54785 C 94.0835,96.54785 99.24952,101.18164 102.58448,117.0708 C 105.91456,132.22217 108.87354,142.74902 110.70948,146.25976 L 137.31055,146.25976 C 134.92383,141.45996 131.4126,125.93798 127.71143,111.51904 C 124.75245,99.51172 119.7627,91.20166 111.09034,87.68066 L 111.09034,87.31982 C 122.35938,83.07177 132.70167,71.80175 132.70167,56.45996 C 132.70167,45.19092 129.01075,36.68017 121.81251,30.59082 C 113.11183,23.56982 100.55372,20.80078 83.17042,20.80078 C 69.69386,20.80078 57.12062,21.90967 48.44386,23.3789 L 48.44386,146.25977 L 48.44385,146.25977 z" fill="#ffffff"/> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_tram_color.svg b/assets/client/img/product_tram_color.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="250" android:pivotY="250" transform="scale(0.93, 0.93)"> + <path d="M 0 0 H 500 V 500 H 0 V 0 Z" fill="#cc0000"/> + <path d="M236.84211 309.54433C242.87491 307.23053 246.2628 304.71845 250.26316 299.59283L252.63158 296.55819L252.64317 299.59488C252.64954 301.26506 252.94836 304.40789 253.30721 306.57895L253.95966 310.52632L269.61141 310.52632L285.26316 310.52632L285.26316 269.13842C285.26316 223.28869 284.96553 220.73711 278.65722 212.50687C274.36993 206.91337 266.64305 201.57325 259.63885 199.36309C248.03721 195.70221 220.94597 196.55513 205 201.08328L201.05263 202.20422L201.05263 214.69104L201.05263 227.17787L206.57895 225.59944C209.67357 224.71556 218.58978 223.78563 226.84211 223.48608C241.06839 222.96968 241.70605 223.03788 245.24782 225.45454C249.67142 228.47291 251.54267 231.87779 251.56343 236.94633L251.57895 240.73476L238.15789 241.36913C218.14543 242.31505 206.23052 246.05151 198.21906 253.89371C191.52335 260.44798 189.12683 266.95753 189.18925 278.42105C189.25907 291.24387 191.88315 298.18559 199.12019 304.69232C202.04511 307.32206 204.74225 309.49459 205.11384 309.52014C205.48544 309.54569 208.15789 310.25471 211.05263 311.09573C217.94161 313.0972 229.37134 312.40963 236.84211 309.54433 zM227.74009 288.56112C223.69319 286.01706 221.66013 280.46752 222.393 273.96545C223.45626 264.5322 229.63667 260.15049 243.18928 259.22158L251.57895 258.64654L251.57895 267.52128C251.57895 281.84023 246.49055 289.31224 236.13104 290.20558C232.33376 290.53303 230.21698 290.11819 227.74009 288.56112 zM94.736842 247.36842L94.736842 184.21053L113.15789 184.21053L131.57895 184.21053L131.57895 168.94737L131.57895 153.68421L75.263158 153.68421L18.947368 153.68421L18.947368 168.94737L18.947368 184.21053L35.789474 184.21053L52.631579 184.21053L52.631579 247.36842L52.631579 310.52632L73.684211 310.52632L94.736842 310.52632L94.736842 247.36842 zM156.84211 284.40385C156.84211 256.11702 157.73126 248.16673 161.65084 241.4074C165.60996 234.57986 170.26548 232.29012 181.25655 231.76462L190.52632 231.32143L190.52632 213.93641L190.52632 196.55138L183.82933 197.23751C173.52437 198.29328 168.06611 200.58661 163.14078 205.92997C160.74684 208.52707 157.90967 212.61417 156.83596 215.01241C155.02281 219.0622 154.84484 219.18895 154.33781 216.79167C154.03756 215.37204 153.49313 211.01316 153.12796 207.10526L152.46401 200L135.70569 200L118.94737 200L118.94737 255.26316L118.94737 310.52632L137.89474 310.52632L156.84211 310.52632L156.84211 284.40385 zM344.21053 276.80829C344.21053 241.15109 344.51344 238.59935 349.24671 234.38447C351.70355 232.19671 358.52479 230.98046 362.60065 232.00344C364.10095 232.37999 366.25937 234.21484 367.39714 236.08088C369.34552 239.27638 369.46604 241.53967 369.46975 275L369.47368 310.52632L387.89474 310.52632L406.31579 310.52632L406.33891 277.10526C406.36004 246.55078 406.53352 243.30648 408.36145 239.28034C411.85313 231.58967 422.05512 228.92157 428.0992 234.11836L431.05263 236.65777L431.35465 273.59204L431.65666 310.52632L450.61805 310.52632L469.57943 310.52632L469.26006 266.05263C468.94942 222.7942 468.87746 221.44319 466.62669 216.61084C463.3302 209.53337 456.65885 202.74525 450.239 199.93633C443.09997 196.81274 429.50151 196.52125 421.34712 199.31703C415.5562 201.30247 406.78328 208.35064 404.27935 213.02929L402.81111 215.77274L399.41978 210.73689C389.35103 195.78567 366.63977 192.73674 350.57059 204.179C348.90903 205.36214 346.3246 208.78835 344.82742 211.79281L342.10526 217.25546L342.10526 208.62773L342.10526 200L324.21053 200L306.31579 200L306.31579 255.26316L306.31579 310.52632L325.26316 310.52632L344.21053 310.52632L344.21053 276.80829 z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/product_tram_grey.svg b/assets/client/img/product_tram_grey.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?><svg xmlns:android="http://schemas.android.com/apk/res/android" height="500" width="500" xmlns="http://www.w3.org/2000/svg"> + + <g android:pivotX="250" android:pivotY="250" transform="scale(0.93, 0.93)"> + <path d="M 0 0 H 500 V 500 H 0 V 0 Z" fill="#a9a9a9"/> + <path d="M236.84211 309.54433C242.87491 307.23053 246.2628 304.71845 250.26316 299.59283L252.63158 296.55819L252.64317 299.59488C252.64954 301.26506 252.94836 304.40789 253.30721 306.57895L253.95966 310.52632L269.61141 310.52632L285.26316 310.52632L285.26316 269.13842C285.26316 223.28869 284.96553 220.73711 278.65722 212.50687C274.36993 206.91337 266.64305 201.57325 259.63885 199.36309C248.03721 195.70221 220.94597 196.55513 205 201.08328L201.05263 202.20422L201.05263 214.69104L201.05263 227.17787L206.57895 225.59944C209.67357 224.71556 218.58978 223.78563 226.84211 223.48608C241.06839 222.96968 241.70605 223.03788 245.24782 225.45454C249.67142 228.47291 251.54267 231.87779 251.56343 236.94633L251.57895 240.73476L238.15789 241.36913C218.14543 242.31505 206.23052 246.05151 198.21906 253.89371C191.52335 260.44798 189.12683 266.95753 189.18925 278.42105C189.25907 291.24387 191.88315 298.18559 199.12019 304.69232C202.04511 307.32206 204.74225 309.49459 205.11384 309.52014C205.48544 309.54569 208.15789 310.25471 211.05263 311.09573C217.94161 313.0972 229.37134 312.40963 236.84211 309.54433 zM227.74009 288.56112C223.69319 286.01706 221.66013 280.46752 222.393 273.96545C223.45626 264.5322 229.63667 260.15049 243.18928 259.22158L251.57895 258.64654L251.57895 267.52128C251.57895 281.84023 246.49055 289.31224 236.13104 290.20558C232.33376 290.53303 230.21698 290.11819 227.74009 288.56112 zM94.736842 247.36842L94.736842 184.21053L113.15789 184.21053L131.57895 184.21053L131.57895 168.94737L131.57895 153.68421L75.263158 153.68421L18.947368 153.68421L18.947368 168.94737L18.947368 184.21053L35.789474 184.21053L52.631579 184.21053L52.631579 247.36842L52.631579 310.52632L73.684211 310.52632L94.736842 310.52632L94.736842 247.36842 zM156.84211 284.40385C156.84211 256.11702 157.73126 248.16673 161.65084 241.4074C165.60996 234.57986 170.26548 232.29012 181.25655 231.76462L190.52632 231.32143L190.52632 213.93641L190.52632 196.55138L183.82933 197.23751C173.52437 198.29328 168.06611 200.58661 163.14078 205.92997C160.74684 208.52707 157.90967 212.61417 156.83596 215.01241C155.02281 219.0622 154.84484 219.18895 154.33781 216.79167C154.03756 215.37204 153.49313 211.01316 153.12796 207.10526L152.46401 200L135.70569 200L118.94737 200L118.94737 255.26316L118.94737 310.52632L137.89474 310.52632L156.84211 310.52632L156.84211 284.40385 zM344.21053 276.80829C344.21053 241.15109 344.51344 238.59935 349.24671 234.38447C351.70355 232.19671 358.52479 230.98046 362.60065 232.00344C364.10095 232.37999 366.25937 234.21484 367.39714 236.08088C369.34552 239.27638 369.46604 241.53967 369.46975 275L369.47368 310.52632L387.89474 310.52632L406.31579 310.52632L406.33891 277.10526C406.36004 246.55078 406.53352 243.30648 408.36145 239.28034C411.85313 231.58967 422.05512 228.92157 428.0992 234.11836L431.05263 236.65777L431.35465 273.59204L431.65666 310.52632L450.61805 310.52632L469.57943 310.52632L469.26006 266.05263C468.94942 222.7942 468.87746 221.44319 466.62669 216.61084C463.3302 209.53337 456.65885 202.74525 450.239 199.93633C443.09997 196.81274 429.50151 196.52125 421.34712 199.31703C415.5562 201.30247 406.78328 208.35064 404.27935 213.02929L402.81111 215.77274L399.41978 210.73689C389.35103 195.78567 366.63977 192.73674 350.57059 204.179C348.90903 205.36214 346.3246 208.78835 344.82742 211.79281L342.10526 217.25546L342.10526 208.62773L342.10526 200L324.21053 200L306.31579 200L306.31579 255.26316L306.31579 310.52632L325.26316 310.52632L344.21053 310.52632L344.21053 276.80829 z" fill="#ffffff"/> + </g> + +</svg>+ \ No newline at end of file
diff --git a/assets/client/img/travelynx.svg b/assets/client/img/travelynx.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="24" + height="24" + viewBox="0 0 24 24" + version="1.1" + id="svg6" + sodipodi:docname="travelynx.svg" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + <metadata + id="metadata12"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs10" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1918" + inkscape:window-height="2131" + id="namedview8" + showgrid="false" + inkscape:zoom="19.666667" + inkscape:cx="0.25717638" + inkscape:cy="10.252251" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="g4573" /> + <g + id="g4573"> + <rect + y="3.40678" + x="3.1271186" + height="9.5338984" + width="10.550848" + id="rect4564" + style="fill:#ffffff;fill-opacity:1;stroke-width:1.44797695" /> + <g + id="g4562"> + <path + d="m 8.4266298,1.3049637 c -3.0613961,0 -6.1227924,0.3826745 -6.1227924,3.0613962 v 7.2708161 c 0,1.477124 1.2015981,2.678722 2.6787217,2.678722 l -1.1480235,1.148023 v 0.382675 H 5.5412639 L 7.071962,14.315898 h 2.8853658 l 1.5306982,1.530698 h 1.530698 V 15.463921 L 11.8707,14.315898 c 1.477124,0 2.678722,-1.201598 2.678722,-2.678722 V 4.3663599 c 0,-2.6787217 -2.73995,-3.0613962 -6.1227922,-3.0613962 z M 4.9825591,12.7852 c -0.6352397,0 -1.1480235,-0.512784 -1.1480235,-1.148024 0,-0.63524 0.5127838,-1.148024 1.1480235,-1.148024 0.6352397,0 1.1480236,0.512784 1.1480236,1.148024 0,0.63524 -0.5127839,1.148024 -1.1480236,1.148024 z M 7.6612808,7.427756 H 3.8345356 V 4.3663599 h 3.8267452 z m 1.5306982,0 V 4.3663599 h 3.826745 V 7.427756 Z M 11.8707,12.7852 c -0.635239,0 -1.148023,-0.512784 -1.148023,-1.148024 0,-0.63524 0.512784,-1.148024 1.148023,-1.148024 0.63524,0 1.148024,0.512784 1.148024,1.148024 0,0.63524 -0.512784,1.148024 -1.148024,1.148024 z" + id="path14" + inkscape:connector-curvature="0" + style="stroke-width:0.76534903" /> + <path + style="fill:none" + inkscape:connector-curvature="0" + d="M 0,0 H 24 V 24 H 0 Z" + id="path16" /> + <path + inkscape:connector-curvature="0" + d="M 13.208696,20.997167 9.6183022,17.406774 8.3956743,18.620792 13.208696,23.433813 23.540763,13.101746 22.326745,11.887728 Z" + id="path16-3" + style="stroke-width:0.8610056" /> + </g> + </g> +</svg>
diff --git a/assets/client/img/warning-24px.svg b/assets/client/img/warning-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>+ \ No newline at end of file
diff --git a/assets/client/index.html b/assets/client/index.html @@ -0,0 +1,92 @@ +<!DOCTYPE html> +<html lang="de"> + <head> + <title>oeffisear.ch BETA</title> + <meta charset="UTF-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#ffffff"> + <meta name="description" content="Plan your public transport journeys"> + <meta name="apple-mobile-web-app-capable" content="yes"> + <meta name="apple-mobile-web-app-title" content="Öffisearch"> + <meta name="format-detection" content="telephone=no"> + + <link rel="apple-touch-startup-image" sizes="512x512" href="img/favicon-512x512.png"> + <link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png"> + + <link rel="icon" type="image/png" sizes="64x64" href="img/favicon-64x64.png"> + <link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png"> + + <link rel="mask-icon" href="img/safari-pinned-tab.svg" color="#s"> + + <link rel="stylesheet" type="text/css" href="css/product_selector.css" defer> + <link rel="stylesheet" type="text/css" href="css/style.css" defer> + + <link rel="modulepreload" href="js/api.js"> + <link rel="modulepreload" href="js/sprintf.min.js"> + <link rel="modulepreload" href="js/languages.js"> + <link rel="modulepreload" href="js/app_functions.js"> + <link rel="modulepreload" href="js/canvas.js"> + <link rel="modulepreload" href="js/helpers.js"> + <link rel="modulepreload" href="js/journeysView.js"> + <link rel="modulepreload" href="js/journeyView.js"> + <link rel="modulepreload" href="js/lit-html.js"> + <link rel="modulepreload" href="js/overlays.js"> + <link rel="modulepreload" href="js/router.js"> + <link rel="modulepreload" href="js/searchView.js"> + <link rel="modulepreload" href="js/settingsView.js"> + <link rel="modulepreload" href="js/languages.js"> + + <link rel="manifest" href="manifest.json"> + <style> +body { + background-image: url("img/bg.webp"); + background-size: cover; + background-attachment: fixed; + min-height: 100vh; + overflow-x: hidden; + overflow-y: visible; +} + +#overlay { + position: fixed; + top: 0; + left: 0; + height: 100vh; + width: 100vw; + background-color: rgba(0, 0, 0, .7); + overflow: hidden; + display: flex; +} + +#overlay>* { + margin: auto; +} + +#logo { + background-color: #7171e5; + border-radius: 15%; + width: 50vmin; + height: 50vmin; +} + +#logo>svg { + width: 75%; + height: 75%; + margin: 12.5%; + fill: white; +} + </style> + </head> + <body> + <div id="content"></div> + <div id="overlay"> + <noscript>JavaScript is required to use Öffisearch</noscript> + <div id="logo"> + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg> + </div> + </div> + </body> + <script type="module" src="js/app.js"></script> +</html>
diff --git a/assets/client/js/api.js b/assets/client/js/api.js @@ -0,0 +1,47 @@ +'use strict'; + +import { showDiv, hideDiv } from './helpers.js'; +import { ConsoleLog } from './app_functions.js'; +import { showAlertModal, showLoader, hideLoader } from './overlays.js'; + +const api_base = '/api'; + +const errorMessages = { + '': 'Unbekannter Fehler', + 'REQUEST_NOT_FOUND': 'Ungültige Reise', + 'JOURNEY_NOT_FOUND': 'Verbindung nicht verfügbar', + 'TRY_AGAIN_LATER': 'Versuche es zu einem späteren Zeitpunkt erneut', + 'MISSING_VALUES': 'Benötigte Felder nicht ausgefüllt', + 'INVALID_DATE': 'Ungültiges Datum', + 'UNKNOWN_FROM': 'Unbekannter Abfahrtspunkt', + 'UNKNOWN_TO': 'Unbekannter Ankunftspunkt', + 'TOO_CLOSE': 'Abfahrts- und Ankunftspunkt zu nah', + 'NO_TRIPS': 'Keine Verbindungen gefunden', +}; + +export const get = async (endpoint, params, noLoader) => { + if (!noLoader) showLoader(); + let data; + try { + data = await fetch(api_base+endpoint, { + method: 'POST', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(resp => resp.json()); + } catch(e) { + data = { + msg: "Failed to fetch. Please check your network connection.", + }; + } + if (!noLoader) hideLoader(); + + if (data.status !== 'success') { + showAlertModal(errorMessages[data.msg] || data.msg); + throw new Error(data.msg); + } else { + return data.data; + } +}
diff --git a/assets/client/js/app.js b/assets/client/js/app.js @@ -0,0 +1,37 @@ +'use strict'; + +import { route, go, start } from './router.js'; +import { searchView } from './searchView.js'; +import { journeysView } from './journeysView.js'; +import { journeyView } from './journeyView.js'; +import { restoreDataStorage, ConsoleLog, loadDS100 } from './app_functions.js'; +import { showDiv, hideDiv, ElementById } from './helpers.js'; + +export const devMode = true; +export const dataStorage = restoreDataStorage(); + +const main = async () => { + window.addEventListener('load', () => hideDiv('overlay')); + + if (dataStorage.settings.showRIL100Names) await loadDS100(); + + route(/^\/$/, searchView); + route(/^\/([a-zA-Z0-9]+)$/, journeysView); + route(/^\/([a-zA-Z0-9]+)\/([-0-9]+)$/, journeyView); + + if (!window.location.hash.length) go('/'); + start(); +} + +main(); + +//const sw = navigator.serviceWorker; +//export let registration; +//if (sw) { +// sw.register('service-worker.js', { +// scope: './' +// }).then(function(reg) { +// ConsoleLog('Registration succeeded.'); +// registration = reg; +// }); +//}
diff --git a/assets/client/js/app_functions.js b/assets/client/js/app_functions.js @@ -0,0 +1,237 @@ +'use strict'; + +import { devMode, dataStorage } from './app.js'; +import { showModal } from './overlays.js'; +import { languages } from './languages.js'; +import { vsprintf } from './sprintf.min.js'; + +let ds100 = {}; + +export const addCache = (mode, data) => { + if (data === undefined) { + return false; + } + + switch (mode) { + case 'journeys': + if (dataStorage.journeys[data.reqId] !== undefined) { + ConsoleLog(data); + dataStorage.journeys[data.reqId].lastUpdated = data.lastUpdated; + dataStorage.journeys[data.reqId].journeys = {...dataStorage.journeys[data.reqId].journeys, ...data.journeys}; + } else { + dataStorage.journeys[data.reqId] = data; + + const lastHistoryEntry = dataStorage.journeysHistory.slice(-1); + + if (lastHistoryEntry[0] !== undefined) { + if (JSON.stringify(lastHistoryEntry[0].fromPoint) !== JSON.stringify(data.params.fromPoint) || + JSON.stringify(lastHistoryEntry[0].toPoint) !== JSON.stringify(data.params.toPoint)) { + dataStorage.journeysHistory.push({ + fromPoint: data.params.fromPoint, + toPoint: data.params.toPoint, + reqId: data.reqId, + journeyId: '' + }); + } else { + dataStorage.journeysHistory[dataStorage.journeysHistory.length-1].reqId = data.reqId; + dataStorage.journeysHistory[dataStorage.journeysHistory.length-1].journeyId = ''; + } + } else { + dataStorage.journeysHistory.push({ + fromPoint: data.params.fromPoint, + toPoint: data.params.toPoint, + reqId: data.reqId, + journeyId: '' + }); + } + } + break; + + case 'journeysHistory': + if (data !== undefined) { + dataStorage.journeysHistory = data; + } else { + return false; + } + + break; + + default: + return false; + break; + } + + return saveDataStorage(); +}; + +export const getCache = (mode, reqId) => { + switch (mode) { + case 'journeys': + if (reqId !== undefined) { + if (dataStorage.journeys[reqId] !== undefined) { + return dataStorage.journeys[reqId]; + } else { + return null; + } + } else { + return dataStorage.journeys; + } + break; + + case 'journeysHistory': + return dataStorage.journeysHistory; + break; + + default: + return null; + break; + } +}; + +export const t = (key, params) => { + let language = 'en'; + + if (dataStorage.settings.language !== undefined) { + language = dataStorage.settings.language; + } + + if (languages[language][key] !== undefined) { + return vsprintf(languages[language][key], params); + } else { + return key; + } +} + +export const parseName = (point) => { + let nameHTML = ''; + + if (point.stop) { + nameHTML += point.stop.name+ds100Names(point.stop.id); + } else if (point.location) { + if (point.location.name) { + nameHTML += point.location.name; + } else if (point.location.address) { + nameHTML += point.location.address; + } + } else { + return ""; + } + + return nameHTML; +}; + +export const ds100Names = (id) => { + if (dataStorage.settings.showRIL100Names !== false) { + if (ds100[Number(id)] !== undefined) { + return '('+ds100[Number(id)]+')'; + } else { + return ''; + } + } else { + return ''; + } +} + +export const ConsoleLog = (data) => { + if (dataStorage.settings.writeDebugLog !== false) { + console.log(data); + } +}; + +export const clearDataStorage = () => { + localStorage.removeItem('dataStorage'); + localStorage.removeItem('dataStorage_dev'); + location.reload(); +}; + +export const saveDataStorage = () => { + let name = 'dataStorage_dev'; + + if (devMode !== true) { + name = 'dataStorage'; + } + + try { + localStorage.setItem(name, JSON.stringify(dataStorage)); + } catch (e) { + ConsoleLog("yikes, localstorage full, clear it...") + dataStorage.journeys = {}; + saveDataStorage(); + } +}; + +export const restoreDataStorage = () => { + let data; + + if (devMode !== true) { + data = localStorage.getItem('dataStorage'); + } else { + data = localStorage.getItem('dataStorage_dev'); + } + + if (data !== null) { + let dataStorage = JSON.parse(data); + + if (dataStorage.dbVer < 0.5) { + showModal('Lokale Datenbank veraltet - Datenbank wird neu erstellt.'); + if (devMode !== true) { + localStorage.removeItem('dataStorage'); + } else { + localStorage.removeItem('dataStorage_dev'); + } + + dataStorage = restoreDataStorage(); + } + + return dataStorage; + } else { + let userLang = navigator.language || navigator.userLanguage; + let language = 'en'; + + if (['en', 'de'].includes(userLang)) { + language = userLang; + } + + const data = { + dbVer: 0.5, + journeysHistory: [], + journeys: {}, + ignored: [], + favorites: [], + settings: { + provider: 'DB', + products: { + "nationalExp": true, + "national": true, + "regionalExp": true, + "regional": true, + "suburban": true, + "bus": true, + "ferry": true, + "subway": true, + "tram": true, + "taxi": true + }, + accessibility: 'none', + showRIL100Names: false, + writeDebugLog: false, + enableCanvas: false, + language: language, + travelynx: false + } + } + + if (devMode !== true) { + localStorage.setItem('dataStorage', JSON.stringify(data)); + } else { + localStorage.setItem('dataStorage_dev', JSON.stringify(data)); + } + + return data; + } +}; + +export const loadDS100 = async () => { + const module = await import('./ds100.js'); + ds100 = module.ds100; +};
diff --git a/assets/client/js/canvas.js b/assets/client/js/canvas.js @@ -0,0 +1,333 @@ +'use strict'; + +import { moreJourneys } from './journeysView.js'; +import { dataStorage } from './app.js'; + +const padZeroes = (str) => ('00' + str).slice(-2); + +const formatTime = (date) => { + date = new Date(date * 1000); + return `${padZeroes(date.getHours())}:${padZeroes(date.getMinutes())}` +}; + +const textFor = (leg) => leg.line && leg.line.name || ""; +const colorFor = (leg, type) => { + let product = leg.line && leg.line.product || "walk"; + return colors[type][product] || colors[type].default; +}; + +const flatten = (arr) => [].concat(...arr); + +const colors = { + fill: { + 'tram': '#cc5555', + 'subway': '#5555cc', + 'suburban': '#55aa55', + 'nationalExp': '#fff', + 'national': '#fff', + 'regionalExp': '#888', + 'regional': '#888', + 'bus': '#aa55aa', + default: '#888' + }, + text: { + 'nationalExp': '#ee3333', + 'national': '#ee3333', + default: '#fff' + }, + icon: { + 'walk': 'directions_walk', + 'transfer': 'directions_transfer', + 'subway': 'directions_subway', + 'bus': 'directions_bus', + 'tram': 'tram', + default: 'train' + } +}; + +let rectWidth, padding, rectWidthWithPadding, canvas, ctx, dpr; + +const canvasState = { + journeys: [], + offsetX: 0, + firstJourney: 1, +}; + +const textCache = {}; +let textCacheWidth; +let textCacheDpr; + +export const setupCanvas = (data) => { + canvasState.offsetX = (window.innerWidth / dpr) > 600 ? 120 : 60, + canvas = document.getElementById('canvas'); + ctx = canvas.getContext('2d'); + canvasState.journeys = Object.keys(data.journeys).sort((a, b) => Number(a) - Number(b)).map(k => data.journeys[k]); + canvasState.reqId = data.reqId; + canvasState.firstJourney = Number(Object.keys(data.journeys).sort((a, b) => Number(a) - Number(b))[0]); + + canvas.addEventListener('mousedown', mouseDownHandler, {passive: true}); + canvas.addEventListener('touchstart', mouseDownHandler, {passive: true}); + updateTextCache(); + resizeHandler(); +}; + +const addTextToCache = (text, color, fixedHeight) => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + + let height, width + if (fixedHeight) { + height = 15; + ctx.font = `${height}px sans-serif`; + width = ctx.measureText(text).width; + } else { + const measureAccuracy = 50; + ctx.font = `${measureAccuracy}px sans-serif`; + width = rectWidth - 10; + height = Math.abs(measureAccuracy * (width / (1 - ctx.measureText(text).width))); + } + + canvas.width = width * dpr; + canvas.height = (Math.ceil(height) + 1) * dpr; + ctx.scale(dpr, dpr); + + ctx.font = `${height}px sans-serif`; + ctx.fillStyle = color; + if (height > 10) { + ctx.fillText(text, 0, height); + textCache[text] = canvas; + } +}; + +const updateTextCache = () => { + textCache.length = 0; + textCacheWidth = rectWidth; + textCacheDpr = dpr; + for (let journey of canvasState.journeys) { + for (let leg of journey.legs) { + addTextToCache(textFor(leg), colorFor(leg, "text")); + + let times = []; + if (journey.legs.indexOf(leg) == 0) times.push(leg.departure); + if (journey.legs.indexOf(leg) == journey.legs.length - 1) times.push(leg.arrival); + for (let time of times) { + addTextToCache(formatTime(time.prognosedTime || time.plannedTime), "#fff", 15); + } + } + } +}; + +const renderJourneys = () => { + ctx.shadowBlur = 0; + ctx.clearRect(0, 0, canvas.width / dpr, canvas.height / dpr); + ctx.fillStyle = '#00000085'; + ctx.fillRect(0, 0, canvas.width / dpr, canvas.height / dpr); + let x = canvasState.offsetX, y; + + let firstVisibleJourney = Math.max(0, Math.floor((-canvasState.offsetX + padding) / rectWidthWithPadding)); + let numVisibleJourneys = Math.ceil(canvas.width / dpr / rectWidthWithPadding); + let visibleJourneys = canvasState.journeys.slice(firstVisibleJourney, firstVisibleJourney + numVisibleJourneys); + + if (!visibleJourneys.length) return; + + let firstDeparture = visibleJourneys[0].legs[0].departure.plannedTime; + let lastArrival = Math.max.apply(Math, + visibleJourneys.map(journey => journey.legs[journey.legs.length-1].arrival.plannedTime) + .concat(visibleJourneys.map(journey => journey.legs[journey.legs.length-1].arrival.prognosedTime)) + ); + let scaleFactor = 1/(lastArrival - firstDeparture) * (canvas.height - 64 * dpr) / dpr; + + let time = canvasState.journeys[0].legs[0].departure.plannedTime; + + ctx.font = `${(window.innerWidth / dpr) > 600 ? 20 : 15}px sans-serif`; + ctx.fillStyle = '#aaa'; + while (time < lastArrival) { + let y = (time - firstDeparture) * scaleFactor + 32; + ctx.fillText(formatTime(time), (window.innerWidth / dpr) > 600 ? 30 : 10, y); + ctx.fillRect(0, y, canvas.width / dpr, 1); + time += Math.floor(120/scaleFactor); + } + ctx.fillStyle = '#fa5'; + y = (Number(new Date()) / 1000 - firstDeparture) * scaleFactor + 32; + ctx.fillRect(0, y-2, canvas.width / dpr, 5); + + const p = new Path2D('M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z'); + ctx.fillStyle = '#fff'; + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + ctx.save(); + ctx.scale(3, 3); + ctx.translate(x / 3 - 15, canvas.height / dpr / 6 - 24); + ctx.rotate(-Math.PI*1.5); + ctx.fill(p); + ctx.restore(); + ctx.beginPath(); + ctx.arc(x - 80,canvas.height / dpr / 2 - 35,50,0,2*Math.PI); + ctx.fillStyle = '#ffffff40'; + ctx.fill(); + ctx.strokeStyle = '#00000020'; + ctx.stroke(); + + for (let journey of canvasState.journeys) { + journey.legs.reverse(); + for (let leg of journey.legs) { + let depDelayed = leg.departure.prognosedTime && leg.departure.prognosedTime != leg.departure.plannedTime + let arrDelayed = leg.arrival.prognosedTime && leg.arrival.prognosedTime != leg.arrival.plannedTime + if (depDelayed || arrDelayed) { + const start = leg.departure.plannedTime; + const stop = leg.arrival.plannedTime; + const duration = (stop - start) * scaleFactor; + + y = (start - firstDeparture) * scaleFactor + 32; + + ctx.shadowBlur = 0; + ctx.fillStyle = '#44444480'; + ctx.strokeStyle = '#ffffff80'; + ctx.fillRect(x-padding, y, rectWidth, duration); + ctx.strokeRect(x-padding, y, rectWidth, duration); + } + } + x += rectWidthWithPadding; + } + + x = canvasState.offsetX; + + for (let journey of canvasState.journeys) { + for (let leg of journey.legs) { + const start = leg.departure.prognosedTime || leg.departure.plannedTime; + const stop = leg.arrival.prognosedTime || leg.arrival.plannedTime; + const duration = (stop - start) * scaleFactor; + + y = (start - firstDeparture) * scaleFactor + 32; + + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 10 : 0; + ctx.shadowColor = '#00000060'; + + if (leg.isWalking || leg.isTransfer) { + ctx.fillStyle = '#777'; + ctx.fillRect(x + rectWidth / 2 - rectWidth / 10, y, rectWidth / 5, duration); + } else { + ctx.fillStyle = colorFor(leg, "fill"); + ctx.fillRect(x, y, rectWidth, duration); + } + + ctx.shadowBlur = 0; + + let preRenderedText = textCache[textFor(leg)]; + if ((preRenderedText.height / dpr) < duration - 5) { + ctx.scale(1 / dpr, 1 / dpr); + ctx.drawImage(preRenderedText, dpr * (x + 5), Math.floor(dpr * (y + duration / 2) - preRenderedText.height / 1.5)); + ctx.scale(dpr, dpr); + } + + if (leg.cancelled) { + ctx.shadowBlur = 5; + ctx.strokeStyle = '#cc4444ff'; + ctx.lineWidth = 5; + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + rectWidth, y + duration); + ctx.stroke(); + ctx.lineWidth = 1; + } + + /* draw journey start and end time */ + let time; + // note: leg order is reversed at this point in time + let times = []; + if (journey.legs.indexOf(leg) == journey.legs.length - 1) times.push([leg.departure, y - 9.5]); + if (journey.legs.indexOf(leg) == 0) times.push([leg.arrival, y + duration + 7.5]); + for (let [time, y] of times) { + preRenderedText = textCache[formatTime(time.prognosedTime || time.plannedTime)]; + ctx.scale(1 / dpr, 1 / dpr); + ctx.drawImage(preRenderedText, Math.ceil(dpr * (x + ((rectWidth - preRenderedText.width/dpr)) / 2)), dpr * (y - 7.5)); //Math.floor(dpr * (x + rectWidth / 2) - preRenderedText.width), dpr * (y - 1)); + ctx.scale(dpr, dpr); + } + } + + journey.legs.reverse(); + x += rectWidthWithPadding; + } + ctx.fillStyle = '#fff'; + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + ctx.save(); + ctx.scale(3, 3); + ctx.translate(x / 3 + 5, canvas.height / dpr / 6); + ctx.rotate(Math.PI*1.5); + ctx.fill(p); + ctx.restore(); + ctx.beginPath(); + ctx.arc(x + 50,canvas.height / dpr / 2 - 35,50,0,2*Math.PI); + ctx.fillStyle = '#ffffff40'; + ctx.fill(); + ctx.strokeStyle = '#00000020'; + ctx.stroke(); +}; + +const resizeHandler = () => { + dpr = window.devicePixelRatio || 1; + if (!document.getElementById('canvas')) return; + + rectWidth = (window.innerWidth / dpr) > 600 ? 100 : 80; + padding = (window.innerWidth / dpr) > 600 ? 20 : 5; + rectWidthWithPadding = rectWidth + 2 * padding; + + if (rectWidth !== textCacheWidth || dpr !== textCacheDpr) updateTextCache(); + + const rect = document.getElementById('header').getBoundingClientRect(); + canvas.width = window.innerWidth * dpr; + canvas.height = (window.innerHeight - rect.height) * dpr; + canvas.style.width = `${window.innerWidth}px`; + canvas.style.height = `${window.innerHeight - rect.height}px`; + + ctx.restore(); + ctx.save(); + ctx.scale(dpr, dpr); + + renderJourneys(); +}; + +const mouseUpHandler = (evt) => { + let x = evt.x || evt.changedTouches[0].pageX; + if (canvasState.dragging && Math.abs(canvasState.dragStartMouse - x) < 20) { + let num = Math.floor((x - canvasState.offsetX + 2 * padding) / rectWidthWithPadding); + if (num >= 0) { + if (num < canvasState.journeys.length) { + window.location.hash += '/' + (num+canvasState.firstJourney); + } else { + moreJourneys(canvasState.reqId, "later"); + } + } else { + moreJourneys(canvasState.reqId, "earlier"); + } + } + + canvasState.dragging = false; +}; + +const mouseDownHandler = (evt) => { + let x = evt.x || evt.changedTouches[0].pageX; + canvasState.dragStartMouse = x; + canvasState.dragStartOffset = canvasState.offsetX; + canvasState.dragging = true; +}; + +const mouseMoveHandler = (evt) => { + if (canvasState.dragging) { + evt.preventDefault(); + let x = evt.x || evt.changedTouches[0].pageX; + canvasState.offsetX = canvasState.dragStartOffset - (canvasState.dragStartMouse - x); + renderJourneys(); + return true; + } +}; + +window.addEventListener('mouseup', mouseUpHandler); +window.addEventListener('touchend', mouseUpHandler); +window.addEventListener('mousemove', mouseMoveHandler); +window.addEventListener('touchmove', mouseMoveHandler); +window.addEventListener('resize', resizeHandler); +window.addEventListener('zoom', resizeHandler);
diff --git a/assets/client/js/ds100.js b/assets/client/js/ds100.js @@ -0,0 +1 @@ +export const ds100 = {"8000001":"KA","8000002":"TA","8000004":"HA","8000007":"FALZ","8000009":"NAN","8000010":"NAH","8000011":"AAG","8000012":"KAU","8000013":"MA","8000014":"TAU","8000015":"FBA","8000016":"TB","8000017":"TBF","8000019":"HBHA","8000020":"FBHF","8000021":"SBKN","8000022":"HNDF","8000023":"AO","8000025":"NBA","8000027":"NSCH","8000028":"NBY","8000029":"FB","8000030":"KBE","8000031":"FBH","8000032":"NS","8000033":"KSWE","8000034":"EBZ","8000036":"EBIL, EBILP","8000037":"ESRT","8000038":"TBM","8000039":"FBGK","8000040":"EBCH","8000041":"EBO","8000042":"RSE","8000043":"HSSN","8000044":"KB","8000045":"KBOP","8000046":"ESIE","8000047":"EBTH, EBTHP","8000048":"EBWE","8000049":"HBS","8000050":"HB","8000051":"HBH","8000053":"RBT","8000054":"EBRW","8000055":"RBR","8000056":"ABLZ","8000057":"MBU","8000058":"ABCH","8000059":"HBDE","8000060":"KSIH","8000061":"FBNG","8000062":"EBFT","8000063":"TCW","8000064":"HC","8000065":"FCOE","8000066":"ECMF","8000067":"TC","8000068":"FD","8000069":"TSIG","8000070":"HD","8000071":"HDBG","8000073":"RSI","8000074":"FDIL","8000075":"SDL","8000076":"ESOT","8000077":"RDO","8000078":"MDT","8000080":"EDO","8000081":"EDDP, EDDPH, EDDPT","8000082":"KDF, KDFF, KDFFH","8000083":"EDUL, EDULH","8000084":"KDN, KDN P","8000085":"KD","8000086":"EDG","8000087":"KSO","8000088":"HSO","8000089":"AST","8000090":"HEBG","8000091":"NSTN","8000092":"AEL","8000093":"HELZ","8000094":"KENR","8000095":"NST","8000098":"EE","8000099":"EEST","8000100":"KEU","8000101":"TET","8000102":"EFP","8000103":"AF","8000105":"FF, FFT","8000106":"FHOE","8000107":"RF","8000108":"MFL","8000110":"TFS","8000111":"FFG","8000112":"TF","8000113":"EFOE","8000114":"NF","8000115":"FFU","8000116":"MTS","8000117":"FGEL","8000118":"EG","8000119":"MGE","8000120":"NGM","8000121":"FGHO","8000122":"MTL","8000123":"SGR","8000124":"FG","8000125":"EGBW","8000126":"FGE","8000127":"TGO","8000128":"HG","8000129":"FTS","8000130":"HGS","8000131":"RGN","8000133":"KGRB","8000134":"STR","8000135":"KT","8000136":"FGER","8000137":"RGR","8000138":"KGUA, KGUI","8000139":"MGZB","8000140":"FGTH","8000141":"TT","8000142":"EHG","8000143":"RWGA","8000144":"MTHB","8000145":"EHLT","8000146":"RWPF","8000147":"AHAR, AHRS","8000148":"HHM","8000149":"EHM","8000150":"FH, FH N, FH S","8000152":"HH","8000154":"STM","8000155":"AHI","8000156":"RH","8000157":"TH","8000158":"FHWD, FHWR","8000159":"HHLM","8000160":"THT","8000161":"FHRB","8000162":"EHFD","8000163":"TTU","8000164":"EHER","8000165":"EHDT","8000166":"HHB","8000167":"HHES","8000168":"HU","8000169":"HHI","8000170":"TU","8000171":"EUN","8000172":"FHT","8000173":"NHOB","8000174":"KV","8000175":"SVL","8000176":"SHO","8000177":"THB","8000178":"KHR","8000180":"TWN","8000181":"AHM","8000182":"RIM","8000183":"MIH","8000185":"HGI","8000186":"EIL","8000189":"SKL","8000190":"KKAK","8000191":"RK","8000192":"EWAN","8000193":"FK","8000194":"MKFB","8000195":"MKFG","8000196":"HWAR","8000197":"MKP","8000198":"EKG","8000199":"AK","8000201":"NKL","8000203":"TKG","8000204":"NWDO","8000205":"KKLV","8000206":"KKO","8000207":"KK","8000208":"KKER, KKERP","8000209":"KKM","8000211":"KKR","8000212":"KKRO","8000213":"HK","8000214":"EKT","8000215":"ELAG","8000216":"RLA","8000217":"MLA","8000218":"FWG","8000220":"MWH","8000221":"TL","8000222":"FLAU","8000225":"HLEE","8000226":"HLER, HLERA","8000227":"ELE","8000228":"NLF","8000229":"FL","8000230":"MLI","8000233":"HL","8000234":"FLOL","8000235":"TLU","8000236":"RL, RL T","8000237":"AL","8000238":"ALBG, ALBGW","8000239":"ELUE","8000240":"FMZ","8000241":"FMB, FMB P","8000242":"EWES","8000243":"FMFH","8000244":"RM","8000245":"FWBG","8000247":"NMR","8000248":"KMYO","8000249":"MM","8000250":"FW","8000251":"EWIT","8000252":"HM","8000253":"KM","8000254":"RWRT","8000255":"HWOH, HWOL","8000256":"MRBI","8000257":"FWOR","8000259":"EMLR","8000260":"NWH","8000261":"MH, MH N, MH S, MHT","8000262":"MOP","8000263":"EMST, EMSTP","8000264":"RNZ","8000265":"RNM","8000266":"KW","8000267":"NNE","8000268":"HWUN","8000269":"NNS","8000271":"AN","8000272":"SNK","8000273":"DMBH","8000274":"KN, KN O, KN W","8000275":"RN","8000276":"KNE","8000277":"FND","8000278":"KNL","8000279":"HNBG","8000280":"MNL","8000282":"HNOS","8000283":"HN","8000284":"NN","8000285":"FORD","8000286":"EOB","8000287":"NOKP","8000288":"FWB","8000290":"RO","8000291":"HOLD","8000294":"HO, HO O, HO U","8000295":"TO","8000297":"EPD","8000298":"NPA","8000299":"TPH","8000301":"NPL","8000302":"TP","8000304":"HQ","8000306":"RRA","8000307":"ERE","8000309":"NRH","8000310":"KRE","8000311":"KRL","8000312":"AR","8000313":"TRX","8000314":"TRE","8000315":"ERDW","8000316":"HR","8000317":"KRH","8000318":"KRY, KRY P","8000319":"SRO","8000320":"MRO","8000321":"AROG","8000322":"TR","8000323":"SSH","8000324":"KBPS","8000325":"HSRI","8000326":"RSD","8000328":"NSAW","8000329":"TSG","8000330":"TSHT","8000331":"KAND","8000332":"RFT","8000333":"RHA","8000334":"AJ","8000335":"HLST","8000336":"TLK","8000337":"FMBG","8000338":"MMH","8000339":"TM","8000342":"HWEZ","8000343":"DSCF","8000344":"HWTT","8000346":"EBK","8000347":"FSTM","8000348":"KST, KST P","8000349":"FO","8000350":"FAFD","8000351":"KAK","8000352":"HBGM","8000353":"TBG","8000354":"HBAS","8000355":"KBEE","8000356":"RVLE","8000357":"SBI","8000358":"EBLA, EBP","8000359":"FBOD","8000360":"FBUE","8000362":"FDI","8000363":"KDI","8000364":"HVBG","8000365":"NDB","8000366":"RVL","8000367":"EDME","8000368":"FWAB","8000369":"REA","8000370":"SEG","8000371":"SEI","8000372":"SENK","8000374":"RFHM","8000375":"FGAL","8000376":"RGE","8000377":"RWE","8000378":"SWR, SWRR","8000379":"SWIH","8000380":"TGL","8000382":"EGRN","8000383":"FWR","8000384":"FWH","8000385":"NGUN","8000386":"FHG","8000387":"MHGZ","8000388":"KHI","8000389":"THF","8000390":"KHOK","8000391":"HHZM","8000392":"EHZW","8000393":"RVLH","8000400":"FHUG","8000402":"SKU","8000404":"KAW, KAW P","8000406":"KARE, KAREP","8000409":"KKEM","8000410":"MABG","8000412":"RAH","8000413":"HACH","8000414":"HAMR","8000416":"AACW","8000418":"HADB","8000419":"MAD","8000420":"NADM","8000423":"RADN","8000424":"TAD","8000427":"EKIR","8000431":"TAF","8000433":"MAGD","8000434":"AABG","8000435":"FKIH","8000436":"RA","8000437":"EAHS","8000440":"HSCG","8000441":"EAHL, EAHLH","8000442":"HAHO","8000443":"HALT","8000445":"HSDK","8000446":"AAHR","8000448":"KAH","8000449":"KAHM","8000452":"MAI","8000453":"RFMU","8000454":"TAI","8000456":"TTUN","8000459":"MAIN","8000462":"EABT","8000463":"RAL","8000464":"AAL","8000466":"RAR","8000468":"FAG","8000471":"FALS","8000473":"TAE","8000474":"TALO","8000475":"TALT","8000477":"KALK","8000479":"NKN","8000480":"AAHG","8000481":"TALD","8000482":"MALH","8000483":"HALF","8000488":"HALG","8000489":"HALI","8000491":"SALG","8000492":"FADD","8000495":"KALI","8000496":"RAB","8000498":"NALB","8000499":"TALL","8000500":"KALP","8000501":"RALP","8000503":"FBL","8000504":"NADW","8000505":"SAZ","8000506":"FAHM","8000508":"TACH","8000509":"NAD","8000511":"NAVE","8000512":"AAW","8000513":"EALN","8000514":"KALT","8000515":"MALT","8000517":"SAB","8000518":"EABG","8000520":"FABL","8000522":"HHUD","8000524":"MANE","8000525":"FATF","8000526":"AAT","8000532":"EA","8000534":"NMS","8000537":"EASE","8000538":"FAST","8000539":"MASI","8000540":"NALW","8000544":"RAT","8000545":"MAHB","8000546":"FAT","8000547":"SLKG","8000553":"FAMO","8000556":"MAMT","8000558":"FAZS","8000559":"TAT","8000561":"MATS","8000562":"TATN","8000563":"SLCH","8000566":"NAM","8000569":"EAML","8000571":"ELPP","8000576":"MAPF","8000577":"TAM, TAM S","8000578":"HAMI","8000579":"KANM","8000580":"FANG","8000582":"RAN","8000584":"KANR","8000585":"SLN","8000586":"HLGW","8000588":"NAWN","8000589":"FAZ","8000595":"EAPH","8000596":"RAP, RAPP","8000597":"EARE","8000599":"FAF","8000601":"KARL","8000602":"FARM","8000603":"MANB","8000605":"EARB","8000606":"NARG","8000611":"KARS","8000613":"NAZ","8000615":"FMK","8000618":"NAHF","8000619":"NASU","8000621":"MASC","8000623":"EASB","8000624":"HASD","8000625":"RASH","8000627":"AASN","8000630":"TAX","8000631":"RMF","8000632":"FAS","8000633":"FAL","8000634":"MAG","8000635":"FAH","8000638":"EAT","8000644":"KMO","8000647":"EAWN","8000649":"RACH","8000651":"SAM","8000653":"MAFE","8000655":"TAUF","8000657":"RAUG","8000658":"MAHA","8000659":"MAGM","8000660":"MAMS","8000661":"MAHZ, MAHZF, MAHZH","8000662":"MAOB","8000663":"FMSH","8000664":"HAUG","8000667":"FMT, FMTN","8000668":"FAUM","8000669":"AAH, AAMS","8000671":"FAM","8000672":"NAUR","8000674":"SAUW","8000675":"MAY","8000677":"KBA","8000678":"MBAE","8000681":"RBST","8000683":"FBCH","8000685":"MBCN","8000686":"RBH","8000687":"EMRY","8000688":"MNFR","8000689":"NBAB","8000690":"MBAI","8000691":"RBZB","8000694":"KBRE","8000696":"MBAK","8000697":"HBDG","8000698":"RBDH","8000701":"FEMS","8000702":"FEMW","8000704":"TBK","8000706":"TBWT","8000707":"RBGR","8000708":"RBDT","8000711":"KHGB","8000712":"FHO","8000713":"KHBD","8000714":"NBKI","8000715":"FKI","8000716":"MBKG","8000717":"MBKK","8000718":"RBKR","8000721":"TBLI","8000725":"HMDD","8000726":"SBMS","8000727":"KMUE","8000728":"FBNA","8000729":"KNEB","8000730":"NBNE","8000731":"TBN","8000732":"HOY","8000733":"HBOE","8000734":"RBPL","8000735":"HPRT","8000736":"RBRA","8000737":"MBRL","8000738":"MBRK","8000739":"HSCH","8000740":"HBSA","8000741":"FBSH","8000742":"KSAL","8000743":"FSF","8000744":"EBSU","8000745":"EBSA","8000746":"TBSC","8000749":"ASCH","8000750":"TBSB","8000751":"ASB","8000752":"FBSO","8000753":"FBSD","8000754":"APSD","8000755":"APO","8000756":"NBST","8000757":"TBT","8000758":"MBT","8000759":"HBSK","8000760":"FVL","8000761":"FVLS","8000763":"TBWA","8000765":"RBWF","8000766":"RBWH","8000767":"NBWI","8000768":"MBWH","8000770":"HZWI","8000771":"RHEB","8000772":"HBAD","8000773":"HBDV","8000774":"RBB","8000775":"RBBL","8000777":"RBPK","8000778":"MBHM","8000779":"AALH","8000780":"ABAF","8000781":"MBAB","8000783":"NBD","8000784":"NBAF","8000785":"MBDH","8000786":"FBAD","8000787":"TBLH","8000788":"TBGS","8000792":"SBAL","8000793":"EBAV","8000794":"RBAM","8000796":"HBAN","8000797":"HBTF","8000800":"HNN","8000801":"ABAD, ABAW","8000802":"RBRT","8000804":"ABAE","8000805":"ABAP","8000807":"HBNF","8000808":"HBNT","8000810":"HBAR","8000812":"HBGH","8000815":"AHEM","8000818":"NOF","8000821":"RBZE","8000822":"NBH","8000826":"NBAU","8000827":"ABF","8000830":"NBEI","8000831":"MBGM","8000832":"KBAY","8000834":"MBZ","8000840":"SBE","8000842":"KBH","8000846":"EBEE","8000850":"NBEH","8000851":"FBEI","8000853":"KOPL, KOPLM","8000858":"TBS","8000859":"FBEF","8000860":"ABE","8000861":"RBLN","8000862":"MBNB","8000863":"RBLH","8000864":"RBEL","8000865":"TBEM","8000869":"MBEN","8000870":"SBG","8000871":"HBML","8000872":"HBEN","8000873":"TBEN","8000875":"SOTW","8000876":"SPSN","8000877":"FBAU","8000879":"HBTH","8000880":"RRZ","8000882":"NBE","8000885":"MBG","8000887":"ERES","8000888":"MBE","8000889":"TBER","8000890":"RBRG","8000891":"FSUE","8000892":"EBGA","8000894":"RBGP","8000899":"KBGG","8000902":"NBHM","8000904":"EBRH","8000905":"ABGS","8000907":"EBLB","8000908":"ABTSB, ABTSL","8000909":"RBAH","8000911":"MBN","8000913":"HBER","8000918":"MBER","8000919":"HBBR","8000921":"FBEZ","8000923":"SBS","8000925":"TBE","8000926":"SBES","8000927":"EBWG","8000928":"NBMS","8000932":"RBEU","8000933":"TBEU","8000934":"TBTB","8000935":"ABVS","8000941":"SBX","8000942":"RBI","8000943":"TBI","8000944":"TBIB","8000945":"MBIC","8000948":"FBI","8000951":"FBBM","8000953":"EBIO","8000955":"ABIL","8000956":"EBIS","8000957":"HROE","8000959":"TBIE","8000961":"EDH","8000962":"MBIH, MBIHH","8000963":"RBIE","8000965":"RBGN","8000966":"EBIG","8000967":"SBDS","8000969":"MBIN","8000970":"EBB","8000971":"ABWM","8000973":"RBIN","8000974":"NBI","8000975":"FBGG","8000976":"FBGN","8000977":"EHGV","8000978":"EBIN","8000983":"EBKB","8000984":"RBRK","8000989":"SBRB","8000996":"FBMR","8000997":"MBI","8000999":"TBIS","8001000":"HBSS","8001002":"TBIT","8001003":"NBLA","8001004":"MBLH","8001005":"TBIF","8001006":"KBLB","8001007":"AB","8001008":"KBLH","8001009":"RBAN","8001013":"TBL","8001015":"TBLS","8001017":"RBLB","8001018":"FBLH","8001027":"SBKL","8001028":"MBLM","8001030":"EBKP","8001032":"RBOB","8001033":"MBOB","8001034":"FBST","8001035":"EBGZ","8001038":"EBDA","8001039":"EBOE","8001043":"RBOK","8001045":"EBCK","8001046":"MBOD","8001047":"TBOD","8001048":"HBBU","8001049":"KBOD","8001050":"HBOF","8001051":"NBMA","8001052":"HBOD","8001054":"NBOE","8001055":"TBO","8001057":"RBOE","8001058":"NBHF","8001059":"RBER","8001061":"EBEO","8001063":"HBSM","8001065":"EBSL","8001066":"EBSP","8001069":"NBO","8001071":"HBOM","8001072":"KBOI","8001080":"TBD","8001081":"KBHH","8001082":"KBBG","8001083":"KBB","8001084":"KBD","8001085":"KBM","8001086":"KBO","8001088":"KBEC","8001089":"HBHB","8001090":"TBP","8001091":"KBUN","8001092":"ABRD","8001093":"EBOR","8001095":"EBHS","8001096":"EBGO","8001097":"EBOK","8001098":"FBOK","8001104":"FBO","8001106":"FBOS","8001107":"EBTB","8001108":"EBTV","8001110":"SBO","8001111":"TBOX","8001112":"EBRB","8001113":"KBRC","8001118":"EBRA, EBRAH","8001120":"HBKE","8001121":"HBKH, HBKL","8001122":"HBRM","8001123":"HBRA","8001129":"MBB","8001130":"KBRB","8001131":"RBTI","8001132":"FBFS","8001134":"HGLI","8001135":"SBA","8001136":"ABRB","8001137":"EBDL","8001138":"RBTN","8001139":"ABST","8001143":"RBRS","8001147":"MBRN","8001149":"NBG","8001153":"KBRS","8001155":"HBN","8001156":"HBB","8001157":"HBHM","8001159":"HBL","8001160":"HBM","8001161":"HBON","8001162":"HBOS","8001163":"HBSC","8001164":"HBHS, HBSB","8001165":"HBMG","8001166":"HBV","8001167":"HBWA","8001168":"HBHL","8001170":"HBWU","8001174":"RBN","8001176":"HBRT","8001177":"SBRH","8001178":"TBZ","8001179":"MKRS","8001180":"KBRY","8001182":"EBRS","8001183":"EBRO","8001185":"HBRO","8001186":"KBRO","8001188":"HBST","8001190":"ABRS","8001191":"RBRM","8001196":"FBB","8001198":"RBRH","8001199":"FBK","8001200":"SBUM","8001201":"HBUE","8001203":"MBR","8001205":"TBRU","8001207":"MBRM","8001209":"KBRU","8001212":"RBRP","8001213":"EBRU","8001214":"RBMT","8001215":"KBR, KBR P","8001221":"SBB","8001223":"NBTH","8001225":"NBM","8001229":"MBAU","8001231":"MBHA","8001234":"RBU","8001235":"KBZ","8001236":"FBUS, FBUSS","8001237":"FBUD","8001238":"SBN","8001242":"NBUE","8001244":"FBDH","8001245":"HBKB","8001248":"FBHM","8001249":"FBDW","8001250":"FBDG","8001252":"RBUE","8001256":"FBRG","8001258":"ABUS","8001259":"ABSM","8001261":"KBUT","8001262":"RBGG","8001264":"KBUH","8001266":"EBUD","8001267":"SBY","8001268":"EBUR","8001271":"FBUN","8001273":"ABR","8001276":"MBGU","8001277":"NBUM","8001278":"NBUW","8001279":"HBGD","8001283":"FBUH","8001285":"MBGH","8001287":"FBGH","8001289":"NBK","8001290":"NBUR","8001293":"NBN","8001296":"TBU","8001297":"NBUT","8001298":"NBWH, NROS","8001301":"HBUR","8001302":"SSHI","8001308":"KDEM","8001310":"NBT","8001312":"FBZ","8001315":"ABX","8001316":"ACD","8001317":"NCA","8001318":"HCAL","8001322":"FCA","8001323":"ECP","8001327":"ECA","8001328":"ECAS, ECASP","8001329":"ECME","8001330":"NCH","8001331":"NCHA","8001334":"NCN","8001335":"ECOH","8001337":"HCLP","8001338":"NC","8001339":"NCNS","8001340":"SCOC","8001341":"SCN","8001342":"HCOP","8001343":"ECFS","8001347":"NCR","8001348":"NCRE","8001352":"ACV","8001354":"MDA","8001355":"MDAS","8001357":"EDHL","8001358":"EDAB","8001359":"KDAM","8001360":"ADL","8001362":"EDAK","8001365":"KDAL","8001366":"RDL","8001372":"ADB","8001373":"MDAR","8001375":"FDN","8001376":"FDO","8001377":"FDS","8001378":"FDA","8001379":"FDE","8001380":"FDK","8001382":"MDAG","8001384":"KDAT","8001386":"FDAL","8001387":"ADH","8001388":"SDF","8001389":"FDSU","8001390":"EDVB","8001392":"HDEH","8001393":"HDED","8001394":"EDED","8001397":"NDG","8001399":"RDM","8001400":"NDE","8001404":"MDS","8001405":"TDLM","8001406":"SDE","8001407":"SDEO","8001414":"SDBO","8001415":"RDZ","8001416":"KDEK","8001417":"KDEA","8001418":"KDEB","8001420":"EDTM","8001421":"NDEB","8001427":"FDET","8001428":"TDT","8001429":"HDEM","8001430":"NDN","8001432":"EDEU","8001435":"NDIE","8001438":"ADT","8001439":"MDID","8001443":"HDIP","8001447":"MDIN","8001450":"NDT","8001454":"MDRD","8001455":"FDZM","8001456":"FDZ","8001457":"FDIZ","8001458":"FDIO","8001459":"FDZS","8001460":"FDBT","8001463":"MDIL","8001465":"EDGD","8001466":"MDIF","8001468":"MDKS","8001469":"EDIN","8001470":"SDIR","8001471":"HDBR","8001476":"TDI","8001479":"RDOA","8001480":"RDGN","8001482":"RDOF","8001483":"RDOG","8001484":"NDOE","8001485":"RDOM","8001486":"HDOP, HDPH","8001489":"HDVD","8001491":"RDRN","8001492":"HDOG","8001493":"ADR","8001495":"MDO","8001499":"MDFN","8001502":"HDMK","8001504":"FDH","8001505":"EDOH","8001506":"KDO","8001507":"KDBW, KDBWN","8001511":"FDOH","8001512":"TDS","8001514":"FDW","8001515":"EDSH","8001516":"EDLS","8001517":"EDKK","8001518":"EDMB","8001519":"EDOO","8001520":"EDST","8001521":"EDTP","8001522":"EDWH","8001523":"EDAP","8001524":"EDAU","8001525":"EDOF","8001526":"EDAM","8001527":"EDBA","8001528":"EDBH","8001529":"EDBK","8001530":"EDD","8001531":"EDOL","8001532":"EDHU","8001533":"EDKD","8001534":"EDKH","8001535":"EDKO","8001536":"EDKR","8001537":"EDKU","8001538":"EDLH","8001539":"EDLN","8001540":"EDGM","8001541":"EDMR","8001542":"EDMS","8001543":"EDMG","8001544":"EDRA","8001545":"EDSO","8001546":"EDWI","8001547":"ADO","8001548":"NDM","8001549":"EDSM","8001554":"FDCH","8001558":"EDRS","8001561":"HDRY","8001566":"KDUK","8001567":"FDU","8001570":"SDUW","8001571":"KDUL","8001578":"MDHR","8001579":"KDFS","8001581":"KDV","8001582":"KDW","8001583":"KDZ","8001584":"KDBE","8001585":"KDBH, KDBI","8001586":"KDD, KDDH","8001587":"KDE","8001588":"KDES","8001589":"KDGA","8001590":"KDGE","8001591":"KDOB","8001592":"KDR","8001593":"KDRM","8001594":"KDRE, KDRH","8001595":"KDU","8001596":"EDSL","8001597":"KDHA","8001598":"KDFL","8001599":"EDBI","8001600":"EDBU","8001602":"EDGR","8001603":"KDVS","8001605":"EDHD, EDHP","8001607":"EDMO","8001608":"EDOM","8001609":"EDRM","8001611":"EDRU","8001612":"EDWD, EDWDP","8001614":"MDUH","8001616":"RDRM","8001617":"TDU","8001618":"FDTH","8001619":"NEE","8001620":"NEBH","8001621":"MEBS","8001622":"MEBH","8001623":"NED","8001627":"NEBM","8001628":"MEBM","8001629":"NEB, NEBN","8001632":"TEC","8001634":"MEG","8001636":"NEC","8001638":"RET","8001640":"NEG","8001643":"REBR","8001645":"HEBS","8001646":"AECH","8001647":"MEC","8001648":"FEZL","8001650":"TETD","8001651":"TEI","8001654":"AEC","8001655":"NEMN","8001659":"FED","8001663":"REK, REKH","8001665":"REH","8001666":"SEE","8001668":"FEDI","8001670":"FEF","8001671":"REF","8001672":"FEGB","8001674":"NEGE","8001675":"HEGT","8001679":"MEGM","8001680":"NEO","8001682":"MEGL","8001683":"MELG","8001684":"TEH","8001686":"EELB","8001687":"HELH","8001688":"SEGO","8001689":"TEHN","8001690":"KEHR","8001692":"EERI","8001693":"FEHH","8001694":"FEHR","8001700":"EEHS","8001701":"FECH","8001702":"MEIC","8001704":"FEIZ","8001706":"EEHG","8001707":"REM","8001708":"MEB","8001709":"MEST","8001712":"KEIL","8001713":"HEIV","8001715":"REI","8001718":"AEF","8001720":"SEF","8001727":"SEMA","8001728":"REIS, REISO, REISW","8001729":"EEFD","8001731":"TEF","8001732":"REIW","8001734":"MEI","8001736":"KEIT","8001739":"AEGS","8001741":"HELV","8001742":"NELF","8001745":"KML","8001746":"TBME","8001747":"TELL","8001749":"NEL","8001751":"TEL","8001752":"MELZ","8001760":"HELS","8001762":"NEF","8001763":"FELT","8001764":"FELZ","8001765":"FELS","8001766":"RELZ","8001768":"HE","8001770":"KEMM","8001771":"REMM","8001773":"EEM","8001775":"HEMK","8001777":"HEMT","8001780":"EEMP","8001781":"HEMP","8001782":"EEDT","8001783":"NEK","8001785":"TEN","8001787":"MBEF","8001789":"KENL","8001790":"RENG","8001794":"TENG","8001795":"EENP","8001799":"SEN","8001801":"FENS","8001803":"TEZ","8001806":"MENW","8001808":"EEPE","8001811":"FERN","8001812":"SEP","8001813":"FEPP","8001814":"FER","8001815":"FEP","8001816":"FEPB","8001817":"FERO","8001818":"FERB","8001819":"FERW","8001820":"TER","8001825":"MER","8001826":"FEKW","8001827":"TERD","8001828":"SED","8001829":"MEWG","8001833":"TEG","8001835":"MERB","8001836":"EERG","8001838":"TEK","8001839":"KERZ","8001840":"NERK","8001841":"KER","8001844":"NER","8001845":"NERB, NERH","8001846":"NERS","8001851":"EEK","8001853":"MERG, MERN","8001858":"KERP","8001860":"RERO","8001864":"FEZ, FEZS","8001865":"RERZ","8001867":"HESH","8001870":"FES","8001871":"FESS","8001872":"HESD","8001874":"TESU","8001875":"NESU","8001877":"NESB","8001880":"MECH","8001883":"FEN","8001886":"KE","8001890":"HESO","8001894":"HEKP","8001896":"EESA","8001897":"EESD","8001898":"EENW","8001899":"HESN","8001900":"EEAL","8001901":"EEBE","8001902":"EEBB","8001903":"EEDL","8001904":"EEDO","8001905":"EEIB","8001906":"EEFO","8001907":"EEGE","8001908":"EEHU","8001909":"EEKB","8001910":"EEKN","8001911":"EEKS","8001912":"EEKU","8001913":"EESO","8001914":"EEUE","8001915":"EEWD","8001919":"NEN","8001920":"TE","8001921":"TEME","8001922":"MESH","8001924":"HETL","8001925":"NET","8001926":"RETL","8001928":"EEZB","8001929":"NEW","8001932":"NEZ","8001933":"TEU","8001935":"NEU","8001941":"AEU","8001942":"TEB","8001943":"EGVA","8001946":"TEY","8001949":"HETR","8001950":"FFAN","8001953":"AFK","8001954":"RFN","8001957":"HF","8001958":"HFAL","8001961":"MFCH","8001963":"MFP","8001965":"TFAU","8001967":"TFV","8001969":"NFZ","8001970":"MFA","8001971":"RFB","8001972":"EFEL","8001973":"MFK","8001974":"TFE","8001976":"EFER","8001977":"AFEB","8001978":"NFT","8001982":"TFI","8001983":"FFI","8001984":"TFIL","8001985":"MFNS","8001988":"NFTO","8001989":"NFI, NFIH","8001990":"SFC","8001991":"SFWB","8001992":"MFBU","8001995":"MFN","8001996":"MESG","8001998":"MFIN","8002004":"KFLH","8002010":"FFD","8002011":"AFT","8002012":"MFLI","8002013":"FFH","8002014":"RFLO","8002018":"SFOE","8002019":"NFOE","8002020":"NFDF","8002023":"RFM","8002024":"NFO","8002025":"RFTS","8002026":"TFB","8002027":"KFOS","8002029":"NFH","8002030":"TFOS","8002034":"FMUL","8002036":"RFST","8002038":"FLBF","8002039":"FFO","8002040":"FSP","8002041":"FFS","8002042":"FFW, FFW S","8002043":"FFBK","8002044":"FFBS","8002045":"FFES","8002046":"FGM","8002047":"FLS, FLSS","8002048":"FFMK","8002049":"FFND","8002050":"FNI, FNI S","8002051":"FFAW","8002052":"FRH","8002053":"FSIN, FSINO","8002054":"FSO","8002055":"FFZH","8002057":"NFU","8002058":"FOST","8002059":"FSTL","8002063":"HFRE","8002065":"TFG","8002066":"RFW","8002067":"RFHE","8002068":"RFLT","8002069":"RFSG","8002070":"RFWI","8002071":"RFZ","8002073":"EFRE","8002074":"MFHD","8002075":"NFR","8002076":"NFRE","8002077":"RFK","8002078":"MFR","8002080":"HFST","8002083":"SFF","8002085":"MFLH","8002086":"AFN","8002092":"EFBU","8002095":"FFRN","8002096":"TFD","8002099":"MFDB","8002100":"FFN","8002102":"HFRI","8002103":"FFL","8002104":"KFWH","8002105":"FGS","8002106":"AFBG","8002108":"FFRI","8002109":"EFFD","8002110":"TFH","8002111":"TFF","8002113":"AFRD","8002114":"KFGN","8002115":"AFD","8002116":"RFTL","8002117":"SFI","8002120":"TFFL","8002122":"TFLA","8002123":"RFH","8002127":"KFRI","8002130":"EFRM","8002132":"SFIM","8002133":"TFR","8002134":"FFRL","8002137":"FFUR","8002141":"MFB","8002149":"NFWS","8002150":"RFUE","8002152":"NFBB","8002153":"NFDB","8002154":"NFUB","8002155":"NFUF","8002156":"MFSN","8002159":"NFW","8002161":"MFU","8002162":"MGAL","8002165":"TGT","8002166":"TGFD","8002168":"TGAW","8002171":"MGH","8002173":"MGAI","8002175":"SGSZ","8002179":"HGKE","8002180":"EGAR","8002182":"FGA","8002185":"AGD","8002187":"MGP","8002191":"FGBM","8002195":"TGRN","8002198":"MGT","8002203":"HGEE","8002205":"NGET","8002206":"KGEK","8002207":"KGEH","8002209":"MGLG","8002210":"MGIB","8002212":"FGSM","8002214":"RGSN","8002217":"TGW","8002218":"TG","8002220":"MGEU","8002222":"KGE","8002223":"EGZO","8002224":"EGBN, EGBU","8002225":"EGBS","8002226":"EGHS","8002227":"EGRO","8002233":"MGKG","8002235":"RGB","8002236":"FGEF","8002237":"NGE","8002238":"SGN","8002239":"RGEH, RGEM","8002240":"TGES","8002241":"RGES","8002242":"TGEH","8002243":"TGLH","8002244":"MGLH","8002247":"MGLD","8002249":"FGHM","8002251":"TGN","8002254":"FGFD","8002256":"MGHF","8002259":"FGTB","8002262":"EGK","8002263":"MGHN","8002265":"FGGB","8002266":"AGF","8002267":"EGVH","8002268":"KGVW","8002269":"FGOG","8002272":"TGB","8002274":"HGIS","8002275":"MGCH","8002278":"TGI","8002280":"FGIR","8002281":"HGT","8002283":"EGBO","8002284":"EZK","8002286":"SGM","8002288":"FGBG","8002290":"KGL","8002293":"AGST","8002296":"KGO","8002299":"HGOH","8002300":"RGOR","8002301":"FGOE","8002304":"AGH","8002315":"FGOZ","8002319":"AGK","8002320":"HGOL","8002321":"FGDH","8002329":"NGG","8002333":"NGOD","8002334":"RGH","8002335":"NGZ","8002337":"RG","8002339":"MGFL","8002340":"NGFG","8002341":"NG","8002342":"FGRK","8002343":"MGRA","8002344":"NGFU","8002345":"RGNN","8002346":"MGRL","8002347":"MGB","8002348":"MGRS","8002349":"NGFA","8002351":"MGF","8002358":"FGSN","8002365":"RGRZ","8002369":"EGRV","8002370":"EGVB","8002373":"RGSS","8002374":"FGRF","8002377":"MGRZ","8002378":"MGNB","8002380":"RGM","8002382":"FGRN","8002383":"MGDF","8002386":"FDG","8002388":"FGKA","8002389":"KFKO","8002391":"FGRO","8002393":"FGRU","8002399":"NGRS","8002400":"FGAU","8002402":"KGBU","8002403":"HGBW","8002405":"HGDN","8002409":"FGRB","8002410":"FGL","8002411":"AGRO","8002412":"HGRK","8002413":"FGLR","8002416":"NGRG","8002420":"MGHD","8002422":"MGOI","8002424":"MGK","8002425":"FGK","8002430":"RGCH","8002432":"NGRW","8002434":"NGUF","8002435":"MGRB","8002436":"NGRU","8002439":"FGRG","8002441":"EGNO","8002442":"EGNH","8002444":"RGRN","8002445":"TGRW","8002447":"TGRS","8002448":"TGC","8002452":"SGD","8002454":"SGS","8002457":"MGKF","8002458":"MGNZ","8002461":"EGLO","8002462":"KGU","8002465":"RGDN","8002466":"MGUF","8002467":"NGD","8002468":"NGU","8002470":"RGUN","8002473":"FGUH","8002474":"FGUB","8002477":"KGUS","8002478":"RGTA","8002480":"RGTF","8002484":"FGX","8002489":"RHAG","8002490":"KHAN","8002491":"MHR","8002494":"KHAC","8002495":"FHAD","8002496":"AHNU","8002498":"FHAE","8002499":"HHAE","8002501":"FHHF","8002504":"AHAF","8002506":"NHA","8002507":"HHAG, HHGH","8002509":"KGVK","8002512":"EHGI","8002514":"EHGO","8002515":"RHGB","8002517":"NHBH, NHBU","8002520":"NFTM","8002523":"NHAG","8002524":"FHGO","8002526":"FHME","8002528":"FHHN","8002531":"FHDT","8002532":"FHAI","8002533":"RHAM","8002534":"MHMO","8002536":"EHAD","8002537":"HHAL","8002539":"EHAL","8002542":"NHAL","8002545":"AHKS","8002546":"RHL","8002547":"AAI","8002548":"ADF, ADST","8002549":"AH, AHS","8002550":"AHST","8002551":"AELB","8002554":"ABG, ABG S","8002555":"AEST","8002556":"AFIB","8002557":"ANR, ANRS","8002558":"ARAL","8002559":"ASTS","8002560":"AWN","8002561":"AWFS","8002565":"AHAM","8002567":"NHG","8002568":"NHGO","8002570":"MHAU","8002571":"EHK","8002572":"FHN","8002573":"FHW","8002574":"FHWB","8002575":"AHAN","8002578":"NHAP","8002580":"HHBI","8002581":"HHBO","8002584":"HKL","8002585":"HLEI","8002586":"HLI R","8002588":"SHN","8002589":"HLGF","8002592":"AHA","8002593":"MHRG, MHRH","8002594":"HHRD","8002596":"NHHF","8002598":"HHAR","8002605":"NH","8002607":"HHRS","8002609":"NHAR","8002610":"MHHS","8002612":"NHS","8002615":"HHSB","8002621":"RHS","8002623":"MHMR","8002625":"SHSS","8002628":"AHSB, AHSF","8002630":"NHT","8002632":"RHLO","8002633":"RHAS","8002634":"HHAS","8002635":"FHAT","8002637":"FHAS","8002638":"KHAT","8002639":"EHAT","8002640":"EHTM","8002641":"HHTF","8002643":"SHZ","8002648":"SHAM","8002649":"SHAU","8002651":"MHPH","8002655":"SHPT","8002656":"THAT","8002664":"MHNS","8002666":"RHSN","8002667":"MHHM","8002670":"EHBK","8002673":"THCH","8002674":"AHEN","8002677":"FHED","8002678":"NHED","8002680":"EHE, EHE P","8002681":"RHBF","8002682":"EHEG","8002683":"RHGN","8002684":"RHBO","8002685":"RHKA","8002686":"RHKM","8002687":"RHBP, RHBW","8002689":"THD","8002690":"THDM","8002691":"THDS","8002692":"FHEI","8002694":"HHEI","8002695":"HHDM","8002696":"NHEI","8002699":"THST","8002700":"TTPS","8002704":"RHN","8002705":"NHE","8002707":"SHB","8002710":"MHMK","8002711":"KHEH","8002715":"MHEM","8002716":"FHEB","8002724":"SHZH","8002727":"RHE","8002733":"NHB","8002737":"EHEP","8002745":"EHMD","8002746":"SHEM","8002748":"RHCH","8002751":"NHD","8002753":"KHEN","8002754":"EHNE","8002757":"FHP","8002760":"THTO","8002761":"MHEH","8002763":"RHZ","8002764":"THZ","8002766":"THC","8002768":"KHEC","8002769":"EHCK","8002770":"EHF","8002773":"FHER","8002775":"KHES","8002776":"THMA","8002779":"EHBO","8002782":"NHER","8002783":"NHEN","8002784":"KHER","8002785":"THE, THE Z","8002789":"THL","8002792":"MHI","8002793":"NHL","8002794":"NHR","8002797":"RHRT","8002798":"RHXB","8002800":"HHBS","8002801":"EHEZ","8002806":"KHEZ","8002810":"EHLN","8002812":"HHSO","8002813":"FHET","8002814":"FHH","8002815":"FHZ","8002817":"SHR","8002820":"MHEU","8002821":"MHFM","8002822":"FHEU","8002824":"HHIS","8002826":"EHIB","8002827":"NHGN","8002828":"KHIS","8002830":"HHIO","8002835":"EHIL","8002838":"NHP","8002841":"EHIT","8002843":"AHPF","8002844":"RHIM","8002845":"NHIS","8002847":"SHWP","8002848":"RHIZ","8002850":"MHRS","8002852":"THI","8002853":"NHI","8002856":"MHFN","8002857":"RHO","8002858":"SHIH","8002861":"KHIR","8002864":"AHIF","8002865":"AHZ","8002868":"KHO","8002869":"KHOM","8002872":"FHM","8002873":"AHPS","8002875":"SHY","8002877":"FHD","8002878":"NHM","8002879":"SHST","8002880":"SHS","8002881":"MHWG","8002883":"RHK","8002884":"HHOD","8002886":"FHTN","8002888":"MHDT","8002892":"THFG","8002894":"MHSB","8002895":"SHMB","8002898":"NHTL","8002899":"MHRK","8002903":"FHNB","8002912":"MHLK","8002915":"HHTL","8002916":"EHOM","8002918":"NHOE","8002919":"EHOS","8002920":"EHOV","8002921":"EHVR","8002923":"HHXR","8002924":"NHO","8002927":"NHON","8002929":"SHFD","8002930":"THOF","8002931":"RHFF","8002932":"KHOF","8002933":"FHFG","8002934":"FHOR","8002935":"FHF","8002939":"KHOG","8002940":"MHOB","8002941":"KHB","8002943":"SKLH","8002944":"HHEG, HHEP","8002946":"AHCH","8002953":"EHOG","8002954":"MHPG","8002955":"MHSL","8002956":"NHOH","8002958":"FHSU","8002959":"AHWT","8002962":"HHDF","8002967":"AHES","8002969":"HHOL","8002972":"EHW","8002976":"EHOZ","8002978":"HHZH","8002979":"KHOZ","8002980":"MHO","8002988":"KHOR","8002992":"EHOP","8002994":"MHOP","8002995":"SHPS","8002998":"THBH, THHF","8003000":"EHBM","8003001":"RHBG","8003002":"AHOG","8003003":"AHOT","8003008":"HHOY","8003010":"RHAR","8003014":"RHFM","8003015":"FHMM","8003016":"FHUE","8003018":"EHTG","8003020":"ESW","8003021":"SHT","8003022":"THUB","8003024":"MHUG","8003025":"RHU","8003030":"HHUL","8003032":"AY","8003033":"RHTT","8003035":"RIB","8003036":"HI","8003038":"MIHN","8003039":"MIC","8003040":"SIDO","8003041":"FIST","8003042":"SIG, SIGW","8003044":"NIDF","8003052":"RIR","8003053":"FIH","8003057":"MILT","8003058":"NILL","8003059":"SILG","8003060":"TIL","8003061":"RIMM","8003062":"FIM","8003063":"NIM","8003064":"HIMS","8003065":"MIMS","8003066":"RIMZ","8003070":"SIM","8003072":"MIDR","8003073":"KING","8003075":"FIL","8003076":"MIN","8003078":"AAU","8003079":"MINI","8003080":"RIN","8003081":"NI","8003083":"NIP","8003086":"NIR","8003088":"AIS","8003090":"EILH","8003091":"HIHG","8003092":"MIS","8003096":"EIAV","8003098":"RIT","8003100":"NIL","8003101":"RITL","8003102":"AIZ","8003103":"TIT","8003104":"KIV","8003108":"SJF","8003111":"TJZ","8003115":"AJHH","8003123":"MJET","8003124":"HJ","8003125":"RJO","8003129":"NJS","8003130":"KJUC","8003131":"FJUE","8003135":"KJU","8003137":"AJUS","8003143":"FKLM","8003144":"FKAI","8003146":"MKAI","8003148":"SKAI","8003150":"SKLP","8003151":"SKLW","8003154":"NKAL","8003158":"KKAL","8003160":"KKAS","8003165":"HKAW","8003166":"EKAL","8003168":"EKAM","8003169":"EKME","8003170":"FKMP","8003172":"RKD","8003173":"SKAZ","8003174":"KKAW","8003175":"RKPD","8003179":"STK","8003181":"RKF","8003182":"HKRF","8003183":"RKW","8003184":"RKDU","8003185":"RKHA","8003186":"RKIN","8003187":"RKMG","8003189":"NKA","8003196":"FKH","8003197":"FKJK","8003198":"FKKD","8003199":"FKOZ","8003200":"FKW","8003207":"AKAD","8003208":"AKTO","8003209":"HKAT","8003211":"SKTS","8003212":"EKV","8003213":"FKFT","8003214":"NKG","8003215":"SKW","8003216":"FKAU","8003218":"RKL","8003220":"TKEH","8003222":"AKI","8003227":"MKMZ","8003228":"FKCH","8003229":"NKNN","8003230":"MKPO","8003232":"SKEN","8003233":"RKN","8003235":"FKB","8003238":"NKCH","8003241":"FKES","8003245":"EKGS","8003247":"KKEV","8003248":"TKBI","8003249":"MKI","8003252":"KKIE","8003253":"AKRU","8003255":"FKIL","8003256":"MKIG","8003257":"SKIB","8003262":"FKGS","8003266":"TKIM","8003267":"HKDF","8003268":"NKIR","8003270":"NKO","8003272":"TKI","8003276":"HKHW","8003278":"TKM","8003280":"TKT","8003282":"TKTO","8003283":"TKTS","8003284":"TKU","8003285":"RKH","8003286":"HKHN","8003287":"EKHU","8003288":"HKLG","8003290":"MKO, MKO H","8003292":"HKI","8003293":"RKZ","8003294":"SKI","8003295":"SKR","8003298":"SKRS","8003299":"MKIS","8003302":"MKLA","8003303":"AKX","8003309":"AKC","8003310":"KKSH","8003311":"FKAH","8003312":"AFB","8003313":"FKGE","8003314":"FKO","8003315":"FKLU","8003316":"FKWO","8003317":"MKHN","8003318":"SKB","8003320":"KKTR","8003321":"KKLE","8003323":"HKSI","8003325":"RKES","8003326":"MKKZ","8003329":"NKGM","8003330":"KFKB","8003332":"TKNK","8003336":"RKLN","8003338":"NKNB","8003339":"RMBK","8003340":"KKLM","8003341":"KKSM","8003342":"MKLF","8003344":"SKT","8003345":"TKLU","8003348":"HKNE","8003349":"RKG","8003350":"SKG","8003351":"KKOE","8003352":"KKOL","8003354":"SKOW","8003355":"MKCH","8003356":"NKI","8003357":"NKOE","8003358":"KKFS","8003360":"KKP","8003361":"KKS","8003362":"KKV","8003363":"KKW","8003364":"KKBH","8003365":"KKC","8003366":"KKCN","8003367":"KKDB","8003368":"KKDT, KKDZ, KKDZB","8003369":"KKH","8003370":"KBP","8003371":"KKL","8003372":"KKN, KKN P","8003373":"KKWO","8003374":"RKOE","8003375":"KKMT","8003378":"TKS","8003379":"KSTP","8003381":"TKF","8003382":"HKOL","8003383":"KKWW","8003385":"EKSO","8003386":"KKOW","8003388":"FKRL, FKRLS","8003392":"KKHR","8003393":"NKZ","8003394":"SKV","8003395":"KKOS","8003397":"MKMR","8003398":"RKLR","8003399":"RKNA","8003400":"RKO","8003401":"RKOP","8003402":"SKZ","8003403":"SKU W, SKZM","8003404":"RKOF","8003407":"SKDL","8003408":"RKOR","8003409":"TKO","8003410":"AKWS","8003411":"TKH","8003412":"KKOI","8003413":"NKMG","8003414":"KKOF","8003415":"KKOH","8003416":"RKOW","8003420":"EKRG","8003424":"EKRD","8003426":"KKRL, KKRLF","8003427":"KKRU, KKRX","8003429":"SKRB","8003430":"AKM","8003431":"AKHD","8003432":"TKN","8003434":"SKK","8003436":"KKRZ","8003438":"MKZ","8003440":"KKRW","8003442":"FKRI","8003446":"NK","8003447":"FKRO","8003452":"SKRO","8003455":"KKRF","8003457":"MKRB","8003460":"AKRS","8003461":"TKUC","8003462":"KKUH","8003469":"EKUE","8003470":"EKNT","8003472":"NKUE","8003474":"AKH","8003476":"NKU","8003477":"AKE","8003478":"AKUP","8003479":"AKRH","8003481":"SKUS","8003483":"MKUN","8003484":"SKY","8003485":"NLB","8003487":"HHML","8003488":"MLBW","8003489":"RLD","8003490":"MLLF","8003491":"HLGG","8003494":"RLSW","8003497":"RLBP","8003498":"RLSH","8003503":"FLP","8003504":"SLAO","8003506":"MLDI","8003507":"RLAD","8003508":"RLW","8003512":"MLL","8003515":"SLD","8003516":"SLWR","8003518":"ALAS","8003519":"ALAN","8003520":"FLGS","8003521":"NLG","8003522":"HLNG","8003523":"FLG","8003524":"TLR","8003525":"TLL","8003526":"FLGF","8003528":"MLB","8003529":"ELBG","8003533":"RBS","8003539":"KLAB","8003540":"KLA","8003541":"ALST","8003542":"HLGH","8003543":"FLAH","8003544":"ALG","8003545":"HLGM","8003548":"NLP","8003550":"FSLB","8003551":"MLNW","8003552":"NLZ","8003553":"KLAW","8003554":"NLGU","8003558":"FLF","8003559":"FLAS","8003560":"MLAW","8003562":"RLAC","8003563":"HLAT","8003567":"NLDF","8003568":"SLAU","8003569":"TLH","8003571":"RLCH","8003576":"ALUB","8003577":"ALAU","8003578":"HLFO","8003580":"NLL","8003581":"NLR","8003582":"NLA","8003585":"RLFG","8003586":"RLBO","8003587":"NLLW","8003588":"TLN","8003589":"MLIG","8003591":"TLM","8003592":"TLW","8003593":"FLBG","8003594":"RLBA","8003605":"FLW","8003608":"ELGD","8003609":"RLT","8003611":"SLE","8003612":"FLEH","8003616":"KLEL","8003617":"HLFG","8003622":"TLF","8003627":"MLEH","8003628":"ALE","8003630":"ELBK","8003632":"HLMF","8003635":"HLEM","8003638":"ELSN","8003639":"MLWG","8003640":"ELEN","8003641":"FLE","8003643":"MLG","8003644":"HLGL","8003649":"ALS","8003652":"TLE","8003655":"ELEO","8003656":"HLED","8003657":"ELED","8003658":"ELET","8003659":"HLT","8003660":"KLEU","8003663":"MLSH","8003664":"NLWI","8003665":"KLET","8003668":"KLK, KLKH","8003669":"KLS","8003671":"KEST","8003672":"KLRD, KLRH","8003673":"FLI","8003674":"FLST","8003676":"NLH","8003680":"FLIS","8003681":"FLIE","8003684":"SLB","8003687":"RLI","8003690":"RLID","8003692":"MLIA","8003696":"FLHH, FLHN","8003697":"KLD","8003698":"FLIN","8003699":"HLH","8003700":"HLWL","8003701":"HLIG","8003702":"RLF","8003705":"HLBU","8003708":"KLI","8003711":"FLIH","8003713":"KLIS","8003715":"ELIS","8003716":"ELTF","8003720":"MLCH","8003721":"RLOE","8003722":"HLOD","8003723":"SLF","8003724":"RLGN","8003726":"FLOE","8003729":"RLR","8003730":"RLST","8003731":"RLFB","8003732":"KLO, KLOV","8003733":"TLOE","8003734":"NLOR","8003735":"MLH","8003736":"RLRD","8003737":"RLRS","8003738":"HLON","8003739":"SLOH","8003740":"NLO","8003743":"RLRW","8003748":"TLON","8003749":"MLOH","8003751":"FLOR","8003752":"TLO","8003753":"FLON","8003754":"FLB","8003755":"FLO","8003758":"RLOS","8003759":"RLSM","8003760":"HLOX","8003762":"NLHM","8003763":"NLS","8003764":"RLU","8003765":"RLUM","8003766":"RLO","8003767":"RLUR","8003768":"NLUD","8003770":"NLUS","8003771":"NLT","8003772":"HLBB","8003773":"HLBR","8003774":"ALSJ","8003776":"ALKN, ALKR","8003777":"ALTH","8003778":"ALTS","8003780":"HLN","8003781":"ALB","8003782":"ELS","8003783":"ELDH","8003784":"HLUE","8003785":"ALHS","8003786":"ALD, ALD A","8003788":"ELRN","8003790":"FLUE","8003791":"ELUZ","8003792":"RLUE","8003794":"NLU","8003795":"NLW","8003796":"SLU","8003798":"ALU","8003799":"HLUN","8003800":"HLTT","8003804":"ELUT","8003807":"TMAG","8003808":"TMAI","8003809":"RMKI","8003810":"FMAS","8003813":"NML","8003814":"NMRH","8003815":"FMN","8003816":"FMS","8003817":"FMGO","8003818":"FMG","8003819":"FML","8003820":"FMMB","8003821":"FMM","8003824":"MMA","8003828":"MMAG","8003829":"AMAG","8003830":"MMD","8003831":"TMAL","8003832":"RMS","8003833":"RMSU","8003834":"TMIN","8003839":"NMDF","8003841":"RMR A, RMSM","8003842":"RMFS","8003843":"RMKL","8003844":"RMN","8003845":"RMA","8003847":"RMSE","8003848":"RMW","8003850":"TMAN","8003853":"TMB","8003854":"RMBW","8003855":"EMHD","8003856":"FMBS","8003857":"RMBO","8003859":"MMRN","8003860":"EMV","8003866":"HMAR","8003871":"RMAD","8003872":"RMAR","8003876":"NMB","8003877":"MMOS","8003878":"NMER","8003879":"MSB","8003881":"NMT","8003884":"NMH","8003885":"MMO","8003887":"NMSG","8003888":"EMAM","8003890":"EMHM","8003891":"EMSI","8003896":"EMAR","8003897":"TMAR","8003898":"NMLZ","8003899":"SMSO, SMSW","8003901":"MMSZ","8003903":"NMX","8003905":"MMZG","8003906":"AMA","8003909":"EMAN","8003911":"RMAI","8003913":"TMAU","8003915":"RMAU","8003916":"EDWK","8003920":"RMLG","8003921":"NMSM","8003922":"NMXH","8003924":"KMYW","8003925":"EUNW","8003926":"KMAY","8003927":"KMCH","8003929":"AMD, AMDH","8003930":"TMK","8003931":"KMCK","8003932":"RMK","8003936":"EDWW","8003937":"KMCP","8003938":"NMEE","8003939":"EMEG","8003943":"EMHO","8003946":"EDW","8003947":"HMEI","8003949":"HMRS","8003950":"EMZH","8003952":"MMEI","8003953":"FMLB","8003954":"AMF","8003956":"HMEL","8003957":"HMDF","8003959":"NME","8003960":"AME","8003961":"FMLS","8003965":"EMEU","8003966":"KMD","8003967":"EMED","8003969":"TMG","8003971":"FMBB","8003978":"HMEP","8003979":"MMEG","8003980":"SMER","8003982":"MMR","8003986":"EMES","8003987":"KMES","8003988":"RME","8003989":"MMTG","8003990":"KMEZ","8003991":"SMZM","8003992":"SMZG","8003993":"EMSD","8003996":"FMES","8003998":"EMSN","8004000":"HMSU","8004001":"EMTE","8004003":"FMET","8004004":"SMT","8004008":"MSAF","8004009":"TME","8004011":"NMI","8004013":"NMIK","8004017":"FMI","8004019":"MMIB","8004020":"KMIE","8004023":"KMIL","8004024":"EMIL","8004026":"NMLT","8004028":"NMIM","8004029":"RSLM","8004030":"MMAH","8004032":"RBSK","8004037":"FMGD","8004040":"NMSN","8004043":"MMW","8004048":"AML","8004049":"TMO","8004050":"TML","8004053":"TMOE","8004057":"AMLN","8004060":"FMHF","8004061":"KMGE","8004063":"KMR","8004064":"NMOE","8004065":"FMF","8004066":"RMOE","8004067":"TMHR","8004068":"TMHB","8004070":"TMS","8004071":"MMTN","8004077":"TMON","8004078":"SML","8004080":"SMON","8004084":"MMB","8004090":"NMOU","8004093":"AMM","8004094":"RMO","8004095":"RMOW","8004096":"SMK","8004099":"EMUD","8004100":"FMCK","8004101":"SMD","8004103":"TMRO","8004104":"TMUE","8004105":"HMLN","8004107":"RMH","8004111":"TMUL","8004112":"FMH","8004115":"NMST","8004122":"EMRW","8004124":"RML","8004125":"FMGR","8004126":"NMBG","8004127":"HMHZ","8004128":"MMDN","8004129":"MHAB","8004130":"MHAR","8004131":"MIT","8004132":"MKA","8004133":"MLEF","8004134":"MLEU","8004135":"MMP","8004136":"MRP","8004137":"MSW","8004138":"MMAR","8004139":"MAUG","8004140":"MMAL","8004141":"MMAU","8004142":"MBAL","8004143":"MDFG","8004144":"MEGS","8004145":"MFAS","8004146":"MFG","8004147":"MFE","8004148":"MGI","8004149":"MJK","8004150":"MKF, MKFS","8004151":"ML","8004152":"MLW","8004153":"MLO","8004154":"MMT","8004155":"MMCH","8004156":"MNA","8004157":"MOZ","8004158":"MP, MP S","8004159":"MPER","8004160":"MRI, MRI P","8004161":"MSN","8004162":"MTR","8004163":"MWKR","8004165":"MMST","8004166":"SMR","8004167":"MFHB","8004168":"MFHM, MFHT","8004169":"NMUE","8004171":"FMTR","8004172":"SMSA","8004173":"ENHF","8004174":"SMLB","8004177":"AMUE","8004178":"RMU","8004179":"MMHG","8004181":"MFH, MFHH","8004182":"TMU","8004183":"HMS","8004184":"RMRG","8004185":"MMU","8004186":"MUO","8004188":"TMT","8004189":"RMCH","8004190":"EMSR","8004191":"NNAB","8004192":"RMU B","8004193":"FNAC","8004195":"TNAS","8004196":"TNA","8004198":"NNIL","8004199":"SNAB","8004200":"KNAM, KNAMN","8004201":"TNA M","8004202":"TNAI","8004204":"MMAM","8004206":"FNAS","8004207":"MNBN","8004208":"HNAH","8004210":"FNU","8004215":"RNB","8004216":"RNA","8004217":"RNMA","8004218":"RNH","8004219":"RNT","8004220":"TN","8004222":"RNEZ","8004223":"SNF","8004227":"ANEZ","8004228":"ENHH","8004229":"TNEH","8004230":"EDDS","8004232":"TN M","8004233":"TNL","8004235":"TNED","8004236":"SNE","8004238":"TNSN","8004239":"MNSG","8004240":"MNEW","8004241":"ANTB","8004242":"KNEH","8004246":"FNIS, FNIU","8004247":"ANWF","8004249":"MNGH","8004250":"NNAE","8004251":"ENBM, ENBMP","8004252":"MNB","8004253":"SNBR","8004254":"MNBD","8004256":"MNBK","8004257":"RNBU","8004258":"TND","8004260":"HNPL","8004266":"AHAB","8004267":"AHRF","8004268":"NNDU","8004269":"EDK","8004271":"HNKO","8004273":"ENRA","8004276":"TNN","8004279":"MNF","8004280":"TRNF","8004284":"NNP","8004288":"EDOP","8004295":"FNF","8004297":"FNK","8004302":"ANL","8004304":"RNL","8004305":"NNT","8004306":"RND","8004310":"NNKS","8004312":"SNKW","8004313":"ENK","8004316":"KNRC","8004317":"KNSD","8004318":"MNES","8004319":"NNEU","8004320":"KNAK","8004321":"NNSG","8004322":"HNRU","8004323":"NNA","8004325":"NNU","8004326":"MND","8004327":"ANT","8004328":"FNSM","8004331":"RNSS","8004332":"NNW","8004333":"TNHO","8004335":"KNAL","8004336":"NNAM","8004338":"TNW","8004340":"ENV","8004343":"ANB","8004344":"SNID","8004345":"FNFD","8004348":"FNO","8004349":"FNOL","8004350":"FNR","8004351":"FNRO","8004352":"FSLH","8004353":"FNRW","8004357":"TSNU","8004363":"TNB","8004364":"FNCH","8004366":"KND","8004367":"FNIE","8004369":"ENID","8004373":"FNIB","8004376":"FNHD","8004379":"FNDH","8004380":"FNH","8004381":"ENDV","8004382":"FNJ","8004391":"MNLH","8004392":"SNDL","8004393":"KNME","8004395":"FNMI","8004396":"SNDM","8004400":"FNSD","8004401":"MNRU","8004402":"FROD","8004404":"MNRO","8004405":"FNDS","8004406":"ENDN","8004407":"ENDO","8004409":"FNS","8004413":"TNS","8004415":"FNV","8004417":"FNL","8004418":"FNWF","8004419":"EDUV","8004420":"FNDW","8004423":"RNID","8004424":"FNIZ","8004425":"TNF","8004426":"ENBE","8004429":"FKON","8004430":"ENIR","8004432":"FNIR","8004433":"KNIK","8004434":"KNIV","8004435":"FNIV","8004438":"SNI","8004440":"EHWB","8004441":"HNTH","8004442":"NDHF","8004444":"SNON","8004446":"MNHN","8004448":"ENOB","8004449":"HND","8004451":"MNOD","8004452":"HNO","8004453":"NOBW","8004456":"ANH","8004458":"TNO","8004460":"ANZ","8004461":"ENOW","8004462":"KNO","8004463":"SNOR","8004464":"RNO","8004466":"ANF","8004469":"NNRO","8004470":"NNOS","8004471":"NNO","8004473":"NNRS","8004474":"EBW","8004476":"NDTH, NND","8004477":"NNEI, NNES","8004478":"NNER","8004480":"NNLH","8004481":"NNMO","8004483":"NNRE, NNRF","8004484":"NNSR","8004485":"NNSW","8004486":"NNST","8004487":"NNSE, NNSN","8004488":"TNU","8004489":"RNBO","8004490":"TNUF","8004491":"NNRH","8004493":"NSTD","8004496":"TOAI","8004497":"FORA","8004499":"FOW","8004503":"MOA","8004504":"NOA","8004506":"MOU","8004507":"MOD","8004513":"SOH","8004514":"SOG","8004515":"FOBA","8004517":"TOBB","8004518":"FOB","8004521":"NON","8004523":"FOBD","8004525":"TOLC","8004527":"KOE","8004528":"TOES","8004529":"NOB","8004531":"MOGS","8004532":"MOGB","8004533":"NOH","8004538":"FOHS","8004540":"EOHT","8004541":"EOS, EOS P","8004542":"EOSD","8004545":"ROB","8004546":"ROBK","8004549":"TON","8004550":"KOL","8004552":"RLAU","8004553":"TOL","8004554":"MOLH","8004555":"SOW","8004557":"SOBM","8004563":"TOB","8004567":"FOBH","8004571":"MOMN","8004577":"ROSC","8004580":"MOSM","8004583":"NOBS","8004584":"MOSF","8004585":"MOF","8004589":"FOBS","8004592":"NOT","8004593":"FOTS","8004595":"RUDM","8004596":"FOU","8004597":"FOV","8004601":"FOBW","8004603":"ROD","8004604":"KOWI","8004605":"TOBZ","8004609":"NOK","8004610":"HOCH","8004613":"EOP","8004614":"FOCK","8004616":"KODE","8004620":"TCP","8004623":"TOE","8004624":"TOEW","8004626":"EOEL","8004629":"NOER","8004630":"EOER","8004632":"TOED","8004633":"NRTL","8004635":"FOE","8004636":"ROH","8004637":"TOET","8004639":"ROKS","8004640":"FOWH","8004642":"EOVP","8004643":"ROU","8004645":"FOO","8004647":"FOBI","8004652":"HOFN","8004653":"FOFF","8004654":"MOFF","8004658":"ROFH","8004661":"AOP, AOPS","8004662":"MOH","8004664":"FOK","8004665":"HOK","8004667":"MOL","8004668":"HOLB","8004669":"AOL","8004670":"HOLW","8004674":"EOLP","8004676":"EOLS","8004677":"SOU","8004679":"ROP","8004680":"FOPP","8004681":"TOP","8004683":"RORW","8004689":"HOHT","8004694":"KMBO","8004700":"NOS","8004701":"MOSH","8004702":"HOSS","8004703":"MOM","8004704":"HOTM","8004705":"HOTL","8004706":"KOSS","8004707":"AODT","8004709":"HOTW","8004712":"FOM","8004713":"FOS","8004714":"FOHF","8004719":"AOH","8004720":"HOTT","8004723":"MONH","8004724":"NOBE","8004725":"NOTS","8004726":"MOTF","8004727":"AOF","8004728":"AOBG","8004731":"MOTW","8004733":"MOBR","8004735":"HOTZ","8004739":"KOV","8004740":"TOW","8004741":"AOS","8004742":"MOYM","8004744":"EPDK","8004745":"EPDN","8004746":"KPFF","8004747":"MPD","8004748":"SPZ","8004749":"NPK","8004750":"APF","8004751":"HPAP","8004753":"MPP","8004755":"NPB","8004756":"NPAR","8004758":"NPE","8004759":"NPZ","8004760":"HP","8004761":"MPEI","8004762":"MPBG","8004763":"MPBN","8004764":"MPTN","8004765":"MPTO","8004767":"MPZ","8004770":"MPRM","8004771":"SPE","8004774":"NPET","8004775":"MPE","8004777":"HLAD","8004780":"MPFH","8004781":"MPF","8004784":"SPF","8004788":"FPD","8004796":"TPF","8004797":"NPEN","8004801":"TPW","8004803":"NPD","8004806":"MPFD","8004807":"MPFS","8004809":"MPFW","8004813":"RPB","8004814":"SPI","8004815":"MPI","8004816":"FPU","8004819":"AP, APS","8004820":"NPI","8004822":"SPS","8004826":"KPL","8004827":"MPL","8004835":"NPLF","8004838":"EPLT","8004841":"APLN","8004842":"TPL","8004847":"NPG","8004848":"APN","8004849":"NPOE","8004851":"HPOG","8004853":"NPOI","8004854":"MPO","8004858":"NPMH, NPOM","8004859":"SPOM","8004862":"APB","8004865":"NPOP","8004868":"HPTA, HPTH","8004869":"KPR, KPRH","8004873":"KPW","8004874":"MPH","8004875":"NPOH","8004878":"EPRA","8004879":"APZ","8004880":"NPS","8004881":"NPR","8004882":"NPRE","8004883":"EPRN","8004885":"MPR","8004888":"APD","8004893":"MPM","8004898":"KPUL","8004899":"MPUL","8004900":"MPU","8004901":"NPU","8004903":"APU","8004905":"EQLK","8004907":"KQ","8004908":"EQL, EQL O, EQL W","8004909":"SQS","8004910":"SQI","8004913":"ARH","8004914":"MRDD","8004917":"NRA","8004919":"HRAH","8004920":"KDHL","8004922":"MRN","8004923":"NRAF","8004924":"ARS","8004925":"MRAG","8004926":"NRAH","8004927":"MRAM","8004929":"SRCH","8004930":"TRM","8004931":"RRBI","8004932":"RRBH","8004933":"NRAB","8004935":"RRN","8004936":"NRSL","8004938":"SRAS","8004942":"FRAN","8004945":"HRST","8004948":"KRAO","8004952":"ARF","8004955":"MRA","8004960":"ERMA","8004962":"FRA","8004965":"TRB","8004966":"MRH","8004967":"KREC","8004970":"HRFD","8004971":"NRDF","8004972":"ERFE","8004975":"SRWH","8004978":"NRCH","8004979":"NRZ","8004981":"NREG","8004983":"NRPF, NRPH","8004987":"NRGF","8004988":"NRU","8004993":"SRW","8004994":"NREK","8004995":"FRHM","8004997":"RRU","8004999":"TRF","8005001":"TRXS","8005002":"TRCB","8005003":"FRSA","8005005":"NREI","8005007":"MRCH","8005008":"MRS","8005013":"RRIN","8005014":"SREI","8005015":"RRHM","8005016":"ARBK","8005019":"ARD","8005020":"FREI","8005023":"ARE","8005026":"RRSH","8005027":"FRSK","8005030":"EREK","8005031":"EEBS","8005033":"KR","8005034":"KRG","8005035":"KRLU","8005037":"RR","8005039":"FREH","8005044":"SRE","8005045":"NREN","8005047":"HRTN","8005049":"NREZ","8005050":"NRT","8005052":"TREW","8005053":"TREB","8005054":"TRES","8005055":"ERHA","8005057":"KRBL","8005058":"KRBA","8005059":"KRBE","8005062":"KRBR","8005064":"RRH","8005065":"KRHO","8005067":"RRHH","8005068":"RRW","8005069":"RRZA","8005070":"KRHE","8005071":"RRZM","8005072":"RRZU","8005073":"KRYO","8005074":"KRHD","8005077":"RRIH","8005080":"ARL","8005083":"FRID","8005086":"MRDU","8005087":"TRI","8005089":"FRIE","8005090":"RRL","8005092":"NRCK","8005094":"SRI","8005095":"ARY","8005096":"HRIE","8005097":"TRH","8005098":"RRIM","8005101":"RRI","8005102":"ERIK","8005103":"RRIT","8005104":"HRIN","8005106":"ARI","8005107":"HRTH","8005111":"SRC","8005112":"NRC","8005113":"SROA","8005116":"FRB","8005119":"HRDK","8005120":"FRO","8005121":"NROD","8005122":"NRTM","8005125":"FRFH, FRFHW","8005127":"MRM, MRMS","8005131":"FROH","8005133":"NROE","8005134":"KROE","8005136":"RROE","8005137":"HROT","8005138":"MRTA","8005139":"NRTH","8005140":"NRP","8005141":"NRPG","8005142":"NRPE","8005143":"KRST","8005146":"RRST","8005149":"MRFD","8005151":"TRO","8005152":"KROI","8005153":"KROL","8005154":"NRON","8005156":"FROL","8005157":"TROM","8005159":"KROM","8005160":"HRBG","8005161":"FRON","8005163":"FROS","8005164":"KROS","8005166":"NRNU","8005168":"TRBG","8005172":"SROB","8005177":"NRL","8005178":"NRW","8005181":"RRM","8005182":"FROF","8005184":"FRTN","8005185":"NRO","8005189":"NRBG","8005190":"NROT","8005191":"AROP","8005195":"TRR","8005197":"TRT","8005198":"NRTD","8005199":"NRHN","8005200":"TRG","8005201":"TGOL","8005202":"TRSA","8005205":"ERUD","8005207":"ARP","8005208":"FRS","8005209":"NRUE","8005213":"FRDH","8005214":"RRZD","8005217":"RRZH","8005218":"KRUN","8005219":"NRLB","8005220":"FRUE","8005221":"FRUO","8005225":"KRUM","8005227":"EROL","8005229":"FRUK","8005231":"NRST","8005236":"TRUT","8005238":"NSL","8005241":"SSO","8005243":"SSB","8005245":"SSAB","8005246":"SSLB","8005247":"SSLS","8005249":"FSAA","8005250":"NSA","8005253":"TSA","8005255":"RSAE","8005256":"ASAG","8005257":"RANS","8005258":"TSAL","8005259":"MSAL","8005260":"SSMT","8005261":"FBSS","8005262":"HSAL","8005264":"HEB","8005265":"HSB","8005269":"HSI","8005270":"HSL","8005272":"EDEF","8005274":"HST","8005275":"HSW","8005276":"ESZK","8005279":"NSND","8005282":"HSAN","8005283":"ESDB","8005285":"HSAB","8005287":"HSAK","8005288":"ASDW","8005289":"ESCI","8005292":"HSRD","8005293":"ESAS","8005298":"KSA","8005299":"MSR","8005301":"TSL","8005302":"MSGB","8005304":"NGLH","8005306":"SSU","8005311":"MSFL","8005316":"ESMU","8005317":"RSAL","8005320":"HSDL","8005321":"ASAZ","8005322":"ESMD","8005324":"HBLB","8005329":"TSEP","8005330":"ASL","8005332":"SSD","8005333":"TSK","8005334":"TSX","8005335":"RSZL","8005336":"HSCD","8005338":"ESCF","8005339":"KSEV","8005340":"HSCI","8005342":"SUZD","8005343":"HSCB","8005345":"RSDS","8005346":"SSWL","8005347":"RSCM","8005350":"RSCL","8005352":"NSG","8005355":"HSCL","8005356":"KSLA","8005362":"ASW","8005364":"RSG","8005365":"FSBA","8005366":"RSR","8005367":"MSCS","8005369":"ESHO","8005370":"ESNS","8005371":"RSLU","8005374":"FSMU","8005378":"KSMI","8005379":"TSHM","8005381":"MSCN","8005383":"NSMA","8005388":"NSNE","8005389":"MLLS","8005390":"ASDN","8005391":"NSY","8005392":"SSOF","8005393":"FSCH","8005400":"NSGN","8005405":"HSWO","8005406":"MSNG","8005412":"NSOE","8005413":"HSPP","8005415":"ESHM","8005417":"MSDF","8005418":"MSGU","8005419":"MHP, MHPW","8005420":"RSCH","8005421":"TSPF","8005423":"SSCP","8005424":"TSF","8005425":"RSCW","8005426":"RSCS","8005431":"TSCH","8005432":"MSHN","8005435":"ASC","8005436":"HSTT","8005439":"NSC","8005440":"NSCL","8005442":"MSHH","8005444":"MSMN","8005445":"TSWA","8005449":"TSHL","8005451":"NSAI","8005454":"TSWK","8005455":"FSTS","8005456":"FSLN","8005457":"HSWS","8005465":"NSW","8005466":"NSBS","8005468":"ASWA","8005469":"NSDO","8005476":"SSWE","8005479":"NSMT","8005481":"NSST","8005485":"NSWF","8005488":"KSWW","8005489":"MSWN","8005490":"RSCV","8005494":"RSZ","8005495":"MSDG","8005497":"RSST","8005498":"FSN","8005499":"KSEC","8005502":"RSEE","8005504":"MSH","8005505":"MSEG","8005506":"MSEB","8005507":"HS","8005508":"MSE","8005510":"SSE","8005511":"HSEN","8005516":"NSN","8005517":"NSS","8005518":"NSP","8005520":"NSLZ","8005522":"FSEL","8005523":"NSLI","8005525":"ESEM","8005526":"ESEB","8005532":"MSED","8005534":"ESEL","8005535":"ESES","8005536":"TSE","8005539":"SSER","8005540":"TSER","8005543":"NSF","8005544":"FSG","8005545":"NSE","8005547":"NSYB","8005551":"RSIB","8005555":"ESIH","8005556":"KSIB","8005557":"NSDF","8005560":"RSIS","8005561":"ASID","8005562":"SSBG","8005566":"TSY","8005568":"TSIH","8005569":"ESIL","8005572":"NSHU","8005574":"TSI","8005575":"KSID, KSIU","8005576":"FSL","8005577":"FSI","8005578":"RSM","8005580":"KSIZ","8005581":"NSIH, NSIN","8005582":"RSIN","8005583":"SSOB","8005586":"ASOE","8005587":"RSZM","8005588":"RSZN","8005590":"KSS","8005592":"FSOL","8005593":"MSO","8005594":"ASON","8005597":"KSGR","8005598":"KSM","8005600":"ESON","8005602":"RSOH","8005607":"MSHM","8005608":"TSON","8005609":"MSF","8005610":"FSON","8005613":"AS","8005616":"TSP","8005617":"TSPM","8005622":"KSPA","8005623":"FSPE","8005624":"SSPE","8005625":"NSKN","8005626":"RSPN","8005628":"RSP","8005629":"KSPI","8005630":"NSPU","8005635":"ESPR","8005636":"FSPO","8005637":"FSPR, FSPRN, FSPRS","8005638":"HSPR","8005639":"MSAB","8005640":"ASP","8005644":"RSGO","8005645":"FSGO","8005646":"FSGH","8005648":"RSIG","8005649":"SSI","8005652":"MKL","8005653":"MMG","8005655":"ASD","8005656":"MOTN","8005658":"SSTO","8005659":"SSWD","8005661":"FSTA","8005662":"HSHG","8005663":"ASHS","8005665":"HSDF","8005668":"FST","8005670":"NSFN","8005672":"MSTA","8005673":"SSTB","8005674":"NSM","8005675":"MSNO","8005676":"MST","8005678":"SSTH","8005682":"HSTF","8005686":"NSWH","8005688":"RSNA","8005689":"SSTA","8005690":"FSA","8005692":"NSD","8005699":"MSA","8005700":"FSFZ","8005701":"RSTN","8005702":"ESBS","8005703":"HSFD","8005704":"ESTG","8005706":"FSHM","8005708":"HSTM","8005712":"EGRK","8005713":"RSTE","8005714":"RSS","8005715":"SSTW","8005717":"ASTE","8005720":"FSTZ","8005723":"TSTD","8005725":"MSTS","8005726":"TSTE","8005731":"ESKA","8005734":"NSOK","8005735":"MSD","8005736":"FSTH","8005737":"NSTH","8005739":"FSTK","8005740":"FSTR","8005746":"KSOM","8005747":"TSGZ","8005748":"KSTZ","8005749":"MSMS","8005750":"TSTR","8005752":"NSK","8005760":"NSU","8005761":"ESTU","8005763":"HSUB","8005766":"TSEB","8005767":"TSN","8005768":"TFL","8005769":"TSC","8005770":"TSFE, TSZ F","8005771":"TSM","8005772":"TSOM","8005773":"TSRO","8005774":"TSSM","8005775":"TSU, TSU P, TSUH","8005776":"TSV","8005777":"TSZA, TSZAH","8005778":"TSZ","8005779":"TSOS","8005780":"HSUD","8005781":"ASU","8005782":"ASUE","8005783":"ASDD","8005785":"ASDF","8005786":"TSUE","8005787":"NSUE","8005788":"ASUP","8005790":"TSD","8005791":"TSUL","8005792":"TSUS","8005795":"TSBM","8005796":"SSZ","8005797":"SSZA","8005798":"FSZ","8005799":"FSZN","8005800":"NSR","8005801":"NSRH","8005802":"MSUG","8005809":"HSYK","8005810":"ESYL","8005811":"ESYH","8005812":"STB","8005820":"TTM","8005823":"TTA","8005824":"MTPF","8005825":"ATP","8005826":"ATAT","8005828":"MTA","8005831":"MTU","8005833":"MTO","8005834":"ETEL","8005835":"STS","8005836":"RTMU","8005843":"STWF","8005845":"TTL","8005852":"MTMA","8005855":"NTAS","8005857":"STN","8005858":"ATHS","8005864":"NTHM","8005865":"KTH","8005867":"ATB","8005870":"ATK","8005871":"RTI","8005874":"ATIM","8005876":"RTIT","8005885":"ATG","8005887":"ATM","8005888":"ATST","8005889":"STT","8005890":"NTB","8005891":"FTH","8005895":"NTG","8005896":"FTRE","8005901":"HTRI","8005902":"RTR","8005903":"NTRI","8005905":"STRS","8005907":"NTF","8005908":"TTO","8005910":"KTR","8005911":"TTR","8005917":"TTD","8005918":"TTLU","8005920":"MTFD","8005925":"TTUS","8005927":"MTZ","8005929":"HT","8005930":"EUBD","8005931":"RUW","8005935":"KUBP","8005937":"RUEB","8005940":"MUS","8005942":"RUEM","8005943":"RUEN","8005945":"SUG","8005946":"TTUG","8005947":"NU","8005948":"MUF","8005949":"TUH","8005950":"FUR","8005952":"TUO","8005954":"TUDT","8005955":"TU F","8005962":"MURO","8005963":"RUN","8005966":"NUDF","8005967":"NUND","8005970":"KUN","8005971":"EUK","8005972":"FUKO","8005975":"MUAG","8005976":"NUA","8005979":"TBB","8005983":"TUE","8005986":"MUFG","8005989":"TUG","8005991":"MUH","8005993":"MUHN","8005995":"NUT","8005997":"TUK","8005998":"TUL","8006001":"HUNL","8006006":"MUG","8006008":"TURB","8006017":"NUS","8006019":"SUSZ","8006030":"TUA","8006031":"FUCH","8006032":"KURF","8006035":"KUR","8006036":"KURR","8006037":"MURS","8006039":"TURS","8006041":"HUS","8006048":"MUTG","8006052":"NVA","8006053":"TV","8006054":"KVA","8006056":"HVA","8006058":"AVF","8006059":"MVS","8006060":"HVEC","8006061":"HVCH","8006062":"AVLS","8006064":"EVLR","8006065":"NVE","8006067":"NVN","8006068":"FVOE","8006076":"HV","8006078":"HVWH","8006083":"FVR","8006085":"NVK","8006086":"NVI","8006089":"HVIN","8006090":"HVIS","8006091":"HVLO","8006094":"MVRN","8006095":"HVOE","8006098":"EVD","8006100":"SVO","8006101":"MVG","8006104":"HVOL","8006109":"EVOK","8006112":"HVOP","8006116":"HVHP","8006117":"EVRD","8006118":"EVRO","8006120":"NV","8006125":"RWCH","8006131":"MWAE","8006132":"FWAE","8006134":"NWAF","8006135":"TWHF","8006136":"FWFK","8006137":"RWG","8006139":"EWAL","8006144":"HWAZ","8006147":"NWA","8006148":"AWK","8006154":"TWG","8006155":"NWDH","8006156":"SWAB","8006157":"TWY","8006159":"RWA","8006163":"NWLM","8006167":"RWU, RWU S","8006170":"SWL","8006171":"TWH","8006172":"HWKD","8006175":"FWF","8006181":"NWLD","8006183":"FWAH","8006184":"MWHN","8006189":"MHSN","8006190":"MWKN","8006191":"KWAP","8006193":"HWSR","8006194":"EEHT","8006197":"AOW","8006198":"AWCH","8006200":"TWW","8006203":"TWAN","8006206":"EWAF","8006207":"EWEM","8006210":"MWGU","8006212":"TWV, TWVH","8006213":"AWA","8006215":"RWR","8006217":"TWA","8006218":"MWBG","8006219":"MWSG","8006222":"SWAS","8006224":"MWAS","8006226":"EWAT","8006227":"EWHP","8006229":"FWST","8006232":"FWCK","8006233":"HWED","8006236":"AWL","8006237":"HWEE","8006240":"KWEE","8006243":"KWEG","8006252":"SWE","8006256":"MWEI","8006257":"NWGR","8006258":"MWDB","8006261":"RWD","8006264":"NWDG","8006266":"NWHR","8006267":"NWHF","8006268":"TSWF","8006270":"HWUE","8006271":"TW","8006272":"RW","8006273":"RWEI","8006277":"TWEL","8006279":"MWLB","8006280":"KWES","8006281":"TWLH","8006289":"TWR","8006290":"TWRW","8006292":"RWSS","8006293":"FWEK","8006294":"TELI","8006296":"TWSN","8006298":"NWG","8006300":"NWEO","8006303":"KWEH","8006304":"FWN","8006306":"FWI","8006309":"MWZH","8006312":"FWZ","8006313":"FWES","8006315":"SWN","8006319":"AWBS","8006320":"EWSE","8006321":"RWEL","8006323":"EWVE","8006330":"AWE","8006331":"TWD","8006336":"HWSN","8006339":"EWHL","8006340":"FWDF","8006342":"EWER","8006346":"TWER","8006347":"NWRB","8006348":"EWRN","8006349":"NWFD, NWFH","8006353":"MWHA","8006356":"EWFK","8006357":"AWBU","8006358":"HWES","8006359":"MWS","8006360":"EWBH","8006361":"EWBV","8006363":"MWDF","8006366":"MWM","8006367":"HWTH","8006369":"AWLA","8006373":"TWSH","8006376":"TWX","8006378":"MWHS","8006379":"EWSM","8006380":"NWL","8006383":"EWN","8006386":"EWET","8006389":"EWIC","8006390":"NWK","8006391":"KWIC","8006392":"SWK","8006401":"FWRA","8006402":"HWRN","8006403":"NWU","8006404":"FWO","8006407":"FWE","8006408":"FWIG","8006409":"FWS","8006414":"NWDC","8006416":"TWID","8006417":"RWI","8006418":"NWIE","8006421":"RWS","8006426":"NWI","8006432":"TWIB","8006436":"HWIH","8006440":"TWL","8006441":"RWSW","8006445":"HW","8006448":"NWHD","8006449":"HWBD","8006454":"FWLM","8006455":"NWIG","8006456":"TWLB","8006459":"FWTH","8006460":"AWIR","8006461":"SWIG","8006463":"SWIN","8006465":"FWIN","8006466":"EWIL","8006468":"RWND","8006472":"NWB","8006473":"NWIN","8006475":"AWG","8006476":"NWKH","8006479":"TWI","8006481":"SWI","8006482":"HWIN","8006483":"SWNW","8006484":"AWI","8006485":"TWIN","8006486":"EWTB","8006488":"NWN","8006489":"AWIM","8006498":"KWIR","8006499":"FWIR","8006501":"EWIN","8006503":"HWIS","8006505":"EWIK","8006508":"RMHH","8006509":"RMLB","8006510":"EWIA","8006511":"RMNS","8006513":"TSUN","8006514":"EEHH","8006516":"KWIS","8006517":"TWIT","8006520":"HWTM","8006524":"FWZN","8006527":"AWRT","8006528":"FWX","8006529":"FWOE","8006531":"RWRZ","8006533":"MWNS","8006534":"FWRR","8006535":"FWOD","8006536":"RWRD","8006537":"MWTI","8006541":"AWLF","8006544":"RWO","8006545":"TWO","8006546":"FWON","8006548":"FWFG","8006550":"MWO","8006552":"HWOB","8006554":"NWM","8006555":"SWFS","8006559":"AWOL","8006561":"HWWI","8006570":"AWRE","8006572":"AWST","8006575":"EWAP","8006577":"EWGD","8006578":"EWGT","8006581":"SWB","8006582":"NWS","8006586":"NWZ","8006588":"NWBZ","8006590":"EWUF","8006592":"HWUL","8006596":"KWBA","8006607":"KWL, KWLP","8006616":"KWRO","8006618":"KWSO","8006619":"KWS","8006620":"KWU","8006623":"KWZ","8006624":"NWLZ","8006625":"TWUM","8006626":"TWUN","8006627":"SWU","8006629":"RWY","8006630":"KX","8006634":"NZA","8006635":"NZ","8006641":"RZ","8006642":"TEZL","8006643":"FZK","8006644":"FZR","8006646":"FZH","8006648":"FZEP","8006659":"KZI","8006660":"NZF","8006661":"RZIM","8006662":"TZI","8006663":"FZM","8006664":"NZI","8006666":"NZIK","8006667":"RVLZ","8006670":"MZHP","8006671":"MZO","8006672":"RZT","8006673":"KZU","8006676":"TZU","8006678":"RZHN","8006679":"RZUN","8006680":"SZW","8006684":"NZWL","8006685":"NZWU","8006686":"RZW","8006687":"FZW","8006688":"MUSM","8006690":"FFGA","8006691":"FFTA","8006692":"FHAU","8006696":"MNPS","8006698":"TSS","8006699":"TSFS","8006700":"TSMI","8006704":"ALTK","8006705":"ARES","8006706":"AKS","8006707":"FHMD","8006709":"EDRN","8006710":"EBOH","8006711":"EBOW","8006712":"EHGW","8006713":"KLMH, KLMI","8006714":"KSV","8006717":"MVAD","8006718":"KWV","8006719":"KWO","8006730":"MNM","8006743":"TSNS","8006745":"NSTT","8006749":"AHFS","8006750":"ANWS","8007273":"AWAH","8007357":"SURM","8007441":"RNST","8007442":"RWB","8007443":"RESN","8007444":"RHM","8007445":"RAG","8007482":"SRAM","8007768":"HNDM","8007790":"ANSW","8007856":"NWDM","8007857":"RSAI","8007858":"RSFL","8007859":"RKPW","8007860":"RSHF","8007868":"SLCJ","8010001":"DAD","8010003":"LA","8010004":"WA","8010006":"DAF","8010007":"UA","8010008":"LACF","8010009":"LAL","8010011":"DAUO","8010012":"DAUU","8010013":"LBB","8010014":"UBL","8010016":"WDO","8010017":"WFW","8010018":"WK","8010019":"UKO","8010020":"ULS","8010021":"USZ","8010022":"DSA","8010026":"DBZ","8010029":"BBES","8010031":"BBIG","8010032":"UBK","8010033":"WBG","8010035":"BKH, BKLH","8010036":"BLI, BLO","8010040":"DKUR","8010041":"BSW, BSWP","8010043":"LBG","8010044":"DBF","8010046":"LBEU","8010047":"LBZ","8010048":"UBKN","8010049":"DBW","8010050":"LBT","8010051":"WBL","8010053":"BBF, BBFD","8010054":"UBM","8010055":"UBD","8010056":"LBLG","8010059":"LBOR","8010060":"LB","8010061":"UBR","8010064":"WBR","8010066":"WB","8010067":"UBF","8010069":"BC","8010070":"LCBO","8010071":"LCBW","8010072":"DCW","8010073":"BCS","8010074":"DCR","8010076":"LDL","8010077":"LD","8010078":"LDB","8010079":"BDKO, BDKU","8010080":"DDE","8010081":"UDST","8010084":"LGND","8010085":"DH","8010086":"LMR, LMRH","8010088":"DKT","8010089":"DN, DN A","8010091":"DRR","8010092":"DEB","8010093":"WE","8010094":"DEIB","8010095":"LEG","8010096":"LEI","8010097":"UEI","8010099":"BEW","8010100":"BEB","8010101":"UE, UE P","8010102":"UEN","8010103":"LF, LF O, LF U","8010105":"UEIP","8010106":"DFA","8010108":"DFL","8010109":"BFHS, BFLH","8010110":"UF","8010111":"BFO","8010113":"BFP","8010115":"DFR","8010116":"DFH, DHG","8010117":"WTV","8010118":"UFT","8010119":"LFE","8010120":"BFUW","8010121":"LGG","8010122":"LGH","8010123":"LGN","8010124":"URD","8010125":"UG","8010126":"UGS","8010129":"DGL","8010130":"DGLS","8010131":"DG","8010133":"UGW","8010134":"DGZ","8010136":"UGO","8010137":"UGD","8010139":"WGW","8010140":"UGR","8010141":"WGV","8010142":"UGM","8010144":"DGR","8010145":"UGH","8010146":"LGC","8010150":"BGRU","8010151":"LGSN","8010152":"LGT","8010153":"WG","8010154":"LGK","8010155":"LHME","8010156":"WHL","8010157":"LHB","8010158":"LHL","8010159":"LH, LHG","8010160":"LHN","8010161":"LEGO, LEGOB","8010162":"LHAD, LHADB","8010163":"DHD","8010166":"DHN","8010168":"LHE","8010169":"LHR","8010170":"UHR","8010171":"BHC","8010172":"LHWU","8010173":"WHO","8010174":"BHOR, BHR","8010175":"WNRR","8010176":"WHOR","8010177":"BHW","8010178":"UI","8010179":"WJK","8010182":"BJUE","8010183":"BSEO","8010184":"DC","8010185":"DCD, DCS","8010186":"LKRS","8010189":"BKI","8010191":"LKM","8010193":"BKW","8010194":"LKO","8010195":"LK","8010196":"UKS","8010198":"UKU","8010199":"WLD","8010201":"WLG","8010202":"DLH","8010203":"UL","8010204":"LKMR","8010205":"LL, LL T","8010206":"LLC","8010207":"LLEL","8010208":"LLPD, LLPDH","8010209":"LLP","8010210":"WLI","8010212":"DL","8010213":"WLK","8010214":"WLO","8010215":"BLF","8010216":"WL","8010217":"BLB","8010220":"BLN","8010222":"LW","8010224":"LM","8010226":"LMN","8010227":"WMA","8010228":"LMAG","8010229":"DMEH","8010230":"UM","8010231":"LMEI","8010232":"LMG","8010233":"BMIP","8010234":"DMHD","8010235":"UMH","8010236":"BMB","8010238":"LNA","8010239":"BNAU","8010240":"UNM","8010241":"WN","8010242":"UND","8010243":"LNK","8010244":"DNM","8010246":"WNRW","8010248":"WNS","8010249":"DNE","8010250":"WNT","8010253":"DNR","8010254":"LNHG","8010255":"BHF, BOSB","8010256":"UN","8010259":"DOZ","8010261":"LOE","8010264":"UO","8010266":"LO","8010267":"WPM","8010268":"WP","8010269":"LPG","8010272":"DPI","8010273":"WPZ","8010274":"UPL","8010275":"DP","8010279":"BPDP","8010280":"BPDC","8010281":"LPT","8010282":"WPL","8010284":"WPI","8010285":"DPR","8010287":"WPR","8010288":"UPR","8010290":"LQB","8010291":"LQ","8010292":"DRB, DRB B","8010293":"DRBK, DRBW","8010296":"LRW","8010297":"DR","8010299":"LRN","8010300":"WRV","8010301":"DRON","8010302":"LR","8010304":"WR","8010305":"URTB","8010306":"UR","8010307":"URS","8010308":"BRU","8010309":"US","8010310":"LSW","8010311":"LSL","8010312":"USG","8010315":"USM","8010317":"DSB","8010318":"LSB","8010321":"LSH","8010322":"WSN","8010324":"WS","8010325":"WSGN, WSGR","8010327":"BSN","8010328":"USD","8010329":"USH","8010330":"BSP","8010331":"DEG","8010332":"LSF","8010333":"DSPH","8010334":"LS","8010335":"LSS","8010336":"DSRB","8010337":"DSTO","8010338":"WSR","8010339":"WSB","8010341":"BST, BSTV","8010342":"USF","8010343":"LSTF","8010345":"USL","8010347":"WT","8010348":"WTE","8010349":"UTEU","8010350":"UTH","8010351":"LTG","8010352":"UTR","8010353":"BUK","8010354":"UUTL","8010355":"WV","8010357":"BGU","8010359":"DWA","8010361":"WWR","8010364":"LWEG","8010365":"UWE","8010366":"UWM","8010367":"DWS","8010368":"UW","8010370":"BWW","8010371":"BWR, BWRO, BWRU","8010372":"DWR","8010373":"BWE","8010374":"LWD","8010375":"UWH","8010376":"BWG","8010377":"BWP","8010378":"BWHO","8010380":"DWT","8010381":"WWI","8010382":"WW","8010383":"DWIO","8010384":"WWK","8010385":"UWK","8010386":"BWRZ","8010387":"UWF","8010388":"DWD","8010389":"BWUS","8010390":"LZ","8010391":"UZL","8010393":"DZ","8010395":"BZO","8010396":"WZS","8010397":"DZW","8010398":"DZA","8010399":"WF","8010400":"DNKW","8010403":"BCHB, BCHS","8010404":"BSPA, BSPD","8010405":"BWS, BWSS","8010406":"BZOO, BZOS","8011003":"BAF, BAHR","8011004":"BAFR","8011005":"BAFN","8011011":"WAHU","8011014":"BARO","8011016":"BAD","8011017":"WAF","8011018":"LALT","8011019":"DAG","8011025":"WATR","8011027":"WALW","8011028":"UACH","8011029":"UAMM","8011031":"WAH","8011033":"DAMD","8011034":"BART","8011038":"LAMS","8011039":"DAMH","8011042":"LANG","8011043":"LAG","8011044":"WAK","8011046":"BKAR, BKRW","8011048":"LAB","8011051":"UAP","8011053":"LAF","8011054":"UAR","8011055":"UASD","8011057":"UAE","8011058":"UJS","8011059":"DAUH","8011064":"BAHH","8011065":"UB","8011066":"UBB","8011067":"UBBZ","8011068":"DBM","8011071":"LDBG","8011072":"DBEL","8011074":"UBKZ","8011077":"LBLS","8011078":"BBLW","8011079":"BBSP","8011085":"UBS","8011088":"WWIL","8011091":"DBJ","8011093":"BBKL","8011095":"DBAG","8011097":"BBG","8011098":"BBO","8011100":"BBAI","8011102":"BGB, BGS","8011103":"UBGS","8011106":"UBAS","8011111":"LBAR","8011112":"LBAS","8011113":"BPAF, BSKR, BSKV","8011115":"DBAM","8011116":"BBA","8011119":"LBBZ","8011125":"WBES, WBESD","8011131":"LBEI","8011132":"LBGH","8011133":"LBLL","8011138":"UBEN","8011139":"UBH","8011140":"WBE","8011144":"UBGE","8011149":"WBER","8011150":"LBWZ","8011154":"BBKR","8011155":"BALE, BALX","8011160":"BHBF, BL, BLS","8011162":"BOK, BOKN, BOKO, BOKR, BOKS","8011168":"LBGF","8011169":"LBGS","8011170":"LBGW, LBWD","8011172":"UBE","8011173":"BBST","8011177":"LBEN","8011178":"UBEU","8011179":"BBE","8011181":"LBYD","8011183":"UBA","8011184":"LBF","8011185":"DBIE","8011187":"LBSR","8011188":"WBT","8011190":"LBIF","8011191":"WBI","8011199":"DBH","8011205":"WBLS","8011206":"UBN","8011208":"UBHA","8011210":"LBD","8011211":"BBLU","8011213":"WBLK","8011215":"WBO","8011219":"UBOD","8011222":"LBWE","8011226":"LBOK","8011228":"LBOE","8011230":"WBZ","8011238":"BBK","8011242":"LBL","8011248":"WBRH","8011250":"BBRA","8011252":"LBA","8011255":"LBS","8011256":"LBSO","8011257":"DBDL","8011258":"WBDN","8011260":"LBN","8011264":"DBTD","8011265":"UBRT","8011267":"UBZ","8011269":"BBSN","8011270":"WBTF","8011271":"BBRK","8011277":"LBRP","8011281":"WBUH","8011282":"BBUZ","8011284":"BBUW","8011290":"LBZG","8011293":"WBSG","8011294":"LBU","8011296":"LBGK","8011297":"DBU","8011298":"DBWD","8011302":"LBOW","8011304":"UBU","8011306":"BFRI, BFST, BFSTT","8011307":"WCA","8011308":"BCAP","8011311":"WCW","8011312":"UKSO","8011314":"WCOK","8011315":"DCL","8011318":"BCSO, BSDO","8011319":"BCO","8011320":"DCB","8011322":"LCW","8011323":"LCBS","8011325":"DCU","8011326":"WCZ","8011334":"BDAB","8011335":"UDA","8011336":"UDW","8011339":"LDA","8011340":"BDT","8011344":"WDWE","8011346":"LDAR","8011354":"DDT","8011355":"LDK","8011356":"WDM","8011361":"LDS","8011363":"LDAL","8011364":"LDMO","8011371":"LDTZ","8011376":"LDI","8011378":"UDN","8011383":"LDT","8011385":"DDIF","8011387":"LDOB","8011388":"LDF","8011390":"LDO","8011397":"UDOE","8011398":"DDO","8011399":"DKTF","8011402":"LDN","8011403":"WDS","8011406":"UDG","8011408":"WDOW","8011409":"BDF","8011414":"BDR","8011415":"LDD","8011416":"DBPL","8011417":"DGRS","8011418":"DIG","8011419":"DCT","8011420":"DD","8011421":"DKE","8011422":"DNSH","8011423":"DPS, DPSA","8011424":"DRK","8011425":"DSTT","8011426":"DSTH","8011427":"DTR","8011428":"DZSW","8011430":"BDW","8011431":"DHFR","8011433":"LDM","8011438":"WDU","8011442":"WDT","8011446":"DEBR","8011449":"UEK","8011450":"UEC","8011451":"DKR","8011453":"UEFT","8011455":"LEGD","8011456":"WEGS","8011460":"LEST","8011462":"LEF","8011468":"UEIW","8011471":"BEHS","8011472":"UED","8011476":"UELG","8011477":"DLD","8011480":"UER","8011481":"WELM","8011482":"BEZ","8011484":"LEK","8011486":"LELT","8011487":"UELB","8011488":"UELK","8011489":"UEX","8011491":"LE, LE H","8011495":"LEW","8011496":"LER","8011500":"UEO","8011502":"UEBI","8011503":"UEGI","8011507":"DER","8011512":"UERN","8011519":"UEH","8011520":"UET","8011523":"WEV","8011529":"DFUS","8011531":"WFBG","8011533":"BFS","8011536":"WFDF","8011537":"LFMW","8011540":"BFIH","8011541":"BFIN","8011542":"BFW","8011544":"LFG","8011545":"LFL","8011549":"LFD","8011550":"LFDE","8011553":"DFK","8011554":"DFKS","8011556":"DFRS","8011557":"BFPN","8011559":"BFRS","8011560":"LFA","8011563":"BFR","8011564":"LFK","8011567":"UFO","8011569":"DFD","8011570":"DHGW","8011571":"LFZ","8011572":"WFD","8011573":"UFB, UFB B","8011574":"BFDF","8011578":"UFR","8011582":"WFRR","8011585":"WFRK","8011586":"LFI","8011587":"LFIO","8011588":"LFB","8011591":"BFUS","8011592":"WGA","8011594":"UGSM","8011596":"LGA","8011598":"LGW","8011599":"LGAL","8011602":"UGBH","8011603":"UGB","8011609":"DGEI","8011611":"WGE","8011619":"UGLB","8011623":"UGZ","8011624":"UGBG","8011626":"LGE","8011628":"DGD","8011629":"UGT","8011630":"LGWS","8011632":"LGI","8011636":"DGHU","8011637":"DGLA","8011641":"WGF","8011643":"UGL","8011646":"WGNV","8011654":"LGOR","8011656":"DGWH","8011657":"UGSB","8011662":"LGOE","8011665":"LGM","8011667":"BGM","8011668":"BGO","8011671":"WGOL","8011672":"BGZ","8011673":"LGO","8011674":"BGOR","8011676":"DKH","8011678":"UGOS","8011681":"WGRB","8011683":"LG","8011685":"LGRK","8011687":"UGTA","8011689":"WGR","8011691":"WGRA","8011694":"WGWS","8011695":"BGBS, BGRI","8011697":"UGRD","8011699":"LGPN","8011700":"UGN","8011702":"WGBN","8011703":"LGB","8011705":"LGRI","8011707":"WGI","8011709":"DGO","8011711":"LGOH, LGOS","8011712":"DGT","8011714":"LGRL","8011718":"WGB","8011723":"WGKW","8011725":"LGZ","8011726":"WGLS","8011729":"WGLI","8011730":"WGP","8011735":"WGS","8011740":"BGSB, BGSBS","8011745":"LGD","8011746":"UGG","8011749":"DGC","8011750":"UGFA","8011751":"DGRT","8011752":"LGKL","8011753":"LGL","8011754":"UGNH","8011755":"LGP","8011756":"BGR","8011758":"DGRF","8011759":"UGRU","8011761":"DGAU","8011762":"UGC","8011763":"LGS","8011766":"LGWU","8011770":"DGN","8011771":"LGRA","8011773":"DGBA","8011776":"WGRG","8011778":"WSRB","8011788":"BGSW","8011790":"DGF","8011791":"UGU","8011792":"UHSN","8011794":"LHD","8011795":"BHAH","8011796":"LHMT","8011797":"WHK","8011799":"DHW","8011801":"DHND","8011802":"DHA","8011805":"BHB","8011808":"LHBO","8011809":"LHBS","8011813":"LHNI","8011814":"LHT, LHTS","8011815":"WHAM","8011818":"BHGB","8011820":"UH","8011821":"UHNO","8011822":"UHRS","8011825":"DHMU","8011834":"UHAU","8011838":"LHEW","8011843":"DHDS","8011844":"DHDG","8011848":"WHEG","8011849":"UHT","8011852":"UHD","8011853":"BHEL","8011855":"DHLF","8011860":"UHRH","8011861":"DHS","8011862":"UHK","8011863":"BHE","8011864":"WHB","8011867":"LHZW","8011869":"UHET","8011871":"UHN","8011878":"DHE","8011891":"UHOO","8011894":"BHL","8011895":"UHOL","8011900":"LHRA","8011901":"BHH, BHSH","8011904":"DHO","8011905":"LHM","8011908":"WHOL","8011909":"LHZ","8011910":"UHF","8011912":"DHU","8011913":"LHSN","8011914":"LHGT","8011915":"UHP","8011922":"BHWN","8011923":"BHUB","8011924":"WHU","8011925":"UHUE","8011928":"DHUN","8011929":"LIB","8011932":"UIR","8011933":"LIG","8011934":"UIM","8011935":"UIP","8011937":"DIR","8011940":"BJF","8011944":"BJW","8011945":"BJWO","8011946":"LJV","8011951":"WJAS","8011952":"LJEB","8011953":"WJER","8011956":"UJP","8011957":"UJW","8011958":"UJZ","8011959":"LJES","8011960":"LJN","8011961":"LJZ","8011962":"WJT","8011963":"DJA","8011966":"DJZ","8011968":"BJA, BJAB","8011970":"DCKI","8011971":"DCM","8011974":"DCBH","8011979":"DCC","8011980":"DCSI","8011981":"BKAB","8011983":"LKF","8011985":"UKA","8011988":"DKA","8011993":"UKF, UKF B","8011994":"WKT","8011995":"WKAR","8012000":"UKL","8012002":"WKV","8012006":"BKE","8012007":"UKIE","8012009":"WKJ","8012011":"LKIM","8012012":"UKI","8012014":"LKD, LKD H","8012016":"BKDF","8012021":"WKB","8012033":"UKFA","8012034":"UKJ","8012036":"DKRD","8012037":"DKMA","8012040":"LKK","8012043":"BKG","8012044":"DKC","8012045":"DKN","8012046":"LKLM","8012047":"BKL","8012053":"DKLB","8012061":"BKOD","8012064":"UKOE","8012066":"LKB","8012067":"DKB","8012072":"DKO, DKOH","8012075":"UKZ","8012079":"DKTW","8012080":"LKTU","8012083":"BKOW","8012084":"BKOS","8012088":"UKR","8012089":"BFIK","8012092":"UKD","8012093":"WKG","8012096":"BKRM, BKRMM","8012097":"LKNZ","8012105":"DKRP","8012107":"UKPR","8012108":"WKR","8012109":"WKRP","8012113":"DKRU","8012114":"LKRP","8012115":"DKU","8012117":"LKUH","8012127":"WKUM","8012129":"BKUM","8012138":"DRAT","8012141":"LKYA","8012143":"WLA","8012145":"BLW","8012146":"WLAK","8012147":"LLBG","8012148":"LLAS","8012150":"DLAB","8012155":"ULF","8012156":"LLGS","8012159":"ULAO","8012160":"ULAW","8012161":"LLAG","8012162":"LLWD","8012163":"DLW","8012164":"DLWM","8012167":"ULCH","8012169":"BLH","8012170":"DLST","8012171":"ULA","8012174":"DLZ","8012175":"BLA","8012178":"LLSB","8012180":"ULE","8012181":"LSEL","8012183":"LFLU","8012184":"LLB","8012186":"LLMK","8012187":"LMDR","8012188":"LLG","8012190":"LLH","8012192":"LLK","8012193":"LLMH","8012194":"LLST","8012195":"LLT","8012196":"LLN","8012197":"LLW","8012198":"DLS","8012199":"ULL","8012200":"LLES","8012202":"LLWP","8012203":"DLFD","8012204":"LSVS","8012205":"BLTS","8012207":"ULBN","8012211":"LLWN","8012212":"LLWS","8012213":"ULEU","8012215":"BLE","8012220":"DLIG","8012221":"WLH","8012223":"DLTS","8012224":"DLI","8012225":"ULIT","8012226":"WLBT","8012228":"LLWZ","8012231":"DLIM","8012232":"DLM","8012233":"LLI","8012236":"LLIN","8012237":"BLNG","8012241":"LLO","8012249":"DLO","8012250":"BLOH","8012252":"ULHO","8012253":"BSTH","8012257":"BLU","8012259":"LLUC","8012260":"BLD","8012262":"WLOW","8012263":"LLBS","8012264":"WLST","8012268":"WLF","8012269":"WLW","8012271":"WLKL","8012274":"WLTW","8012279":"LEL","8012280":"LWET","8012282":"LWP","8012284":"LMAC","8012285":"LLA","8012287":"LMSO","8012289":"LMGE","8012291":"LMSA","8012292":"LMS","8012295":"LMW","8012300":"LMAS","8012302":"LMBN","8012304":"LMAN","8012305":"LMAR","8012308":"LMA","8012309":"LMAM","8012311":"LMKS","8012312":"UML","8012314":"UMAH","8012315":"BMQU","8012316":"WMTF","8012317":"UMT","8012318":"DMEA","8012320":"UME","8012321":"WMK","8012322":"BMZ","8012323":"DMA","8012326":"DME","8012327":"DMT","8012328":"LME","8012329":"WMCH","8012332":"UMEN","8012333":"UMGH","8012334":"UMHO","8012339":"LMGB","8012341":"BMZD, BMZDN","8012342":"LMF","8012343":"LLVD","8012344":"LMIA","8012351":"LMST","8012352":"LMT","8012354":"LMI","8012355":"LMIZ","8012358":"WMI","8012362":"WMIS","8012367":"UMSK","8012369":"DMW","8012370":"BMX","8012371":"LMRN","8012373":"LMGI","8012375":"LMLK","8012376":"WMOE","8012377":"WMN","8012378":"LMGN","8012381":"LMOS","8012384":"WMOI","8012388":"DML","8012390":"LMCH","8012391":"BMC","8012392":"LMCZ","8012393":"LMUA","8012394":"DMHL","8012400":"BMR","8012401":"UMU","8012407":"DMUL","8012408":"DMH","8012409":"LMD","8012410":"LNHM","8012412":"DNA","8012413":"WNAS","8012414":"LNAU","8012415":"UNMO","8012416":"LNH","8012417":"UNE","8012418":"WNL","8012421":"WNA","8012423":"LNI","8012424":"LNDG","8012425":"LNS","8012428":"WNED","8012429":"UNRO","8012430":"DNZU","8012436":"WNWO","8012438":"WNB","8012440":"UAT","8012443":"UNS","8012445":"BT","8012452":"UNHI","8012454":"DNF","8012456":"BNH","8012458":"BNE","8012460":"DNKO","8012463":"LNWY","8012465":"UNME","8012467":"LN","8012468":"UNH","8012469":"BNP","8012470":"DNP","8012471":"DNZ","8012472":"UNU","8012474":"WNG","8012475":"BNTB","8012478":"LNW, LNW H","8012479":"BNZ","8012482":"DNDR","8012483":"DNBO","8012485":"WNW","8012487":"LNF","8012489":"BNDL","8012490":"LNR","8012491":"DNOW","8012492":"UNDO","8012493":"UNP","8012494":"UNIW","8012497":"DNDS","8012498":"UNSK","8012500":"UNI","8012502":"UNTA","8012503":"DNI","8012504":"UNWL","8012505":"DNWZ","8012506":"LNM","8012507":"LNB","8012509":"DNB","8012511":"UNOH","8012512":"UNA","8012516":"UNSA","8012523":"DNUN","8012524":"UOGR","8012526":"LOH","8012527":"UOLA","8012528":"DOBL","8012530":"DOZO","8012532":"UOR","8012533":"UORO","8012534":"DOH","8012535":"DOSC","8012537":"BOB","8012540":"DOG","8012541":"UOB","8012546":"LOL","8012549":"BOD","8012550":"DOR","8012551":"BOEG","8012552":"LOEH","8012553":"DOE","8012554":"DOV","8012555":"WOE","8012563":"UOG","8012565":"BORT","8012567":"UOM","8012568":"LOB","8012570":"LOST","8012572":"LON","8012576":"DOU","8012582":"WGMS","8012583":"WGM","8012584":"WGMW","8012593":"DOF","8012594":"DOK","8012595":"DON","8012596":"DOS","8012597":"LOTW","8012599":"LOV","8012603":"WPF","8012604":"UPM","8012605":"BPA","8012609":"WPA","8012610":"WPO","8012611":"WPS","8012614":"WPAU","8012615":"UPA","8012619":"LPE","8012621":"BPO","8012622":"WPB","8012623":"LPB","8012627":"WPE","8012628":"BPE","8012629":"LPRO","8012636":"BPIL","8012637":"WPIN","8012639":"DPK","8012640":"DPIC","8012641":"DPIN","8012643":"WPLM","8012646":"DPW","8012650":"BP","8012651":"WPSW","8012654":"WPOE","8012656":"LPOE","8012657":"UPS","8012658":"UPSU","8012660":"DPOM","8012661":"DPO","8012662":"DPSC","8012663":"UPF","8012666":"BPD, BPDH","8012668":"LPZ, LPZH","8012669":"LPZS","8012673":"LPRZ","8012675":"UPZ","8012676":"LPI","8012677":"WPRZ","8012678":"LPRL","8012679":"DPRO","8012680":"DPRW","8012681":"BPW","8012682":"LPR","8012683":"WPRA","8012684":"WPRO","8012685":"DPUL","8012688":"DPT","8012697":"LRK","8012698":"BRAD","8012699":"DRAG","8012700":"DRBT","8012701":"DRBZ","8012703":"WRDN","8012704":"LRA","8012705":"LRI","8012707":"LRH","8012710":"WRAK","8012711":"WRMB","8012713":"BRSF","8012716":"WRW","8012719":"DRD","8012723":"URAU","8012724":"DRU","8012727":"DRBG","8012729":"WRDL","8012731":"LRB","8012733":"BRC","8012734":"LRF","8012735":"BRE","8012737":"WRA","8012738":"DRCH","8012739":"DRC","8012742":"URN","8012743":"URDN","8012750":"URH","8012751":"URM","8012756":"URR","8012757":"LRE","8012758":"WRST","8012759":"DRTH","8012762":"WRIO","8012763":"WRI","8012766":"URIE","8012767":"BRI","8012769":"URGS","8012770":"URI","8012775":"DROW","8012777":"LROD","8012781":"DRDF","8012785":"WRGT","8012787":"UROH","8012788":"LROI","8012796":"UROS","8012801":"WRHP","8012803":"WRB","8012805":"WRHO","8012806":"WRK","8012807":"WRMA","8012811":"UROT","8012816":"BRO","8012817":"LRMF","8012819":"WRZ","8012823":"DRUG","8012824":"WRU","8012826":"USAE","8012830":"LSAD","8012831":"BSAH","8012832":"WSAG","8012835":"WSAM","8012839":"WSAF","8012840":"WSAN","8012841":"WSTZ","8012843":"WSZ","8012852":"USCK","8012854":"USKM","8012855":"BSH","8012856":"WST","8012862":"LSIS","8012863":"LSDW","8012864":"DSWK","8012865":"LSD","8012867":"LSP","8012869":"DGRA","8012870":"BSFE","8012881":"USMS","8012888":"DSMI","8012889":"DSM","8012890":"DSML","8012895":"BSB","8012897":"BSNZ","8012898":"DSN","8012899":"USU","8012902":"WSBG","8012903":"BSBD","8012907":"LSBE","8012908":"DSCK","8012914":"BSOE","8012918":"WSCN","8012919":"USCS","8012923":"BSCH","8012927":"USP","8012929":"USWL","8012933":"WSAH","8012934":"BSHE","8012940":"WSMI","8012941":"BSRO","8012942":"BSKL","8012943":"WSC","8012944":"WSCT","8012946":"DSKH","8012947":"DSU","8012951":"WSS","8012953":"WSL","8012954":"WSWZ","8012957":"BSIS","8012959":"DSEB","8012960":"WSMH","8012961":"USE","8012965":"USB","8012966":"BSEE","8012967":"LSNA","8012968":"WSEE","8012973":"BSLO","8012975":"DSRH","8012981":"DSEN","8012984":"USEL","8012993":"USI","8012998":"USGN","8013002":"DSOL","8013003":"DSOH","8013004":"USOL","8013005":"LSK","8013008":"USO","8013009":"USON","8013010":"USOO","8013011":"USOW","8013017":"WSP","8013018":"WSPO","8013021":"BSTA, BSTAB","8013022":"DWH","8013023":"USTM","8013025":"USR","8013029":"DSTU","8013033":"DSTI","8013034":"USTN","8013036":"USTA","8013037":"USTH","8013039":"LSFD","8013040":"WSNB","8013046":"LSV","8013047":"DSTN","8013051":"WSE","8013057":"DSTL","8013058":"BSTW","8013061":"USHM","8013062":"WSRR","8013064":"BSTN","8013069":"WSTK","8013070":"LSTG","8013072":"WSBN","8013073":"WSLT","8013074":"USUE","8013077":"USLH","8013079":"WSU","8013080":"DSY","8013083":"LTH","8013084":"LTM","8013085":"LTMW","8013087":"DTA","8013089":"UTA","8013090":"WTA","8013092":"DTB","8013093":"LTC","8013095":"LTNH","8013097":"LTE","8013100":"BTL","8013104":"WTHN","8013105":"WTOW","8013106":"WTI","8013109":"BTPI","8013110":"LTT","8013111":"LTTO","8013112":"LTL","8013114":"DTH","8013115":"LT","8013123":"BTHR","8013124":"DTFN","8013125":"LTLM","8013129":"UTP","8013131":"WTO","8013137":"BTN","8013138":"LTRL","8013141":"BTZ","8013144":"DTRE","8013145":"BTZN","8013146":"BTZS","8013150":"UTB","8013156":"WUMH","8013158":"LUS","8013159":"UUD","8013160":"LUEB","8013162":"WUM","8013164":"UUS","8013165":"BUD","8013166":"BUS","8013168":"DUD","8013171":"UUZ","8013172":"UUM","8013174":"UUW","8013177":"WUTZ","8013179":"UVA","8013180":"LVA","8013182":"LVT","8013183":"BVLZ","8013184":"UVF","8013185":"BVLT","8013186":"WVE","8013188":"BV","8013191":"UVU","8013192":"UVI","8013194":"LVG","8013198":"WVOG","8013201":"DVO","8013202":"UVO","8013205":"LWH","8013210":"BWA","8013215":"UWD","8013217":"UWAL","8013220":"LWWZ","8013221":"UWL","8013222":"WWL","8013223":"UWN","8013224":"UWNS","8013226":"UWA","8013230":"LWAN","8013236":"WWM","8013237":"WWMW","8013238":"WWAN","8013244":"UWTL","8013245":"UWS","8013247":"DWSN","8013248":"LWF","8013250":"LWST","8013251":"UWEM","8013253":"DWEI","8013254":"UWEA","8013256":"UWMB","8013258":"WWSN","8013259":"LWG","8013261":"UWWE","8013266":"UWMT","8013267":"DWE, DWEW","8013268":"DWX","8013269":"DWXB","8013271":"LWL","8013272":"BWZ","8013275":"LWND","8013279":"WWLS","8013280":"DWND","8013285":"BWER","8013286":"LWDE","8013291":"UWTH","8013295":"DWES","8013297":"LWZE","8013305":"BWSU","8013313":"WWLD","8013315":"UWIR","8013318":"UWIP","8013319":"LWIP","8013322":"WWT","8013324":"DWIM","8013329":"UWLH","8013333":"UWOF","8013334":"UWOL","8013335":"LWO","8013336":"LWOR","8013344":"LWLS","8013345":"BWOL","8013348":"DWU","8013349":"UWFN","8013350":"BWUE","8013352":"WWSF","8013354":"WWST","8013357":"LWU","8013360":"UWCH","8013361":"LWZ","8013362":"LWZW","8013365":"LWUZ","8013366":"UWU","8013368":"DZT","8013370":"WZN","8013371":"LZA","8013373":"WZAR","8013376":"BZS","8013377":"WZE","8013378":"WZEN","8013381":"DZNH","8013383":"UZLW","8013384":"LZD","8013389":"LZE","8013392":"BZF","8013393":"WZIN","8013396":"UZU","8013398":"UZE","8013402":"LZI","8013406":"BZIL","8013413":"DZL","8013414":"LZBR","8013418":"LZGL","8013424":"DZSC","8013425":"LZBN","8013428":"LZS","8013432":"LSBU","8013433":"DZWP","8013436":"DZWZ","8013437":"DZWO","8013439":"LBK","8013444":"DM","8013445":"DPA","8013447":"LGDG","8013448":"LHSS","8013450":"DCH, DCHP","8013452":"ULB","8013455":"LMHR","8013456":"LMB","8013461":"DOT","8013465":"LSBF","8013467":"BBEL","8013468":"BBZS","8013470":"BBER, BBRN","8013471":"LBO","8013472":"BBRI","8013474":"UCB","8013475":"DF","8013476":"DPL","8013477":"BE, BERK","8013479":"BFKS","8013480":"BFLZ","8013481":"BGOL","8013483":"BHD, BHND","8013485":"LMTW","8013487":"BOR, BORB","8013489":"BPOT","8013490":"DRBN","8013492":"BSE, BSE M","8013493":"BNY","8013547":"UHL","8013548":"UHER","8017041":"MGRI","8017042":"MUGR","8017442":"DPM","8070002":"BBIS","8070003":"FFLF","8070004":"FFLU","8070005":"THDV","8070086":"HKWA","8070088":"FMHD","8070090":"FOMP","8070091":"FOLM","8070092":"FOKL","8070096":"RAM","8070097":"RSMM","8070170":"RDUN","8070483":"KMAH","8070704":"KASZ","8070734":"HNMU","8073410":"LZIO","8077434":"RNHF","8077771":"RRZB","8077773":"RST","8079056":"TTUZ","8079069":"EOLT","8079083":"SNO","8079089":"TAEW","8079095":"HHN","8079097":"HLEA, HLEG","8079140":"KKBL","8079146":"RNFL, RNFS","8079147":"SHW","8079151":"FWED","8079152":"LVTT","8079604":"WTIW","8079605":"AHZH","8079616":"RSII","8079629":"WRTF","8079632":"FFME","8080040":"BAS","8080070":"BBAB","8080100":"BBFE","8080170":"BBGS, BBSH","8080190":"BBI, BBIW","8080200":"BBOR","8080260":"BDL","8080280":"LDLO","8080340":"BEIW","8080370":"BETN, BWUR","8080440":"BFD, BFRD","8080450":"BTLS","8080560":"LDBR","8080570":"LRO","8080580":"LSBR","8080590":"LSUE","8080600":"LWN","8080610":"LZO","8080620":"LHNZ","8080630":"EHWS","8080660":"LMGH","8080680":"BHGM","8080710":"BHOW","8080720":"BHN","8080750":"BHPG, BHPN","8080840":"LCZ","8080930":"LSEH","8080970":"BMAH","8080980":"BMM","8081020":"BNG","8081150":"BPEN","8081210":"BRGT","8081220":"BSAM","8081260":"LSBS","8081270":"LSBO","8081290":"BSFL, BSNF","8081420":"BSTR","8081540":"BWI","8081560":"BZEP","8081580":"BZN, BZTH","8081586":"BSFD","8081688":"BWDF","8081722":"BLEN","8084070":"UGRI","8087020":"HVCS","8087039":"EHOH","8087061":"UHOS","8087062":"SMUE","8087063":"FKRS","8087064":"FOUS","8087065":"HWEH","8087067":"TWEB","8087080":"TMW","8089000":"BSZF","8089002":"BAHU","8089003":"BATS","8089004":"BBMW, BBW","8089005":"BBEV","8089006":"BRB","8089007":"BSCF","8089008":"BBOS","8089009":"BBGT","8089010":"BBCH","8089011":"BGFB, BGSS","8089012":"BFB","8089013":"BFA, BFAL","8089014":"BGSE","8089016":"BGBA","8089017":"BHKM","8089018":"BHUM","8089019":"BJB","8089020":"BLST","8089022":"BMEA","8089023":"BMEX","8089024":"BNB","8089025":"BHLS","8089026":"BNPL","8089027":"BORS","8089030":"BPWA","8089031":"BPOE","8089032":"BPOF, BPOP","8089033":"BPLA","8089034":"BPRS","8089035":"BRW","8089036":"BRST","8089037":"BSAP","8089038":"BSC","8089039":"BSAL","8089040":"BSPH","8089041":"BSTO","8089042":"BSDG","8089043":"BTP","8089044":"BTOR","8089045":"BWRS","8089047":"BWKR, BWKRR, BWKS","8089048":"BWOK","8089050":"BYOR","8089051":"BGGS","8089052":"BADL","8089053":"BSRW","8089054":"BAGL","8089055":"BBDF","8089056":"BBKB, BBLB","8089057":"BBU","8089058":"BFRU","8089059":"BFFO","8089060":"BFRH","8089061":"BFOH","8089062":"BGD, BGWD","8089063":"BGA, BGAS, BQGAS","8089064":"BHED","8089065":"BHI","8089068":"BKAD, BKD","8089069":"BKP, BKPK","8089070":"BLRD","8089071":"BLWE","8089072":"BMDF, BMHL","8089074":"BMF","8089075":"BMAR, BMAZ","8089077":"BNK, BNKN","8089078":"BNIS, BNIW","8089079":"BOSP","8089080":"BPKR, BPKW","8089081":"BPHD","8089082":"BRD","8089084":"BRGB, BRGBT, BRH","8089085":"BSLS","8089087":"BSNH, BSNL","8089088":"BSPF","8089089":"BTG","8089090":"BTF, BTHF","8089091":"BTGN","8089092":"BWAI","8089093":"BWAB","8089094":"BWIG","8089095":"BWM","8089096":"BWIN","8089097":"BWHH","8089098":"BZD, BZFS","8089099":"BBRF","8089100":"BJUF, BJUN","8089101":"BEBD","8089102":"BKBO","8089103":"BARF","8089104":"BKHD","8089105":"BHER","8089106":"BIP","8089107":"BBUP","8089108":"BHO","8089109":"BHAL, BHLRS","8089110":"BMN","8089111":"BWES","8089112":"BHEI","8089113":"BLIH, BLIO","8089114":"BLAK","8089115":"BSDE","8089116":"BWH","8089118":"BBEU","8089119":"RNBG","8089131":"BWED","8089327":"BSO","8089328":"BMS","8089329":"BHST","8089330":"BOLS","8089331":"BPIC","8089472":"BLIS","8089473":"BOSS","8089537":"BJLB","8098096":"TS, TS B, TS T, TST","8098553":"AA, AAS"}+ \ No newline at end of file
diff --git a/assets/client/js/helpers.js b/assets/client/js/helpers.js @@ -0,0 +1,74 @@ +'use strict'; + +export const ElementById = (id) => { + return document.getElementById(id); +}; + +export const showDiv = (id) => { + const element = document.getElementById(id); + if (element) element.classList.remove('hidden'); +}; + +export const hideDiv = (id) => { + const element = document.getElementById(id); + if (element) element.classList.add('hidden'); +}; + +export const padZeros = (str) => { + return ('00' + str).slice(-2); +}; + +export const isValidDate = (date) => { + const matches = /^(\d{4})[-\/](\d{2})[-\/](\d{2})$/.exec(date); + if (matches == null) { + return false; + } + + const d = matches[3]; + const m = matches[2]-1; + const y = matches[1]; + const composedDate = new Date(y, m, d); + return composedDate.getDate() == d && + composedDate.getMonth() == m && + composedDate.getFullYear() == y; +}; + +export const parseDateTime = (timestamp, format) => { + const date = new Date(timestamp * 1000); + + if (format != null) { + switch (format) { + case 'full': + return padZeros(date.getHours()) + ':' + padZeros(date.getMinutes()) + ', ' + date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getFullYear(); + break; + + case 'date': + return date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getFullYear(); + break; + + default: + return false; + break; + } + + } + + if (date.toLocaleDateString() !== new Date().toLocaleDateString()) { + return padZeros(date.getHours()) + ':' + padZeros(date.getMinutes()) + ', ' + date.getDate() + '.' + (date.getMonth() + 1) + '.'; + } else { + return padZeros(date.getHours()) + ':' + padZeros(date.getMinutes()); + } +}; + +export const formatDuration = (duration) => { + const mins = duration / 60; + const h = Math.floor(mins / 60); + const m = mins % 60; + + if (h > 0) { + return h+'h '+m+'min'; + } + + return m+'min'; +}; +
diff --git a/assets/client/js/journeyView.js b/assets/client/js/journeyView.js @@ -0,0 +1,225 @@ +'use strict'; + +import { dataStorage } from './app.js'; +import { showDiv, hideDiv, ElementById, parseDateTime, formatDuration } from './helpers.js'; +import { getCache, addCache, ConsoleLog, parseName, ds100Names, t } from './app_functions.js'; +import { showModal } from './overlays.js'; +import { get } from './api.js'; +import { go } from './router.js'; +import { html, render } from './lit-html.js'; + +const remarksModalTemplate = (type, remarks) => html` + <table class="remarks"> + ${remarks.map(element => html` + <tr> + <td> + <span class="remark ${type}"></span> + <span>${element.text}</span> + </td> + </tr> + `)} + </table> +`; + +const showRemarksModal = (type, remarks) => { + showModal(t('remarks'), remarksModalTemplate(type, remarks)); +}; +const remarksTemplate = ([type, remarks]) => !!remarks.length ? html` + <a class="showremarks ${type}" @click=${() => showRemarksModal(type, remarks)}></a> +` : ''; + +const legTemplate = (element) => { + const allRemarks = element.remarks || []; + const remarks = { + "status": allRemarks.filter(r => r.type === 'status'), + "hint": allRemarks.filter(r => r.type === 'hint'), + "other": allRemarks.filter(r => r.type !== 'status' && r.type !== 'hint'), + }; + + return html` + ${element.isWalking ? html` + <p class="walk">${t('walkinfo', [parseName(element.arrival.point), element.distance])}</p> + ` : element.isTransfer ? html` + <p class="transfer">${t('transferinfo', [parseName(element.arrival.point)])}</p> + ` : element.isChange ? html` + <p class="change">${t('changeinfo', [formatDuration(element.duration)])}</p> + ` : html` + <table> + <thead> + <tr> + <td colspan="4"> + ${element.line.name} ${element.line.additionalName ? '('+element.line.additionalName+')' : ''} → ${element.direction} ${element.cancelled ? html`<b style="color:red;">${t('cancelled-ride')}</b>` : ''} + ${Object.entries(remarks).map(remarksTemplate)} + ${dataStorage.settings.travelynx && element.line.mode == 'Train' ? html`<a class="travelynx" href="https://travelynx.de/s/${element.departure.point.stop.id}?train=${element.line.additionalName}"></a>` : ''} + </td> + </tr> + <tr> + <th>${t('arrival')}</th> + <th>${t('departure')}</th> + <th>${t('station')}</th> + <th>${t('platform')}</th> + </tr> + </thead> + <tbody> + ${element.stopovers.map(stop => html` + <tr class="stop ${stop.cancelled ? 'cancelled' : ''}" @click=${() => {location.href = "https://marudor.de/"+stop.stop.id+"?searchType=hafas"}}> + <td>${timeTemplate(stop.arrival)}</td> + <td>${timeTemplate(stop.departure)}</td> + <td>${stop.stop.name} ${ds100Names(stop.stop.id)}</td> + <td>${stopPlatformTemplate(stop)}</td> + </tr> + `)} + </tbody> + </table> + `} + `; +}; + +const journeyTemplate = (data, requestId, journeyId) => { + const departure = data.legs[0].departure; + const arrival = data.legs[data.legs.length - 1].arrival; + + const departureTime = departure.prognosedTime ? departure.prognosedTime : departure.plannedTime; + const arrivalTime = arrival.prognosedTime ? arrival.prognosedTime : arrival.plannedTime; + const duration = arrivalTime - departureTime; + + const legs = []; + let changes = 0; + let lastArrival; + for (let leg of data.legs) { + if (!leg.isWalking && !leg.isTransfer) { + + // add change + if (lastArrival) { + const departure = leg.departure; + const arrival = lastArrival; + const departureTime = departure.prognosedTime ? departure.prognosedTime : departure.plannedTime; + const arrivalTime = arrival.prognosedTime ? arrival.prognosedTime : arrival.plannedTime; + const duration = departureTime - arrivalTime; + + legs.push({ + isChange: true, + duration: duration, + }); + } + changes++; + + lastArrival = leg.arrival; + } else if (legs.length) { + + // if this is a walking leg and it is the first one, we don't want to + // insert a 0 minutes change entry for this + lastArrival = leg.arrival; + } + legs.push(leg); + } + + return html` + <div id="journeyView"> + <div id="header"> + <a class="back" href="#/${requestId}"></a> + <p> + <h2> + <span id="fromName2">${parseName(departure.point)}</span> + <span> - </span> + <span id="toName2">${parseName(arrival.point)}</span> + </h2> + </p> + <p> + <b> + <span>${t('duration')}: </span> + <span id="duration">${formatDuration(duration)}</span> + <span> | ${t('changes')}: </span> + <span id="changes">${changes-1}</span> + <span> | ${t('date')}: </span> + <span id="date2">${parseDateTime(departure.plannedTime, 'date')}</span> + </b> + </p> + <div class="reload" id="reload-journey" @click=${() => reloadJourney(requestId, journeyId)}></div> + </div> + + <div id="connection"> + ${legs.map(legTemplate)} + </div> + </div> + `; +}; + +const timeTemplate = (data, mode) => { + let delay = 0; + + if (data.prognosedTime !== null) { + delay = (data.prognosedTime - data.plannedTime)/60; + } + + if (!data.plannedTime && !data.prognosedTime) return '-'; + + return html` + ${delay > 0 ? html` + ${parseDateTime(data.prognosedTime)} <b>(+${delay})</b> + ` : html` + ${parseDateTime(data.plannedTime)} + `}`; +} + +const platformTemplate = (data) => html` + ${data.prognosedPlatform ? html` + <b>${data.prognosedPlatform}</b> + ` : (data.plannedPlatform ? data.plannedPlatform : '-')} +`; + +const stopPlatformTemplate = (data) => { + if (data.departure.plannedPlatform | data.departure.prognosedPlatform) { + if (!data.departure.prognosedPlatform) { + return data.departure.plannedPlatform; + } else { + return html`<b>${data.departure.prognosedPlatform}</b>`; + } + } else if (data.arrival.plannedPlatform | data.arrival.prognosedPlatform) { + if (!data.arrival.prognosedPlatform) { + return data.arrival.plannedPlatform; + } else { + return html`<b>${data.arrival.prognosedPlatform}</b>`; + } + } else { + return '-' + } +}; + +export const journeyView = async (match) => { + const reqId = match[0]; + const journeyId = match[1]; + + let data; + let all = getCache('journeys', reqId) + if (all && all.journeys && journeyId in all.journeys) { + data = all.journeys[journeyId]; + } else { + const request = await get("/journeys", {"reqId": reqId}); + addCache('journeys', request); + data = request.journeys[journeyId]; + } + + ConsoleLog(data); + render(journeyTemplate(data, reqId, journeyId), ElementById('content')); + + const journeysHistory = getCache('journeysHistory'); + const history_id = journeysHistory.findIndex(obj => obj.reqId === reqId); + + if (journeysHistory[history_id] !== undefined) { + journeysHistory[history_id].journeyId = journeyId; + addCache('journeysHistory', journeysHistory); + } +}; + +const reloadJourney = async (reqId, journeyId) => { + document.querySelector('.reload').classList.add('spinning'); + try { + let request = await get("/refreshJourney", {"reqId": reqId, "journeyId": journeyId}); + addCache('journeys', request); + journeyView([reqId, journeyId]); + } catch(err) { + ConsoleLog(err); + } + document.querySelector('.reload').classList.remove('spinning'); +};
diff --git a/assets/client/js/journeysView.js b/assets/client/js/journeysView.js @@ -0,0 +1,124 @@ +'use strict'; + +import { showDiv, hideDiv, ElementById, parseDateTime, formatDuration } from './helpers.js'; +import { getCache, addCache, parseName, ConsoleLog, t } from './app_functions.js'; +import { dataStorage } from './app.js'; +import { setupCanvas } from './canvas.js'; +import { get } from './api.js'; +import { go } from './router.js'; +import { html, render } from './lit-html.js'; +import { showAlertModal } from './overlays.js'; + +let data; + +const journeysTemplate = (data) => html` + <div id="journeysView"> + <div id="header"> + <a class="back" href="#/"></a> + <p><h3>${t('from')}: <span id="fromName">${parseName(data.params.fromPoint)}</span></h3></p> + <p><h3>${t('to')}: <span id="toName">${parseName(data.params.toPoint)}</span></h3></p> + <!-- <div class="reload" id="reload-journeys" @click=${() => reloadJourneys(data.reqId)}></div> --> + </div> + + ${dataStorage.settings.enableCanvas ? html` + <div id="journeysCanvas"> + <canvas id="canvas"></canvas> + </div> + ` : html` + <div id="journeysTable"> + <div class="loadMore flipped" @click=${() => moreJourneys(data.reqId, 'earlier')}></div> + + <table> + <thead> + <tr><th>${t('departure')}</th><th>${t('arrival')}</th><th>${t('duration')}</th><th>${t('changes')}</th><th>${t('products')}</th></tr> + </thead> + <tbody id="connectionsTable"> + ${Object.keys(data.journeys).sort((a, b) => a - b).map(key => journeyOverviewTemplate(data, key))} + </tbody> + </table> + + <div class="loadMore" @click=${() => moreJourneys(data.reqId, "later")}></div> + </div> + `} + </div> +`; + +const journeyOverviewTemplate = (data, key) => { + let departure = data.journeys[key].legs[0].departure; + let arrival = data.journeys[key].legs[data.journeys[key].legs.length - 1].arrival; + let changes = 0; + let products = []; + let changesDuration = 0; + let cancelled = false; + + let departureTime = departure.prognosedTime ? departure.prognosedTime : departure.plannedTime; + let arrivalTime = arrival.prognosedTime ? arrival.prognosedTime : arrival.plannedTime; + let duration = arrivalTime - departureTime; + + for (let legKey in data.journeys[key].legs) { + let leg = data.journeys[key].legs[legKey]; + if (leg.cancelled !== false) cancelled = true; + if (leg.isWalking || leg.isTransfer) continue; + + changes = changes+1; + products.push(leg.line.productName); + } + + products = [...new Set(products)]; + + return html` + <tr class="connection ${cancelled ? 'cancelled' : ''}" @click=${() => go('/'+data.reqId + '/' + key)}"> + <td>${timeTemplate(departure, 'departure')}</td> + <td>${timeTemplate(arrival, 'arrival')}</td> + <td title="${changesDuration > 0 ? 'Davon '+formatDuration(changesDuration)+' Umstiegsdauer' : ''}">${formatDuration(duration)}</td> + <td>${changes-1}</td> + <td>${products.join(', ')}</td> + </tr>`; +} + +export const journeysView = async (match) => { + const reqId = match[0]; + + data = getCache('journeys', reqId); + + if (!data) { + data = await get("/journeys", {"reqId": reqId}); + addCache('journeys', data); + } + + render(journeysTemplate(data), ElementById('content')) + + if (dataStorage.settings.enableCanvas) { + setupCanvas(data); + } +}; + +const timeTemplate = (data, mode) => { + let delay = 0; + + if (data.prognosedTime !== null) { + delay = (data.prognosedTime - data.plannedTime)/60; + } + + return html` + ${delay > 0 ? html` + ${parseDateTime(data.prognosedTime)} <b>(+${delay})</b> + ` : html` + ${parseDateTime(data.plannedTime)} + `}`; +} + +export const moreJourneys = async (reqId, mode) => { + let data = getCache('journeys', reqId); + const newData = await get('/moreJourneys', {"reqId": reqId, "mode": mode}); + + data.lastUpdated = newData.lastUpdated; + data.journeys = {...data.journeys, ...newData.journeys}; + + addCache('journeys', data); + journeysView([reqId]); +}; + +export const reloadJourneys = async (requestId) => { + showAlertModal("not implemented yet"); +};
diff --git a/assets/client/js/languages.js b/assets/client/js/languages.js @@ -0,0 +1,103 @@ +export const languages = { + 'de': { + 'arrival': 'Ankunft', + 'departure': 'Abfahrt', + 'duration': 'Dauer', + 'changes': 'Umstiege', + 'products': 'Produkte', + 'from': 'Von', + 'to': 'Nach', + 'date': 'Datum', + 'time': 'Uhrzeit', + 'station': 'Station', + 'platform': 'Gleis', + 'walkinfo': 'Laufe nach %s (ca. %s Meter)', + 'changeinfo': '%s Umstiegsdauer', + 'transferinfo': 'Reise nach %s', + 'swap': 'Von/Nach tauschen', + 'settings': 'Einstellungen', + 'search': 'Suchen', + 'options': 'Optionen', + 'setfromto': 'Als Von/Nach setzen', + 'journeyoverview': 'Verbindungsübersicht aufrufen', + 'lastjourney': 'Letzte gewälte Verbindung aufrufen', + 'longdistancetrain': 'Fernverkehr', + 'regionaltrain': 'Regionalverkehr', + 'suburbantrain': 'S-Bahn', + 'subway': 'U-Bahn', + 'tram': 'Tram', + 'bus': 'Bus', + 'ferry': 'Fähre', + 'taxi': 'Taxi', + 'save': 'Speichern', + 'clearstorage': 'lokale Daten löschen', + 'datasource': 'Datenquelle', + 'accessibility': 'Barrierefreiheit', + 'access_none': 'keine Einschränkungen', + 'access_partial': 'Bedingt barrierefrei', + 'access_full': 'Barrierefrei', + 'etc': 'Sonstiges', + 'showds100': 'Zeige RIL100 Kürzel (wenn verfügbar)', + 'showdebug': 'Schreibe Debug Nachrichten ins Log', + 'graphical': 'Graphische Darstellung in der Verbindungsübersicht', + 'fancy': 'Schöne Grafik', + 'update': 'Anwendung updaten', + 'language': 'Sprache', + 'de': 'Deutsch', + 'en': 'Englisch', + 'cancelled-ride': 'Fahrt entfällt!', + 'remarks': 'Hinweise', + 'travelynx-checkin': 'Travelynx checkin anzeigen?' + }, + + 'en': { + 'arrival': 'Arrival', + 'departure': 'Departure', + 'duration': 'Duration', + 'changes': 'Changes', + 'products': 'Products', + 'from': 'From', + 'to': 'To', + 'date': 'Date', + 'time': 'Time', + 'station': 'Station', + 'platform': 'Platform', + 'walkinfo': 'Walk to %s (apprx. %s meters)', + 'changeinfo': '%s change duration', + 'transferinfo': 'Travel to %s', + 'swap': 'Swap from/to', + 'settings': 'Settings', + 'search': 'Search', + 'options': 'Options', + 'setfromto': 'Set as from/to', + 'journeyoverview': 'Go to journeysoverview', + 'lastjourney': 'Go to last selected journey', + 'longdistancetrain': 'Log distance trains', + 'regionaltrain': 'Regional trains', + 'suburbantrain': 'Suburban Trains', + 'subway': 'Subway', + 'tram': 'Tram', + 'bus': 'Bus', + 'ferry': 'Ferry', + 'taxi': 'Taxi', + 'save': 'Save', + 'clearstorage': 'Remove local data', + 'datasource': 'Data source', + 'accessibility': 'Accessibillity', + 'access_none': 'none', + 'access_partial': 'partial', + 'access_full': 'full', + 'etc': 'Others', + 'showds100': 'Show DS100 (if available)', + 'showdebug': 'Write debug messages to log', + 'graphical': 'Graphical overview for journeys', + 'fancy': 'Use fancy graphics', + 'update': 'Update application', + 'language': 'Language', + 'de': 'German', + 'en': 'English', + 'cancelled-ride': 'Cancelled!', + 'remarks': 'Remarks', + 'travelynx-checkin': 'show travelynx checkin?' + } +}
diff --git a/assets/client/js/lit-html.js b/assets/client/js/lit-html.js @@ -0,0 +1 @@ +const t=new WeakMap,e=e=>(...s)=>{const n=e(...s);return t.set(n,!0),n},s=e=>"function"==typeof e&&t.has(e),n=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,s=null,n=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.insertBefore(i,n),i=e}},o=(t,e,s=null)=>{let n=e;for(;n!==s;){const e=n.nextSibling;t.removeChild(n),n=e}},r={},l=`{{lit-${String(Math.random()).slice(2)}}}`,a=`\x3c!--${l}--\x3e`,h=new RegExp(`${l}|${a}`),c=(()=>{const t=document.createElement("div");return t.setAttribute("style","{{bad value}}"),"{{bad value}}"!==t.getAttribute("style")})();class d{constructor(t,e){this.parts=[],this.element=e;let s=-1,n=0;const i=[],o=e=>{const r=e.content,a=document.createTreeWalker(r,133,null,!1);let d,u;for(;a.nextNode();){s++,d=u;const e=u=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const i=e.attributes;let o=0;for(let t=0;t<i.length;t++)i[t].value.indexOf(l)>=0&&o++;for(;o-- >0;){const i=t.strings[n],o=m.exec(i)[2],r=c&&"style"===o?"style$":/^[a-zA-Z-]*$/.test(o)?o:o.toLowerCase(),l=e.getAttribute(r).split(h);this.parts.push({type:"attribute",index:s,name:o,strings:l}),e.removeAttribute(r),n+=l.length-1}}"TEMPLATE"===e.tagName&&o(e)}else if(3===e.nodeType){const t=e.nodeValue;if(t.indexOf(l)<0)continue;const o=e.parentNode,r=t.split(h),a=r.length-1;n+=a;for(let t=0;t<a;t++)o.insertBefore(""===r[t]?p():document.createTextNode(r[t]),e),this.parts.push({type:"node",index:s++});o.insertBefore(""===r[a]?p():document.createTextNode(r[a]),e),i.push(e)}else if(8===e.nodeType)if(e.nodeValue===l){const t=e.parentNode,o=e.previousSibling;null===o||o!==d||o.nodeType!==Node.TEXT_NODE?t.insertBefore(p(),e):s--,this.parts.push({type:"node",index:s++}),i.push(e),null===e.nextSibling?t.insertBefore(p(),e):s--,u=d,n++}else{let t=-1;for(;-1!==(t=e.nodeValue.indexOf(l,t+1));)this.parts.push({type:"node",index:-1})}}};o(e);for(const t of i)t.parentNode.removeChild(t)}}const u=t=>-1!==t.index,p=()=>document.createComment(""),m=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class g{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=n?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const o=t=>{const n=document.createTreeWalker(t,133,null,!1);let r=n.nextNode();for(;s<e.length&&null!==r;){const t=e[s];if(u(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(r),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(r,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===r.nodeName&&o(r.content),r=n.nextNode();else this._parts.push(void 0),s++}};return o(t),n&&(document.adoptNode(t),customElements.upgrade(t)),t}}class v{constructor(t,e,s,n){this.strings=t,this.values=e,this.type=s,this.processor=n}getHTML(){const t=this.strings.length-1;let e="",s=!0;for(let n=0;n<t;n++){const t=this.strings[n];e+=t;const i=t.lastIndexOf(">");!(s=(i>-1||s)&&-1===t.indexOf("<",i+1))&&c&&(e=e.replace(m,(t,e,s,n)=>"style"===s?`${e}style$${n}`:t)),e+=s?a:l}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}class f extends v{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,s=e.firstChild;return e.removeChild(s),i(e,s.firstChild),t}}const x=t=>null===t||!("object"==typeof t||"function"==typeof t);class _{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new y(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let n=0;n<e;n++){s+=t[n];const e=this.parts[n];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class y{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===r||x(t)&&t===this.value||(this.value=t,s(t)||(this.committer.dirty=!0))}commit(){for(;s(this.value);){const t=this.value;this.value=r,t(this)}this.value!==r&&this.committer.commit()}}class N{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(p()),this.endNode=t.appendChild(p())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=p()),t._insert(this.endNode=p())}insertAfterPart(t){t._insert(this.startNode=p()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}const t=this._pendingValue;t!==r&&(x(t)?t!==this.value&&this._commitText(t):t instanceof v?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):void 0!==t.then?this._commitPromise(t):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&e.nodeType===Node.TEXT_NODE?e.textContent=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value&&this.value.template===e)this.value.update(t.values);else{const s=new g(e,t.processor,this.options),n=s._clone();s.update(t.values),this._commitNode(n),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,n=0;for(const i of t)void 0===(s=e[n])&&(s=new N(this.options),e.push(s),0===n?s.appendIntoPart(this):s.insertAfterPart(e[n-1])),s.setValue(i),s.commit(),n++;n<e.length&&(e.length=n,this.clear(s&&s.endNode))}_commitPromise(t){this.value=t,t.then(e=>{this.value===t&&(this.setValue(e),this.commit())})}clear(t=this.startNode){o(this.startNode.parentNode,t.nextSibling,this.endNode)}}class V{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}if(this._pendingValue===r)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=r}}class T extends _{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new b(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class b extends y{}let E=!1;try{const t={get capture(){return E=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class w{constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=(t=>this.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}if(this._pendingValue===r)return;const t=this._pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),this._options=A(t),i&&this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options),this.value=t,this._pendingValue=r}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const A=t=>t&&(E?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);class S{handleAttributeExpressions(t,e,s,n){const i=e[0];if("."===i){return new T(t,e.slice(1),s).parts}return"@"===i?[new w(t,e.slice(1),n.eventContext)]:"?"===i?[new V(t,e.slice(1),s)]:new _(t,e,s).parts}handleTextExpression(t){return new N(t)}}const C=new S;function M(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const n=t.strings.join(l);return void 0===(s=e.keyString.get(n))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(n,s)),e.stringsArray.set(t.strings,s),s}const L=new Map,P=new WeakMap,$=(t,e,s)=>{let n=P.get(e);void 0===n&&(o(e,e.firstChild),P.set(e,n=new N(Object.assign({templateFactory:M},s))),n.appendInto(e)),n.setValue(t),n.commit()},k=(t,...e)=>new v(t,e,"html",C),H=(t,...e)=>new f(t,e,"svg",C);export{k as html,H as svg,S as DefaultTemplateProcessor,C as defaultTemplateProcessor,e as directive,s as isDirective,o as removeNodes,i as reparentNodes,r as noChange,_ as AttributeCommitter,y as AttributePart,V as BooleanAttributePart,w as EventPart,x as isPrimitive,N as NodePart,T as PropertyCommitter,b as PropertyPart,P as parts,$ as render,L as templateCaches,M as templateFactory,g as TemplateInstance,f as SVGTemplateResult,v as TemplateResult,p as createMarker,u as isTemplatePartActive,d as Template};
diff --git a/assets/client/js/overlays.js b/assets/client/js/overlays.js @@ -0,0 +1,42 @@ +'use strict'; + +import { showDiv, hideDiv, ElementById } from './helpers.js'; +import { html, render } from './lit-html.js'; + +export const showAlertModal = (text) => { + showDiv('overlay'); + render(html` + <div id="modal"> + <div id="modal-box"> + <div id="modal-text">${text}</div> + <div id="dismiss" @click=${() => hideDiv('overlay')}>OK</div> + </div> + </div> + `, ElementById('overlay')); +}; + +export const showModal = (title, content) => { + showDiv('overlay'); + render(html` + <div class="modal-dialog"> + <div id="modal-content" class="modal-content"> + <div class="modal-header"> + <div class="modal-close" @click=${() => hideDiv('overlay')}></div> + <h4 class="modal-title">${title}</h4> + </div> + <div class="modal-body">${content}</div> + </div> + </div> + `, ElementById('overlay')); +}; + +export const showLoader = () => { + showDiv('overlay'); + render(html` + <div id="loading"> + <div id="spinner"></div> + </div> + `, document.getElementById('overlay')); +}; + +export const hideLoader = () => hideDiv('overlay');
diff --git a/assets/client/js/router.js b/assets/client/js/router.js @@ -0,0 +1,25 @@ +'use strict'; + +const routes = []; + +export const route = (pattern, handler) => { + routes.push({ + pattern: pattern, + handler: handler + }); +}; + +export const go = (dest) => { + window.location.hash = '#' + dest; +}; + +export const start = () => { + const dest = window.location.hash.slice(1); + for (let route of routes) { + const match = route.pattern.exec(dest); + if (!match) continue; + return route.handler(match.slice(1)); + } +}; + +window.addEventListener('hashchange', start);
diff --git a/assets/client/js/searchView.js b/assets/client/js/searchView.js @@ -0,0 +1,347 @@ +'use strict'; + +import { showDiv, ElementById, padZeros, isValidDate } from './helpers.js'; +import { getCache, addCache, parseName, saveDataStorage, ConsoleLog, t, loadDS100 } from './app_functions.js'; +import { dataStorage } from './app.js'; +import { get } from './api.js'; +import { go } from './router.js'; +import { html, render } from './lit-html.js'; +import { showAlertModal, showLoader, hideLoader} from './overlays.js'; +import { showSettings } from './settingsView.js'; + + +let currDate = new Date(); +let fromValue = ''; +let toValue = ''; +let isArrValue = false; +let dateValue = currDate.getFullYear()+'-'+padZeros(currDate.getMonth()+1)+'-'+padZeros(currDate.getDate());; +let timeValue = padZeros(currDate.getHours())+':'+padZeros(currDate.getMinutes()); +let suggestionsCache = { + from: {}, + to: {}, +}; + +const searchTemplate = (journeysHistory) => html` + <div id="searchView"> + <div class="inputs"> + <input type="text" id="from" value="${fromValue}" placeholder="${t('from')}" autocomplete="off" @keyup=${loadSuggestions} @focus=${startTyping} @blur=${stopTyping} @keypress=${onKeypress}> + <div class="suggestions" id="fromsuggestions"></div> + <input type="text" id="to" value="${toValue}" placeholder="${t('to')}" autocomplete="off" @keyup=${loadSuggestions} @focus=${startTyping} @blur=${stopTyping} @keypress=${onKeypress}> + <div class="suggestions" id="tosuggestions"></div> + <div id="datetime"> + <div id="deparr"> + <label class="switch"> + <input type="checkbox" id="isarr" ?checked=${isArrValue}> + <span class="slider"></span> + </label> + </div> + <input type="date" id="date" placeholder="${t('date')} (YYYY-MM-DD)" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" value="${dateValue}"> + <input type="time" id="time" placeholder="${t('time')} (HH:MM" pattern="[0-9]{2}:[0-9]{2}" value="${timeValue}"> + </div> + </div> + + <div class="row"> + <div class="product_selector"> + <input type="checkbox" id="national"> + <label for="national" title="${t('longdistancetrain')}"> </label> + + <input type="checkbox" id="regional"> + <label for="regional" title="${t('regionaltrain')}"> </label> + + <input type="checkbox" id="suburban"> + <label for="suburban" title="${t('suburbantrain')}"> </label> + + <input type="checkbox" id="subway"> + <label for="subway" title="${t('subway')}"> </label> + + <input type="checkbox" id="tram"> + <label for="tram" title="${t('tram')}"> </label> + + <input type="checkbox" id="bus"> + <label for="bus" title="${t('bus')}"> </label> + + <input type="checkbox" id="ferry"> + <label for="ferry" title="${t('ferry')}"> </label> + + <input type="checkbox" id="taxi"> + <label for="taxi" title="${t('taxi')}"> </label> + </div> + <div class="button swap" id="swap" title="${t('swap')}" @click=${swapFromTo}></div> + + <a class="button settings" title="${t('settings')}" @click=${showSettings}></a> + <div class="button search" tabindex="0" id="search" title="${t('search')}" @click=${search}></div> + </div> + + ${journeysHistory.length ? html` + ${journeysHistoryTemplate(journeysHistory)} + ` : ''} + </div> +`; + +const journeysHistoryTemplate = (journeysHistory) => html` + <div id="journeysHistory"> + <table> + <thead> + <tr><th>${t('from')}</th><th>${t('to')}</th><th>${t('options')}</th></tr> + </thead> + <tbody id="journeysHistoryTable"> + ${journeysHistory.map(element => html` + <tr class="fromHistory" @click=${() => setFromHistory(journeysHistory.length - 1 - journeysHistory.indexOf(element))}" title="${t('setfromto')}"> + <td>${parseName(element.fromPoint)}</td> + <td>${parseName(element.toPoint)}</td> + <td> + <a class="departures" href="#/${element.reqId}" title="${t('journeyoverview')}"></a> + ${element.journeyId === '' ? '' : html` + <a class="directions" href="#/${element.reqId}/${element.journeyId}" title="${t('lastjourney')}"></a> + `} + </td> + </tr> + `)} + </tbody> + </table> + </div> +`; + +export const searchView = () => { + const journeysHistory = getCache('journeysHistory').slice().reverse(); + render(searchTemplate(journeysHistory), ElementById('content')); + + ElementById('from').focus(); + + for (let product in dataStorage.settings.products) { + if (ElementById(product) !== null) { + ElementById(product).checked = dataStorage.settings.products[product]; + } + }; +}; + +export const search = async (requestId) => { + const provider = dataStorage.settings.provider; + let products = readProductSelection(); + const accessibility = dataStorage.settings.accessibility; + let isDep = !ElementById('isarr').checked; + let date = ElementById('date').value; + let time = ElementById('time').value; + let timestamp = ''; + let from = ''; + let to = ''; + + currDate = new Date(); + fromValue = ElementById('from').value; + toValue = ElementById('to').value; + dateValue = ElementById('date').value; + timeValue = ElementById('time').value; + isArrValue = ElementById('isarr').checked; + + if (date !== '') { + if (!isValidDate(date)) { + showAlertModal('Ungültiges Datum!'); + return; + } + } else { + date = currDate.getFullYear()+'-'+padZeros(currDate.getMonth()+1)+'-'+padZeros(currDate.getDate()); + } + + if (time !== '') { + if (!new RegExp('([0-1][0-9]|2[0-3]):([0-5][0-9])').test(time)) { + showAlertModal('Ungültige Zeitangabe!'); + return; + } + } else { + time = padZeros(currDate.getHours())+':'+padZeros(currDate.getMinutes()); + } + + if (ElementById('from').value == "" | ElementById('to').value == "") { + showAlertModal("Abfahrts - und Ankunftsbahnhof müssen ausgefüllt werden."); + return; + } + + if (Object.entries(suggestionsCache.from).length !== 0) { + from = suggestionsCache.from; + } else { + let suggestions = await get("/suggestions", {"query": ElementById('from').value, "results": 1}, true); + + if (!suggestions[0]) { + showAlertModal("Abfahrtsbahnof ungültig"); + return; + } + + from = suggestions[0] + } + + if (Object.entries(suggestionsCache.to).length !== 0) { + to = suggestionsCache.to; + } else { + let suggestions = await get("/suggestions", {"query": ElementById('to').value, "results": 1}, true); + + if (!suggestions[0]) { + showAlertModal("Ankunftsbahnhof ungültig"); + return; + } + + to = suggestions[0] + } + + dataStorage.settings.products = products; + saveDataStorage(); + + + const split_date = date.split('-'); + const split_time = time.split(':'); + + timestamp = Math.round(new Date(split_date[0], split_date[1]-1, split_date[2], split_time[0], split_time[1]).getTime()/1000); + + ConsoleLog(timestamp+'///'+date+' '+time+':00'); + + let params = { + "fromPoint": from, + "toPoint": to, + "accessibility": accessibility, + "products": products + } + + if (!isDep) { + params.arrival = timestamp + } else { + params.departure = timestamp + } + + const data = await get("/journeys", {"params":params}); + addCache('journeys', data); + go('/' + data.reqId); +}; + +const suggestionsTemplate = (suggestions, inputId) => html` + <div class="suggestionsbox" @mouseover=${mouseOverSuggestions} @mouseout=${stopMouseOverSuggestions}> + ${suggestions.map(element => html` + <p class="suggestion" @click=${() => setSuggestion(encodeURI(JSON.stringify(element)), inputId)}>${parseName(element)}</p> + `)} + </div> +`; + +const loadSuggestions = async (e, input) => { + const val = e.target.value; + suggestionsCache[e.target.id] = {}; + const suggestions = val ? await get("/suggestions", {"query": val}, true) : []; + const suggestionsEl = ElementById(e.target.id+'suggestions'); + render(suggestionsTemplate(suggestions, e.target.id), suggestionsEl); +}; + +export const setSuggestion = (data, inputId) => { + if (typeof data === 'string') { + data = JSON.parse(decodeURI(data)); + } + + suggestionsCache[inputId] = data; + ElementById(inputId).value = parseName(data); + + if (inputId === 'from') { + ElementById('fromsuggestions').classList.remove('mouseover'); + ElementById('to').focus(); + } else if (inputId === 'to') { + ElementById('tosuggestions').classList.remove('mouseover'); + ElementById('to').blur(); + } +}; + +export const swapFromTo = () => { + suggestionsCache.from = [suggestionsCache.to, suggestionsCache.to = suggestionsCache.from][0]; + + let from = ElementById('from'); + let to = ElementById('to'); + + from.value = [to.value, to.value = from.value][0]; +}; + +export const setFromHistory = (id) => { + const cache = getCache('journeysHistory'); + + if (cache[id] !== undefined){ + setSuggestion(cache[id].fromPoint, 'from'); + setSuggestion(cache[id].toPoint, 'to'); + } +}; + +export const readProductSelection = () => { + let products = { + "nationalExp": false, + "national": false, + "regionalExp": false, + "regional": false, + "suburban": false, + "bus": false, + "ferry": false, + "subway": false, + "tram": false, + "taxi": false + } + + if (ElementById('national').checked !== false) { + products.nationalExp = true; + products.national = true; + } + + if (ElementById('regional').checked !== false) { + products.regionalExp = true; + products.regional = true; + } + + if (ElementById('suburban').checked !== false) { + products.suburban = true; + } + + if (ElementById('subway').checked !== false) { + products.subway = true; + } + + if (ElementById('tram').checked !== false) { + products.tram = true; + } + + if (ElementById('bus').checked !== false) { + products.bus = true; + } + + if (ElementById('ferry').checked !== false) { + products.ferry = true; + } + + if (ElementById('taxi').checked !== false) { + products.taxi = true; + } + + return products; +}; + +const startTyping = (e) => { + ElementById(e.target.id+'suggestions').classList.add('typing'); + if (e.target.id == 'from') ElementById('tosuggestions').classList.remove('mouseover'); + if (e.target.id == 'to') ElementById('fromsuggestions').classList.remove('mouseover'); +}; + +const stopTyping = (e) => { + ElementById(e.target.id+'suggestions').classList.remove('typing'); +}; + +const mouseOverSuggestions = (e) => { + let el = e.target; + let i = 0; + while (i++ < 10 && el.id !== 'fromsuggestions' && el.id !== 'tosuggestions') el = el.parentElement; + el.classList.add('mouseover'); +}; + +const stopMouseOverSuggestions = (e) => { + let el = e.target; + let i = 0; + while (i++ < 10 && el.id !== 'fromsuggestions' && el.id !== 'tosuggestions') el = el.parentElement; + el.classList.remove('mouseover'); +}; + +const onKeypress = (e) => { + if (e.which == 13 || e.keyCode == 13) { // enter + document.querySelector(`#${e.target.id}suggestions>.suggestionsbox>:first-child`).click(); + if (e.target.id === 'to') ElementById('go').click(); + return false; + } + return true; +};
diff --git a/assets/client/js/settingsView.js b/assets/client/js/settingsView.js @@ -0,0 +1,76 @@ +import { dataStorage } from './app.js'; +import { showModal } from './overlays.js'; +import { hideDiv, ElementById } from './helpers.js'; +import { saveDataStorage, clearDataStorage, ConsoleLog, t, loadDS100 } from './app_functions.js'; +import { html, render } from './lit-html.js'; +import { searchView } from './searchView.js'; + +export const showSettings = () => { + showModal(t('settings'), settingsTemplate()) +}; + +const settingsTemplate = () => html` + <div id="settingsView"> + <b>${t('datasource')}:</b><br> + <label><input type="radio" name="provider" ?checked=${dataStorage.settings.provider === "DB"} value="DB"> DB</label><br> + <label><input type="radio" disabled="disabled" name="provider" ?checked=${dataStorage.settings.provider === "SH"} value="SH"> NAH.SH</label><br> + <label><input type="radio" disabled="disabled" name="provider" ?checked=${dataStorage.settings.provider === "BVG"} value="BVG"> BVG</label><br> + <br> + <b>${t('accessibility')}:</b><br> + <label><input type="radio" name="accessibility" ?checked=${dataStorage.settings.accessibility === "none"} value="none"> ${t('access_none')}</label><br> + <label><input type="radio" name="accessibility" ?checked=${dataStorage.settings.accessibility === "partial"} value="partial"> ${t('access_partial')}</label><br> + <label><input type="radio" name="accessibility" ?checked=${dataStorage.settings.accessibility === "complete"} value="complete"> ${t('access_full')}</label><br> + <br> + <b>${t('etc')}:</b><br> + <label><input type="checkbox" ?checked=${dataStorage.settings.showRIL100Names} id="ril100"> ${t('showds100')}</label><br> + <label><input type="checkbox" ?checked=${dataStorage.settings.writeDebugLog} id="debug-messages"> ${t('showdebug')}</label><br> + <label><input type="checkbox" ?checked=${dataStorage.settings.enableCanvas} id="enable-canvas"> ${t('graphical')} <b>BETA</b></label><br> + <label><input type="checkbox" ?checked=${dataStorage.settings.fancyCanvas} id="fancy-canvas"> ${t('fancy')}</label><br> + <label><input type="checkbox" ?checked=${dataStorage.settings.travelynx} id="travelynx"> ${t('travelynx-checkin')}</label><br> + <br> + <b>${t('language')}:</b><br> + <label><input type="radio" name="language" ?checked=${dataStorage.settings.language === "de"} value="de"> ${t('de')}</label><br> + <label><input type="radio" name="language" ?checked=${dataStorage.settings.language === "en"} value="en"> ${t('en')}</label><br> + + <div class="buttons"> + <button class="btn orange" id="rebuild-cache" @click=${rebuildCache}><span>${t('update')}</span></button> + <button class="btn red" id="clear" @click=${clearDataStorage}><span>${t('clearstorage')}</span></button> + <button class="btn" id="save" @click=${saveSettings}><span>${t('save')}</span></button> + </div> + </div> +`; + +const rebuildCache = () => { + ConsoleLog('sw update'); + registration.update(); + location.reload(); +}; + +const saveSettings = async () => { + const provider = document.querySelector('input[name="provider"]:checked').value; + const accessibility = document.querySelector('input[name="accessibility"]:checked').value; + const language = document.querySelector('input[name="language"]:checked').value; + const show_ril100 = ElementById('ril100').checked; + const write_debug = ElementById('debug-messages').checked; + const enable_canvas = ElementById('enable-canvas').checked; + const fancy_canvas = ElementById('fancy-canvas').checked; + const travelynx = ElementById('travelynx').checked; + + if (provider !== dataStorage.settings.provider) { + dataStorage.journeysHistory = []; + } + + dataStorage.settings.provider = provider; + dataStorage.settings.accessibility = accessibility; + dataStorage.settings.showRIL100Names = show_ril100; + dataStorage.settings.writeDebugLog = write_debug; + dataStorage.settings.enableCanvas = enable_canvas; + dataStorage.settings.fancyCanvas = fancy_canvas; + dataStorage.settings.language = language; + dataStorage.settings.travelynx = travelynx; + + saveDataStorage(); + if (show_ril100) await loadDS100(); + searchView(); + hideDiv('overlay'); +};
diff --git a/assets/client/js/sprintf.min.js b/assets/client/js/sprintf.min.js @@ -0,0 +1,205 @@ +'use strict' + + let re = { + not_string: /[^s]/, + not_bool: /[^t]/, + not_type: /[^T]/, + not_primitive: /[^v]/, + number: /[diefg]/, + numeric_arg: /[bcdiefguxX]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[+-]/ + } + + function sprintf(key) { + // `arguments` is not an array, but should be fine for this call + return sprintf_format(sprintf_parse(key), arguments) + } + + export const vsprintf = (fmt, argv) => { + return sprintf.apply(null, [fmt].concat(argv || [])) + } + + function sprintf_format(parse_tree, argv) { + let cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign + for (i = 0; i < tree_length; i++) { + if (typeof parse_tree[i] === 'string') { + output += parse_tree[i] + } + else if (typeof parse_tree[i] === 'object') { + ph = parse_tree[i] // convenience purposes only + if (ph.keys) { // keyword argument + arg = argv[cursor] + for (k = 0; k < ph.keys.length; k++) { + if (arg == undefined) { + throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) + } + arg = arg[ph.keys[k]] + } + } + else if (ph.param_no) { // positional argument (explicit) + arg = argv[ph.param_no] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { + arg = arg() + } + + if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) + } + + if (re.number.test(ph.type)) { + is_positive = arg >= 0 + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2) + break + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)) + break + case 'd': + case 'i': + arg = parseInt(arg, 10) + break + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) + break + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() + break + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) + break + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) + break + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8) + break + case 's': + arg = String(arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 't': + arg = String(!!arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'u': + arg = parseInt(arg, 10) >>> 0 + break + case 'v': + arg = arg.valueOf() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16) + break + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() + break + } + if (re.json.test(ph.type)) { + output += arg + } + else { + if (re.number.test(ph.type) && (!is_positive || ph.sign)) { + sign = is_positive ? '+' : '-' + arg = arg.toString().replace(re.sign, '') + } + else { + sign = '' + } + pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' + pad_length = ph.width - (sign + arg).length + pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' + output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) + } + } + } + return output + } + + let sprintf_cache = Object.create(null) + + function sprintf_parse(fmt) { + if (sprintf_cache[fmt]) { + return sprintf_cache[fmt] + } + + let _fmt = fmt, match, parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree.push(match[0]) + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree.push('%') + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + let field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + } + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') + } + + parse_tree.push( + { + placeholder: match[0], + param_no: match[1], + keys: match[2], + sign: match[3], + pad_char: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + } + ) + } + else { + throw new SyntaxError('[sprintf] unexpected placeholder') + } + _fmt = _fmt.substring(match[0].length) + } + return sprintf_cache[fmt] = parse_tree + } +
diff --git a/assets/client/manifest.json b/assets/client/manifest.json @@ -0,0 +1,21 @@ +{ + "name": "Öffisearch", + "short_name": "Öffisearch", + "start_url": ".", + "icons": [ + { + "src": "./img/favicon-64x64.png", + "sizes": "64x64", + "type": "image/png" + }, + { + "src": "./img/favicon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} +
diff --git a/assets/client/service-worker.js b/assets/client/service-worker.js @@ -0,0 +1,91 @@ +'use strict'; + +const CACHE = 'cache-v34'; + +let preCache = [ + './img/product_bus_grey.svg', + './img/product_cablecar_color.svg', + './img/product_cablecar_grey.svg', + './img/product_call_color.svg', + './img/product_call_grey.svg', + './img/product_ferry_color.svg', + './img/product_ferry_grey.svg', + './img/product_highspeed_color.svg', + './img/product_highspeed_grey.svg', + './img/product_suburban_color.svg', + './img/product_suburban_grey.svg', + './img/product_subway_color.svg', + './img/product_subway_grey.svg', + './img/product_train_color.svg', + './img/product_train_grey.svg', + './img/product_bus_color.svg', + './img/product_tram_grey.svg', + './img/product_tram_color.svg', + './img/back.svg', + './img/baseline-beenhere-24px.svg', + './img/baseline-departure_board-24px.svg', + './img/baseline-directions-24px.svg', + './img/baseline-directions-24px_white.svg', + './img/baseline-directions_walk-24px.svg', + './img/baseline-expand_more-24px.svg', + './img/baseline-import_export-24px.svg', + './img/baseline-navigation-24px.svg', + './img/baseline-place-24px.svg', + './img/baseline-settings-20px.svg', + './ing/baseline-swap_vert-24px.svg', + './img/baseline-refresh-24px.svg', + './img/ba8064fd767ceaa170589aa3dd11e58e.jpg', + './img/favicon-16x16.png', + './img/favicon-32x32.png', + './img/favicon-64x64.png', + './img/favicon-512x512.png', + './img/apple-touch-icon.png', + './js/api.js', + './js/canvas.js', + './js/journeysView.js', + './js/journeyView.js', + './js/searchView.js', + './js/settingsView.js', + './js/app_functions.js', + './js/helpers.js', + './js/app.js', + './js/router.js', + './js/overlays.js', + './css/product_selector.css', + './css/style.css', + './manifest.json', + './index.html', + './' +]; + +self.addEventListener('install', function (evt) { + self.skipWaiting(); + evt.waitUntil(caches.open(CACHE).then(function (cache) { + cache.addAll(preCache); + })); +}); + +self.addEventListener('fetch', function (evt) { + evt.respondWith(fromCache(evt.request).then(function (match) { + if (match) { + return match; + } else { + return fetch(evt.request); + } + })); +}); + +self.addEventListener('activate', function (event) { + event.waitUntil(clients.claim()); + event.waitUntil(clients.claim().then(function () { + return caches.keys().then(function (cacheNames) { + return Promise.all(cacheNames.filter(c => c !== CACHE).map(c => caches.delete(c))); + }); + })); +}); + +function fromCache (request) { + return caches.open(CACHE).then(function (cache) { + return cache.match(request); + }); +}
diff --git a/assets/client/todo.txt b/assets/client/todo.txt @@ -0,0 +1,8 @@ +Todo: + journeyview: + - umsteigezeit + - canvas pfeile auf haidpi + - klicken aufs canvas führt zu marudor + - bei refresh das loading overlay ausblenden + - walkspeed + - combine multiple walking legs+ \ No newline at end of file
diff --git a/assets/favicon-512x512.png b/assets/favicon-512x512.png Binary files differ.
diff --git a/assets/favicon-64x64.png b/assets/favicon-64x64.png Binary files differ.
diff --git a/assets/js/canvas.js b/assets/js/canvas.js @@ -0,0 +1,333 @@ +'use strict'; + +import { moreJourneys } from './journeysView.js'; +import { dataStorage } from './app.js'; + +const padZeroes = (str) => ('00' + str).slice(-2); + +const formatTime = (date) => { + date = new Date(date * 1000); + return `${padZeroes(date.getHours())}:${padZeroes(date.getMinutes())}` +}; + +const textFor = (leg) => leg.line && leg.line.name || ""; +const colorFor = (leg, type) => { + let product = leg.line && leg.line.product || "walk"; + return colors[type][product] || colors[type].default; +}; + +const flatten = (arr) => [].concat(...arr); + +const colors = { + fill: { + 'tram': '#cc5555', + 'subway': '#5555cc', + 'suburban': '#55aa55', + 'nationalExp': '#fff', + 'national': '#fff', + 'regionalExp': '#888', + 'regional': '#888', + 'bus': '#aa55aa', + default: '#888' + }, + text: { + 'nationalExp': '#ee3333', + 'national': '#ee3333', + default: '#fff' + }, + icon: { + 'walk': 'directions_walk', + 'transfer': 'directions_transfer', + 'subway': 'directions_subway', + 'bus': 'directions_bus', + 'tram': 'tram', + default: 'train' + } +}; + +let rectWidth, padding, rectWidthWithPadding, canvas, ctx, dpr; + +const canvasState = { + journeys: [], + offsetX: 0, + firstJourney: 1, +}; + +const textCache = {}; +let textCacheWidth; +let textCacheDpr; + +export const setupCanvas = (data) => { + canvasState.offsetX = (window.innerWidth / dpr) > 600 ? 120 : 60, + canvas = document.getElementById('canvas'); + ctx = canvas.getContext('2d'); + canvasState.journeys = Object.keys(data.journeys).sort((a, b) => Number(a) - Number(b)).map(k => data.journeys[k]); + canvasState.reqId = data.reqId; + canvasState.firstJourney = Number(Object.keys(data.journeys).sort((a, b) => Number(a) - Number(b))[0]); + + canvas.addEventListener('mousedown', mouseDownHandler, {passive: true}); + canvas.addEventListener('touchstart', mouseDownHandler, {passive: true}); + updateTextCache(); + resizeHandler(); +}; + +const addTextToCache = (text, color, fixedHeight) => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + + let height, width + if (fixedHeight) { + height = 15; + ctx.font = `${height}px sans-serif`; + width = ctx.measureText(text).width; + } else { + const measureAccuracy = 50; + ctx.font = `${measureAccuracy}px sans-serif`; + width = rectWidth - 10; + height = Math.abs(measureAccuracy * (width / (1 - ctx.measureText(text).width))); + } + + canvas.width = width * dpr; + canvas.height = (Math.ceil(height) + 1) * dpr; + ctx.scale(dpr, dpr); + + ctx.font = `${height}px sans-serif`; + ctx.fillStyle = color; + if (height > 10) { + ctx.fillText(text, 0, height); + textCache[text] = canvas; + } +}; + +const updateTextCache = () => { + textCache.length = 0; + textCacheWidth = rectWidth; + textCacheDpr = dpr; + for (let journey of canvasState.journeys) { + for (let leg of journey.legs) { + addTextToCache(textFor(leg), colorFor(leg, "text")); + + let times = []; + if (journey.legs.indexOf(leg) == 0) times.push(leg.departure); + if (journey.legs.indexOf(leg) == journey.legs.length - 1) times.push(leg.arrival); + for (let time of times) { + addTextToCache(formatTime(time.prognosedTime || time.plannedTime), "#fff", 15); + } + } + } +}; + +const renderJourneys = () => { + ctx.shadowBlur = 0; + ctx.clearRect(0, 0, canvas.width / dpr, canvas.height / dpr); + ctx.fillStyle = '#00000085'; + ctx.fillRect(0, 0, canvas.width / dpr, canvas.height / dpr); + let x = canvasState.offsetX, y; + + let firstVisibleJourney = Math.max(0, Math.floor((-canvasState.offsetX + padding) / rectWidthWithPadding)); + let numVisibleJourneys = Math.ceil(canvas.width / dpr / rectWidthWithPadding); + let visibleJourneys = canvasState.journeys.slice(firstVisibleJourney, firstVisibleJourney + numVisibleJourneys); + + if (!visibleJourneys.length) return; + + let firstDeparture = visibleJourneys[0].legs[0].departure.plannedTime; + let lastArrival = Math.max.apply(Math, + visibleJourneys.map(journey => journey.legs[journey.legs.length-1].arrival.plannedTime) + .concat(visibleJourneys.map(journey => journey.legs[journey.legs.length-1].arrival.prognosedTime)) + ); + let scaleFactor = 1/(lastArrival - firstDeparture) * (canvas.height - 64 * dpr) / dpr; + + let time = canvasState.journeys[0].legs[0].departure.plannedTime; + + ctx.font = `${(window.innerWidth / dpr) > 600 ? 20 : 15}px sans-serif`; + ctx.fillStyle = '#aaa'; + while (time < lastArrival) { + let y = (time - firstDeparture) * scaleFactor + 32; + ctx.fillText(formatTime(time), (window.innerWidth / dpr) > 600 ? 30 : 10, y); + ctx.fillRect(0, y, canvas.width / dpr, 1); + time += Math.floor(120/scaleFactor); + } + ctx.fillStyle = '#fa5'; + y = (Number(new Date()) / 1000 - firstDeparture) * scaleFactor + 32; + ctx.fillRect(0, y-2, canvas.width / dpr, 5); + + const p = new Path2D('M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z'); + ctx.fillStyle = '#fff'; + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + ctx.save(); + ctx.scale(3, 3); + ctx.translate(x / 3 - 15, canvas.height / dpr / 6 - 24); + ctx.rotate(-Math.PI*1.5); + ctx.fill(p); + ctx.restore(); + ctx.beginPath(); + ctx.arc(x - 80,canvas.height / dpr / 2 - 35,50,0,2*Math.PI); + ctx.fillStyle = '#ffffff40'; + ctx.fill(); + ctx.strokeStyle = '#00000020'; + ctx.stroke(); + + for (let journey of canvasState.journeys) { + journey.legs.reverse(); + for (let leg of journey.legs) { + let depDelayed = leg.departure.prognosedTime && leg.departure.prognosedTime != leg.departure.plannedTime + let arrDelayed = leg.arrival.prognosedTime && leg.arrival.prognosedTime != leg.arrival.plannedTime + if (depDelayed || arrDelayed) { + const start = leg.departure.plannedTime; + const stop = leg.arrival.plannedTime; + const duration = (stop - start) * scaleFactor; + + y = (start - firstDeparture) * scaleFactor + 32; + + ctx.shadowBlur = 0; + ctx.fillStyle = '#44444480'; + ctx.strokeStyle = '#ffffff80'; + ctx.fillRect(x-padding, y, rectWidth, duration); + ctx.strokeRect(x-padding, y, rectWidth, duration); + } + } + x += rectWidthWithPadding; + } + + x = canvasState.offsetX; + + for (let journey of canvasState.journeys) { + for (let leg of journey.legs) { + const start = leg.departure.prognosedTime || leg.departure.plannedTime; + const stop = leg.arrival.prognosedTime || leg.arrival.plannedTime; + const duration = (stop - start) * scaleFactor; + + y = (start - firstDeparture) * scaleFactor + 32; + + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 10 : 0; + ctx.shadowColor = '#00000060'; + + if (leg.isWalking || leg.isTransfer) { + ctx.fillStyle = '#777'; + ctx.fillRect(x + rectWidth / 2 - rectWidth / 10, y, rectWidth / 5, duration); + } else { + ctx.fillStyle = colorFor(leg, "fill"); + ctx.fillRect(x, y, rectWidth, duration); + } + + ctx.shadowBlur = 0; + + let preRenderedText = textCache[textFor(leg)]; + if ((preRenderedText.height / dpr) < duration - 5) { + ctx.scale(1 / dpr, 1 / dpr); + ctx.drawImage(preRenderedText, dpr * (x + 5), Math.floor(dpr * (y + duration / 2) - preRenderedText.height / 1.5)); + ctx.scale(dpr, dpr); + } + + if (leg.cancelled) { + ctx.shadowBlur = 5; + ctx.strokeStyle = '#cc4444ff'; + ctx.lineWidth = 5; + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + rectWidth, y + duration); + ctx.stroke(); + ctx.lineWidth = 1; + } + + /* draw journey start and end time */ + let time; + // note: leg order is reversed at this point in time + let times = []; + if (journey.legs.indexOf(leg) == journey.legs.length - 1) times.push([leg.departure, y - 9.5]); + if (journey.legs.indexOf(leg) == 0) times.push([leg.arrival, y + duration + 7.5]); + for (let [time, y] of times) { + preRenderedText = textCache[formatTime(time.prognosedTime || time.plannedTime)]; + ctx.scale(1 / dpr, 1 / dpr); + ctx.drawImage(preRenderedText, Math.ceil(dpr * (x + ((rectWidth - preRenderedText.width/dpr)) / 2)), dpr * (y - 7.5)); //Math.floor(dpr * (x + rectWidth / 2) - preRenderedText.width), dpr * (y - 1)); + ctx.scale(dpr, dpr); + } + } + + journey.legs.reverse(); + x += rectWidthWithPadding; + } + ctx.fillStyle = '#fff'; + ctx.shadowBlur = dataStorage.settings.fancyCanvas ? 5 : 0; + ctx.shadowColor = '#00000080'; + ctx.save(); + ctx.scale(3, 3); + ctx.translate(x / 3 + 5, canvas.height / dpr / 6); + ctx.rotate(Math.PI*1.5); + ctx.fill(p); + ctx.restore(); + ctx.beginPath(); + ctx.arc(x + 50,canvas.height / dpr / 2 - 35,50,0,2*Math.PI); + ctx.fillStyle = '#ffffff40'; + ctx.fill(); + ctx.strokeStyle = '#00000020'; + ctx.stroke(); +}; + +const resizeHandler = () => { + dpr = window.devicePixelRatio || 1; + if (!document.getElementById('canvas')) return; + + rectWidth = (window.innerWidth / dpr) > 600 ? 100 : 80; + padding = (window.innerWidth / dpr) > 600 ? 20 : 5; + rectWidthWithPadding = rectWidth + 2 * padding; + + if (rectWidth !== textCacheWidth || dpr !== textCacheDpr) updateTextCache(); + + const rect = document.getElementById('header').getBoundingClientRect(); + canvas.width = window.innerWidth * dpr; + canvas.height = (window.innerHeight - rect.height) * dpr; + canvas.style.width = `${window.innerWidth}px`; + canvas.style.height = `${window.innerHeight - rect.height}px`; + + ctx.restore(); + ctx.save(); + ctx.scale(dpr, dpr); + + renderJourneys(); +}; + +const mouseUpHandler = (evt) => { + let x = evt.x || evt.changedTouches[0].pageX; + if (canvasState.dragging && Math.abs(canvasState.dragStartMouse - x) < 20) { + let num = Math.floor((x - canvasState.offsetX + 2 * padding) / rectWidthWithPadding); + if (num >= 0) { + if (num < canvasState.journeys.length) { + window.location.hash += '/' + (num+canvasState.firstJourney); + } else { + moreJourneys(canvasState.reqId, "later"); + } + } else { + moreJourneys(canvasState.reqId, "earlier"); + } + } + + canvasState.dragging = false; +}; + +const mouseDownHandler = (evt) => { + let x = evt.x || evt.changedTouches[0].pageX; + canvasState.dragStartMouse = x; + canvasState.dragStartOffset = canvasState.offsetX; + canvasState.dragging = true; +}; + +const mouseMoveHandler = (evt) => { + if (canvasState.dragging) { + evt.preventDefault(); + let x = evt.x || evt.changedTouches[0].pageX; + canvasState.offsetX = canvasState.dragStartOffset - (canvasState.dragStartMouse - x); + renderJourneys(); + return true; + } +}; + +window.addEventListener('mouseup', mouseUpHandler); +window.addEventListener('touchend', mouseUpHandler); +window.addEventListener('mousemove', mouseMoveHandler); +window.addEventListener('touchmove', mouseMoveHandler); +window.addEventListener('resize', resizeHandler); +window.addEventListener('zoom', resizeHandler);
diff --git a/assets/js/helpers.js b/assets/js/helpers.js @@ -0,0 +1,70 @@ +import { html, render } from './lit-html.js'; + +export const ElementById = (id) => { + return document.getElementById(id); +}; + +export const showDiv = (id) => { + const element = document.getElementById(id); + if (element) element.classList.remove('hidden'); + return true; +}; + +export const hideDiv = (id) => { + const element = document.getElementById(id); + if (element) element.classList.add('hidden'); + return true; +}; + + +export const showAlertModal = (text) => { + showDiv('overlay'); + render(html` + <div class="modal"> + <div class="modal-alert"> + <div clas="modal-text">${text}</div> + <div class="dismiss" @click=${hideOverlay}>OK</div> + </div> + </div> + `, ElementById('overlay'));y +}; + +export const showModal = (title, content) => { + showDiv('overlay'); + render(html` + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <div class="modal-close" @click=${hideOverlay}></div> + <h4 class="modal-title">${title}</h4> + </div> + <div class="modal-body">${content}</div> + </div> + </div> + `, ElementById('overlay')); +}; + +export const showLoader = () => { + render(html` + <div class="loading"> + <div class="spinner"></div> + </div> + `, document.getElementById('overlay')); + showDiv('overlay'); + return true; +}; + +export const hideOverlay = () => hideDiv('overlay'); + +export const registerLoaderOnLinks = () => { + let elements = document.getElementsByTagName("a"); + + for (let i = 0, element; element = elements[i]; i++) { + element.addEventListener('click', (e) => { + e.preventDefault(); + let target = e.target || e.srcElement; + window.location = target.getAttribute("href") + showLoader(); + }, false); + } +}+ \ No newline at end of file
diff --git a/assets/js/journey.js b/assets/js/journey.js @@ -0,0 +1,9 @@ +'use strict'; + +import { registerLoaderOnLinks, showLoader, hideOverlay } from './helpers.js'; + +registerLoaderOnLinks(); + +window.onbeforeunload = function(e) { + hideOverlay(); +}+ \ No newline at end of file
diff --git a/assets/js/journeys.js b/assets/js/journeys.js @@ -0,0 +1,27 @@ +'use strict'; + +import { registerLoaderOnLinks, showLoader, hideOverlay } from './helpers.js'; +import { html, render } from './lit-html.js'; + +export const go = (url) => { + window.location = url; + showLoader(); +} + +const registerTableEvents = () => { + let table = document.getElementsByTagName("table")[0]; + + for (let i = 1, row; row = table.rows[i]; i++) { + const link = row.dataset.link; + + row.classList.add('pointer'); + row.addEventListener('click', () => go(link)); + } +} + +registerTableEvents(); +registerLoaderOnLinks(); + +window.onbeforeunload = function(e) { + hideOverlay(); +}+ \ No newline at end of file
diff --git a/assets/js/lit-html.js b/assets/js/lit-html.js @@ -0,0 +1 @@ +const t=new WeakMap,e=e=>(...s)=>{const n=e(...s);return t.set(n,!0),n},s=e=>"function"==typeof e&&t.has(e),n=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,s=null,n=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.insertBefore(i,n),i=e}},o=(t,e,s=null)=>{let n=e;for(;n!==s;){const e=n.nextSibling;t.removeChild(n),n=e}},r={},l=`{{lit-${String(Math.random()).slice(2)}}}`,a=`\x3c!--${l}--\x3e`,h=new RegExp(`${l}|${a}`),c=(()=>{const t=document.createElement("div");return t.setAttribute("style","{{bad value}}"),"{{bad value}}"!==t.getAttribute("style")})();class d{constructor(t,e){this.parts=[],this.element=e;let s=-1,n=0;const i=[],o=e=>{const r=e.content,a=document.createTreeWalker(r,133,null,!1);let d,u;for(;a.nextNode();){s++,d=u;const e=u=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const i=e.attributes;let o=0;for(let t=0;t<i.length;t++)i[t].value.indexOf(l)>=0&&o++;for(;o-- >0;){const i=t.strings[n],o=m.exec(i)[2],r=c&&"style"===o?"style$":/^[a-zA-Z-]*$/.test(o)?o:o.toLowerCase(),l=e.getAttribute(r).split(h);this.parts.push({type:"attribute",index:s,name:o,strings:l}),e.removeAttribute(r),n+=l.length-1}}"TEMPLATE"===e.tagName&&o(e)}else if(3===e.nodeType){const t=e.nodeValue;if(t.indexOf(l)<0)continue;const o=e.parentNode,r=t.split(h),a=r.length-1;n+=a;for(let t=0;t<a;t++)o.insertBefore(""===r[t]?p():document.createTextNode(r[t]),e),this.parts.push({type:"node",index:s++});o.insertBefore(""===r[a]?p():document.createTextNode(r[a]),e),i.push(e)}else if(8===e.nodeType)if(e.nodeValue===l){const t=e.parentNode,o=e.previousSibling;null===o||o!==d||o.nodeType!==Node.TEXT_NODE?t.insertBefore(p(),e):s--,this.parts.push({type:"node",index:s++}),i.push(e),null===e.nextSibling?t.insertBefore(p(),e):s--,u=d,n++}else{let t=-1;for(;-1!==(t=e.nodeValue.indexOf(l,t+1));)this.parts.push({type:"node",index:-1})}}};o(e);for(const t of i)t.parentNode.removeChild(t)}}const u=t=>-1!==t.index,p=()=>document.createComment(""),m=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class g{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=n?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const o=t=>{const n=document.createTreeWalker(t,133,null,!1);let r=n.nextNode();for(;s<e.length&&null!==r;){const t=e[s];if(u(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(r),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(r,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===r.nodeName&&o(r.content),r=n.nextNode();else this._parts.push(void 0),s++}};return o(t),n&&(document.adoptNode(t),customElements.upgrade(t)),t}}class v{constructor(t,e,s,n){this.strings=t,this.values=e,this.type=s,this.processor=n}getHTML(){const t=this.strings.length-1;let e="",s=!0;for(let n=0;n<t;n++){const t=this.strings[n];e+=t;const i=t.lastIndexOf(">");!(s=(i>-1||s)&&-1===t.indexOf("<",i+1))&&c&&(e=e.replace(m,(t,e,s,n)=>"style"===s?`${e}style$${n}`:t)),e+=s?a:l}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}class f extends v{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,s=e.firstChild;return e.removeChild(s),i(e,s.firstChild),t}}const x=t=>null===t||!("object"==typeof t||"function"==typeof t);class _{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new y(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let n=0;n<e;n++){s+=t[n];const e=this.parts[n];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class y{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===r||x(t)&&t===this.value||(this.value=t,s(t)||(this.committer.dirty=!0))}commit(){for(;s(this.value);){const t=this.value;this.value=r,t(this)}this.value!==r&&this.committer.commit()}}class N{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(p()),this.endNode=t.appendChild(p())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=p()),t._insert(this.endNode=p())}insertAfterPart(t){t._insert(this.startNode=p()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}const t=this._pendingValue;t!==r&&(x(t)?t!==this.value&&this._commitText(t):t instanceof v?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):void 0!==t.then?this._commitPromise(t):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&e.nodeType===Node.TEXT_NODE?e.textContent=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value&&this.value.template===e)this.value.update(t.values);else{const s=new g(e,t.processor,this.options),n=s._clone();s.update(t.values),this._commitNode(n),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,n=0;for(const i of t)void 0===(s=e[n])&&(s=new N(this.options),e.push(s),0===n?s.appendIntoPart(this):s.insertAfterPart(e[n-1])),s.setValue(i),s.commit(),n++;n<e.length&&(e.length=n,this.clear(s&&s.endNode))}_commitPromise(t){this.value=t,t.then(e=>{this.value===t&&(this.setValue(e),this.commit())})}clear(t=this.startNode){o(this.startNode.parentNode,t.nextSibling,this.endNode)}}class V{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}if(this._pendingValue===r)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=r}}class T extends _{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new b(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class b extends y{}let E=!1;try{const t={get capture(){return E=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class w{constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=(t=>this.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;s(this._pendingValue);){const t=this._pendingValue;this._pendingValue=r,t(this)}if(this._pendingValue===r)return;const t=this._pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),this._options=A(t),i&&this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options),this.value=t,this._pendingValue=r}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const A=t=>t&&(E?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);class S{handleAttributeExpressions(t,e,s,n){const i=e[0];if("."===i){return new T(t,e.slice(1),s).parts}return"@"===i?[new w(t,e.slice(1),n.eventContext)]:"?"===i?[new V(t,e.slice(1),s)]:new _(t,e,s).parts}handleTextExpression(t){return new N(t)}}const C=new S;function M(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const n=t.strings.join(l);return void 0===(s=e.keyString.get(n))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(n,s)),e.stringsArray.set(t.strings,s),s}const L=new Map,P=new WeakMap,$=(t,e,s)=>{let n=P.get(e);void 0===n&&(o(e,e.firstChild),P.set(e,n=new N(Object.assign({templateFactory:M},s))),n.appendInto(e)),n.setValue(t),n.commit()},k=(t,...e)=>new v(t,e,"html",C),H=(t,...e)=>new f(t,e,"svg",C);export{k as html,H as svg,S as DefaultTemplateProcessor,C as defaultTemplateProcessor,e as directive,s as isDirective,o as removeNodes,i as reparentNodes,r as noChange,_ as AttributeCommitter,y as AttributePart,V as BooleanAttributePart,w as EventPart,x as isPrimitive,N as NodePart,T as PropertyCommitter,b as PropertyPart,P as parts,$ as render,L as templateCaches,M as templateFactory,g as TemplateInstance,f as SVGTemplateResult,v as TemplateResult,p as createMarker,u as isTemplatePartActive,d as Template};
diff --git a/assets/js/search.js b/assets/js/search.js @@ -0,0 +1,106 @@ +'use strict'; + +import { registerLoaderOnLinks, ElementById, showDiv, hideDiv, showLoader, showModal, showAlertModal, hideOverlay } from './helpers.js'; +import { html, render } from './lit-html.js'; + + +export const loadSuggestions = async (mode) => { + const result = await fetch('/suggestions?query=' + encodeURI(document.getElementById(mode).value)).then(resp => resp.json()); + + if (result.status !== "success") return false; + + render(html` + <div class="suggestionsbox" @mouseover=${() => mouseOverSuggestions(mode)} @mouseout=${() => stopMouseOverSuggestions(mode)}> + ${result.data.map(element => html` + <p class="suggestion" @click=${() => setSuggestion(mode, element)}>${element}</p> + `)}</div>`, ElementById(mode + 'Suggestions')); +}; + +export const setSuggestion = (mode, value) => { + ElementById(mode).value = value; + ElementById(mode + 'Suggestions').classList.remove('mouseover'); + ElementById(mode + 'Suggestions').classList.remove('typing'); + + if (mode !== 'to') { + ElementById('to').focus(); + } +}; + +const startTyping = (mode) => { + ElementById(mode + 'Suggestions').classList.add('typing'); + ElementById(mode + 'Suggestions').classList.remove('mouseover'); +}; + +const stopTyping = (mode) => { + ElementById(mode + 'Suggestions').classList.remove('typing'); +}; + +export const mouseOverSuggestions = (mode) => { + ElementById(mode + 'Suggestions').classList.add('mouseover'); +}; + +export const stopMouseOverSuggestions = (mode) => { + ElementById(mode + 'Suggestions').classList.remove('mouseover'); +}; + +const onKeypress = (e, mode) => { + if (e.keyCode == 13) { // enter + document.querySelector(`#${mode}Suggestions>.suggestionsbox>:first-child`).click(); + if (mode === 'to') { + if (ElementById("from").value !== "" && ElementById("to").value !== "") { + ElementById('go').click(); + showLoader(); + } + } + e.preventDefault(); + return false; + } + return true; +}; + +const swapFromTo = () => { + + let from = ElementById('from'); + let to = ElementById('to'); + + from.value = [to.value, to.value = from.value][0]; +}; + + +const registerSearchInput = (id) => { + const el = ElementById(id); + el.addEventListener('keyup', () => loadSuggestions(id)); + el.addEventListener('focus', () => startTyping(id)); + el.addEventListener('blur', () => stopTyping(id)); + el.addEventListener('keypress', (evt) => onKeypress(evt, id)); +}; + +const registerSwapButton = () => { + const el = ElementById('btn-swap'); + el.classList.remove('hidden'); + el.addEventListener('click', () => swapFromTo()); +} + +const registerHistoryButton = () => { + /*const el = ElementById('btn-history'); + el.classList.remove('hidden'); + el.addEventListener('click', () => showModal("History", html` + `));*/ +} + + +registerSearchInput('from'); +registerSearchInput('to'); + +registerSwapButton(); +registerLoaderOnLinks(); + +ElementById('go').addEventListener('click', () => { + if (ElementById("from").value !== "" && ElementById("to").value !== "") { + showLoader(); + } +}); + +window.onbeforeunload = function(e) { + hideOverlay(); +}
diff --git a/assets/manifest.json b/assets/manifest.json @@ -0,0 +1,21 @@ +{ + "name": "Öffisearch", + "short_name": "Öffisearch", + "start_url": ".", + "icons": [ + { + "src": "/favicon-64x64.png", + "sizes": "64x64", + "type": "image/png" + }, + { + "src": "/favicon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} +
diff --git a/assets/style.css b/assets/style.css @@ -0,0 +1,813 @@ +font-face { + font-family: 'varelaregular'; + src: url('./varela-regular-webfont.woff2') format('woff2'), + url('./varela-regular-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} + +a { + color: inherit; +} +html, body { + margin: 0; + font-family: Varela, sans-serif; + background-color: #17212e; + min-height: 100vh; + overflow-x: hidden; + overflow-y: visible; +} + +* { + box-sizing: border-box; + border-collapse: collapse; +} + +header { + position: relative; + box-shadow: 0 0 15px rgba(0, 0, 0, .6); + color: white; + padding: 0 0 0 9vw; + background-color: #43a007; +} + +.row { + display: flex; + flex-direction: row; +} + +.cancelled { + text-decoration-line: line-through; +} +.cancelled-text { + font-weight: bold; + color: red; +} + +.pointer { + cursor: pointer; +} + +.back { + cursor: pointer; + position: absolute; + left: 17px; + top: 17px; + width: 32px; + height: 32px; + content: url('data:image/svg+xml;utf8,<svg height="100%" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g color="white"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" fill="currentColor"></path></g></svg>'); + user-select: none; +} + +.reload { + cursor: pointer; + position: absolute; + right: 17px; + top: 17px; + width: 32px; + height: 32px; + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); + user-select: none; +} + +.spinner { + margin: calc(50vh - 60px) auto; + border: 2px solid rgba(255, 255, 255, .7); /* Light grey */ + border-top: 4px solid #3498db; /* Blue */ + border-radius: 50%; + width: 120px; + height: 120px; + animation: spin 2s linear infinite; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +label[for=btn-history] { + cursor: pointer; + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); + border-radius: 100%; + height: 48px; + width: 48px; + background-color: #eee; + margin: .5em auto; + transition: box-shadow 150ms; + border: 1px solid rgba(0, 0, 0, .1); + user-select: none; +} + +:checked ~ label[for=btn-history] { + transform: rotate(180deg); +} + +.loadMore { + cursor: pointer; + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); + border-radius: 100%; + height: 48px; + width: 48px; + background-color: #eee; + margin: 0 auto; + transition: box-shadow 150ms; + border: 1px solid rgba(0, 0, 0, .1); + user-select: none; +} + +.loadMore:hover { + box-shadow: 0 1px 5px 0 rgba(0, 0, 0, .3); +} + +.loadMore.flipped { + transform: rotate(180deg); + margin-top: 15px; +} + +table { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + width: 100%; +} + +table, tr { + background-color: #fff; + margin: 0 0 15px 0; +} + +td, th { + text-align: center; + overflow: hidden; +} + +th { + padding: 5px 3px; +} + + +tr:nth-child(odd) { + background-color: #f2f2f2; +} + + +tbody tr:hover { + background-color: #ddd; +} + +tbody tr:hover td { + background-color: transparent; +} + +@supports (display: flex) { + button, + input[type="date"], + input[type="time"], + input[type="text"], + .switch { + cursor: pointer; + box-sizing: border-box; + width: 100%; + padding: .3em .5em; + border-radius: 3px; + font-size: 1.5em; + padding: 7px; + border: none; + outline: none; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + background-color: white; + color: black; + margin-top: 8px; + } + + input[type="text"]:focus { + border-radius: 3px 3px 0px 0px; + } + + .btn, + .selector label { + cursor: pointer; + background-color: white; + width: 32px; + padding: 3px; + height: 32px; + display: inline-block; + border-right: 1px solid rgba(0, 0, 0, .2); + user-select: none; + } + + .selector { + margin-top: 8px; + margin-bottom: 8px; + margin-right: auto; + display: flex; + border-radius: 3px; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + overflow: hidden; + } + + .selector > label { + width: 32px; + height: 32px; + user-select: none; + } + + .selector > input { + display: none; + } + + input[id=national] + label[for=national] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 15.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V5c0-3.5-3.58-4-8-4s-8 .5-8 4v10.5zm8 1.5c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-7H6V5h12v5z"/></svg>'); + background: #d3d3d3; + } + + input[id=national]:checked + label[for=national] { + background: #fff; + } + + + input[id=regional] + label[for=regional] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/><path d="M0 0h24v24H0V0z" fill="none"/></svg>'); + background: #d3d3d3; + } + + input[id=regional]:checked + label[for=regional] { + background: #fff; + } + + + input[id=suburban] + label[for=suburban] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/><path d="M0 0h24v24H0V0z" fill="none"/></svg>'); + background: #d3d3d3; + } + + input[id=suburban]:checked + label[for=suburban] { + background: #fff; + } + + + input[id=subway] + label[for=subway] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0v24h24V0H0zm22 22H2V8.86C2 6.05 3.53 3.84 6.2 2.8 8 2.09 10.14 2 12 2c1.86 0 4 .09 5.8.8C20.47 3.84 22 6.05 22 8.86V22z" fill="none"/><circle cx="15.5" cy="16" r="1"/><circle cx="8.5" cy="16" r="1"/><path d="M7.01 9h10v5h-10zM17.8 2.8C16 2.09 13.86 2 12 2c-1.86 0-4 .09-5.8.8C3.53 3.84 2 6.05 2 8.86V22h20V8.86c0-2.81-1.53-5.02-4.2-6.06zm.2 13.08c0 1.45-1.18 2.62-2.63 2.62l1.13 1.12V20H15l-1.5-1.5h-2.83L9.17 20H7.5v-.38l1.12-1.12C7.18 18.5 6 17.32 6 15.88V9c0-2.63 3-3 6-3 3.32 0 6 .38 6 3v6.88z"/></svg>'); + background: #d3d3d3; + } + + input[id=subway]:checked + label[for=subway] { + background: #fff; + } + + + input[id=tram] + label[for=tram] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M19 16.94V8.5c0-2.79-2.61-3.4-6.01-3.49l.76-1.51H17V2H7v1.5h4.75l-.76 1.52C7.86 5.11 5 5.73 5 8.5v8.44c0 1.45 1.19 2.66 2.59 2.97L6 21.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 20h-.08c1.69 0 2.58-1.37 2.58-3.06zm-7 1.56c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm5-4.5H7V9h10v5z"/><path d="M0 0h24v24H0V0z" fill="none"/></svg>'); + background: #d3d3d3; + } + + input[id=tram]:checked + label[for=tram] { + background: #fff; + } + + + input[id=bus] + label[for=bus] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 16c0 .88.39 1.67 1 2.22V20c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22V6c0-3.5-3.58-4-8-4s-8 .5-8 4v10zm3.5 1c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm1.5-6H6V6h12v5z"/></svg>'); + background: #d3d3d3; + } + + input[id=bus]:checked + label[for=bus] { + background: #fff; + } + + + input[id=ferry] + label[for=ferry] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 21c-1.39 0-2.78-.47-4-1.32-2.44 1.71-5.56 1.71-8 0C6.78 20.53 5.39 21 4 21H2v2h2c1.38 0 2.74-.35 4-.99 2.52 1.29 5.48 1.29 8 0 1.26.65 2.62.99 4 .99h2v-2h-2zM3.95 19H4c1.6 0 3.02-.88 4-2 .98 1.12 2.4 2 4 2s3.02-.88 4-2c.98 1.12 2.4 2 4 2h.05l1.89-6.68c.08-.26.06-.54-.06-.78s-.34-.42-.6-.5L20 10.62V6c0-1.1-.9-2-2-2h-3V1H9v3H6c-1.1 0-2 .9-2 2v4.62l-1.29.42c-.26.08-.48.26-.6.5s-.15.52-.06.78L3.95 19zM6 6h12v3.97L12 8 6 9.97V6z"/></svg>'); + background: #d3d3d3; + } + + input[id=ferry]:checked + label[for=ferry] { + background: #fff; + } + + + input[id=taxi] + label[for=taxi] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5H15V3H9v2H6.5c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z"/></svg>'); + background: #d3d3d3; + } + + input[id=taxi]:checked + label[for=taxi] { + background: #fff; + } + + + + input[id=accessibilityNone] + label[for=accessibilityNone] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z"/></svg>'); + background: #d3d3d3; + } + + input[id=accessibilityNone]:checked + label[for=accessibilityNone] { + background: #fff; + } + + + input[id=accessibilityPartial] + label[for=accessibilityPartial] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6l1.8-.7"/></svg>'); + background: #d3d3d3; + } + + input[id=accessibilityPartial]:checked + label[for=accessibilityPartial] { + background: #fff; + } + + + input[id=accessibilityComplete] + label[for=accessibilityComplete] { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="4" r="2"/><path d="M19 13v-2c-1.54.02-3.09-.75-4.07-1.83l-1.29-1.43c-.17-.19-.38-.34-.61-.45-.01 0-.01-.01-.02-.01H13c-.35-.2-.75-.3-1.19-.26C10.76 7.11 10 8.04 10 9.09V15c0 1.1.9 2 2 2h5v5h2v-5.5c0-1.1-.9-2-2-2h-3v-3.45c1.29 1.07 3.25 1.94 5 1.95zm-6.17 5c-.41 1.16-1.52 2-2.83 2-1.66 0-3-1.34-3-3 0-1.31.84-2.41 2-2.83V12.1c-2.28.46-4 2.48-4 4.9 0 2.76 2.24 5 5 5 2.42 0 4.44-1.72 4.9-4h-2.07z"/></svg>'); + background: #d3d3d3; + } + + input[id=accessibilityComplete]:checked + label[for=accessibilityComplete] { + background: #fff; + } + + .switch { + position: relative; + display: inline-block; + width: 84px; + padding: 0 !important; + overflow: hidden; + flex-shrink: 0; + } + + .switch input { + opacity: 0; + width: 0; + height: 0; + } + + .switch input:active, + .switch input:focus { + box-shadow: 0 .1em .5em rgba(0, 0, 0, .6); + } + + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #bbb; + height: 100%; + } + + .slider:before { + position: absolute; + font-size: 13px; + padding-top: calc(25% - 7px); + line-height: 100%; + text-align: center; + height: 100%; + width: 42px; + background-color: white; + transition: .2s; + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + } + + .switch input:checked + .slider:before { + transform: translateX(42px); + } + + .slider.de:before { + content: "AB"; + } + + .switch input:checked + .slider.de:before { + content: "AN"; + } + + .slider.en:before { + content: "DEP"; + } + + .switch input:checked + .slider.en:before { + content: "ARR"; + } +} + +.journey, +.journeys { + display: flex; + flex-direction: column; +} + +.search { + color: white; + display: flex; + flex-direction: column; +} + +.search table { + width: 100%; + color: black; +} + +.search #date { + flex-grow: 1; + margin-left: 8px; +} + +.search>.title { + display: flex; + justify-content: center; + align-items: center; +} + +.search>.title>h1 { + font-weight: normal; + margin-left: .5em; + text-shadow: 0 .05em .1em rgba(0, 0, 0, .5); + margin: .7em .3em .5em .3em; +} + +@supports (display: flex) { + .search>.title>.logo { + box-shadow: 0 .1em .2em rgba(0, 0, 0, .5); + background-color: #7171e5; + border-radius: 15%; + width: 50px; + height: 50px; + margin: 0; + padding: 5px 5px 2px 6px; + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>') + } +} + +.search .btn.history { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'); +} + +.search .btn.swap { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); +} + +.search .btn.go { + font-size: 1.5em; + margin-left: 5px; + display: flex; + justify-content: center; + width: 110px; + font-size: 20px; +} + +.search .btn.go label { + cursor: pointer; +} + +.search .btn.go svg { + margin-left: 5px; + fill: #5050ff; +} + + + +.journeys { + min-height: 100vh; +} + +.journeys table { + margin: 15px auto; +} + +.journeys table a, +.journey table a, +.journey table span { + padding: 5px 3px; + display: flex; + justify-content: center; + width: 100%; + text-decoration: none; + color: black; +} + +.journeys a.details-button { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/><path d="M0 0h24v24 H0z" fill="none"/></svg>'); + height: 30px; + padding: 0; +} + +.journey tbody td:nth-child(3) { + text-align: left; +} + +.journey tbody:not(:last-child) { + border-bottom: 1px solid rgba(0, 0, 0, .2); +} + +.journey p { + color: white; + width: 100%; +} + +.journey p::before { + filter: drop-shadow( 0 0 5px rgba(0, 0, 0, .6) ); + margin-right: 4px; + vertical-align: sub; +} + +.journey p.change, +.journey p.walk, +.journey p.transfer { + text-shadow: 0 0 15px rgba(0, 0, 0, .6); + text-align: center; +} + +.journey p.change::before { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); +} + +.journey p.walk::before { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path style="fill: white;" d="M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6l1.8-.7"/></svg>'); +} + +.journey p.transfer::before { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path style="fill: white;" d="M21.71 11.29l-9-9c-.39-.39-1.02-.39-1.41 0l-9 9c-.39.39-.39 1.02 0 1.41l9 9c.39.39 1.02.39 1.41 0l9-9c.39-.38.39-1.01 0-1.41zM14 14.5V12h-4v3H8v-4c0-.55.45-1 1-1h5V7.5l3.5 3.5-3.5 3.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); +} + + +.suggestionsbox { + border-radius: 3px; + width: 100%; + box-shadow: 0 .4em .8em rgba(0, 0, 0, .5); +} + +.suggestionsbox p:first-child { + border-top: 0px; +} + +.suggestionsbox p { + font-size: 1.2em; + background-color: white; + color: black; + margin: 0; + border-top: 1px solid rgba(0, 0, 0, .2); + padding: .3em .6em; + cursor: pointer; +} + +.suggestions { + position: relative; + display: none; + overflow: visible; + z-index: 999; + height: 0; +} + +.suggestions.typing, +.suggestions.mouseover { + display: block; +} + + + +@media (max-width: 799px) { + .search { + padding: 10px; + } + + header { + padding: 0 0 0 50px; + } + + .back { + left: 10px; + } + + .row { + flex-wrap: wrap; + } + + .search #date { + width: initial; + } + + .search #time { + width: 100%; + flex-shrink: 0; + } +} + +@media (min-width: 800px) { + .center { + display: flex; + justify-content: center; + align-items: center; + } + + .search { + width: 80vw; + max-width: 700px; + color: white; + } + + .search #date { + margin-right: 8px; + } + + .search #time { + width: 40%; + } + + header { + padding: 0 10vw; + } + + td p { + display: inline; + margin-right: 5px; + } + + th { + padding: 10px 5px; + } + .journeys table a { + padding: 10px 5px; + } + + table { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .4); + border-radius: 5px; + overflow: hidden; + border: none; + margin: 50px auto; + width: 80vw; + } +} + +@supports (display: flex) { + .hidden { + display: none !important; + } + + label[for=from], label[for=to], label[for=isarr], label[for="date"], label[for=time] { + display: none; + } +} + +#overlay { + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0,0,0,0.4); +} + + +.modal { + display: flex; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} + +.modal-alert { + margin: auto; + border-radius: 4px; + background-color: white; + width: fit-content; + width: -moz-fit-content; + padding: 15px; + box-shadow: 0 1px 4px rgba(0, 0, 0, .6); +} + +.dismiss { + content: 'OK'; + border-radius: 4px; + background-color: rgba(20, 30, 255, .7); + color: white; + width: fit-content; + width: -moz-fit-content; + padding: 8px 20px; + margin-left: auto; + margin-top: 10px; + transition: background-color 300ms; +} + +.dismiss:hover { + background-color: rgba(70, 100, 255, .8); + cursor: pointer; +} + +.modal-header { + background-color: #43a047; + color: white; + border-radius: 6px 6px 0px 0px; + min-height: 16.4; + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} + +.modal-header .close { + margin-top: -2px; +} + +.modal-header .modal-close { + width:53px; + float:right; + margin:-15px; + margin-left:0px; + height:53px; + border-left: 1px solid #00000040; + + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAABO0lEQVR42u3bURKDIAwEUNiLoyfXC3Ss4mYTh81Xv4R90wqEad+2ra1caIuXAQxgAAMYwAAGMIABDGAAA0zVGOMYYxzqibPGxdtJ/PqsCM8aF4xJKBHY40IxwcrPngbY970rJ3r1zKu5hH4DVAhR4Sk/gWiEyPC0d0AUQnR46kuQjaAIT18FWAiq8CHL4FsEZfiws8Asgjp86GHoKUJG+PDT4F2ErPCttdYVd4OzS2F0eFk/YCaIIry0IfIkkCq8FOBuMGV4OUDFkgK83Qh9GoC1Ff4kAPsw9CmAf5scdWdJCnB3h5eJgOzw2QioED4TAVXCZyGgUvgMBFQLr0ZAxfBKBFQNr0JA5fAKBFQPH40gbYtXfDb1dljRzGCPS7sdVnZymON2/2Nk8TKAAQxgAAMYwAAGMIABDLBmnWRS+u5G6HkFAAAAAElFTkSuQmCC') center no-repeat; + background-size:30px; + cursor:pointer; +} + +.modal-header .modal-close:hover { + border-radius: 0px 6px 0px 0px; +} + +.modal-title { + margin: 0; + line-height: 1.4; +} + +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} + +.modal-content { + position: relative; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} + +.modal-body { + position: relative; +} + +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + + .modal-content { + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } +} + +.row.history:first-child { + border-top: 0px; +} + +form>div.history { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .4); + border-radius: 5px; + overflow: hidden; + display: none; + margin-bottom: 1em; +} +:checked ~ .history { + display: block; +} +.row.history { + font-size: 1.2em; + background-color: white; + color: black; + margin: 0; + border-top: 1px solid rgba(0, 0, 0, .2); + padding: .3em .6em .3em .3em; + cursor: pointer; + + display: flex; + justify-content: space-between; +} + +.history.from, +.history.to { + width: 40%; +} +.history.to { + text-align: right; +} + +.history.arrow { + content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/><path d="M0 0h24v24 H0z" fill="none"/></svg>'); + width: 25px; +} + +.station-column { + style="width: 60%;" +}
diff --git a/assets/varela-regular-webfont.woff b/assets/varela-regular-webfont.woff Binary files differ.
diff --git a/assets/varela-regular-webfont.woff2 b/assets/varela-regular-webfont.woff2 Binary files differ.
diff --git a/ds100.js b/ds100.js @@ -0,0 +1,22 @@ +const stations = require('db-stations') +const fs = require('fs'); + +var ds100list = {}; +var ds100reverseList = {}; + +stations.full() +.on('data',function(station){ + var stuff = []; + station.ril100Identifiers.forEach(element => { + stuff.push(element.rilIdentifier) + ds100list[element.rilIdentifier] = station.id; + }) + + if (stuff.length === 0) return; + + ds100list[station.id] = stuff.join(', '); +}) +.on('end',function(){ + fs.writeFile("ds100.json", JSON.stringify(ds100list), () => {}) + fs.writeFile("ds100reverse.json", JSON.stringify(ds100reverseList), () => {})a +});
diff --git a/oeffisearch.nimble b/oeffisearch.nimble @@ -0,0 +1,12 @@ +# Package +version = "0.1.0" +author = "ctucx, petabyteboy" +description = "oeffisearch: public transport in your browser " +license = "AGPL-3.0" +srcDir = "src" +bin = @["oeffisearch_nojs", "oeffisearch"] + + + +# Dependencies +requires "nim >= 1.0.4"
diff --git a/src/asyncWebServer.nim b/src/asyncWebServer.nim @@ -0,0 +1,214 @@ +import asyncdispatch, asynchttpserver, macros +import strutils, parseutils +import cookies, uri, times, os, re, json +import tables + +export asyncdispatch, asynchttpserver, cookies, uri +export strutils, re +export tables, json + + +type + ServerRef* = ref object + port*: uint16 + address*: string + server*: AsyncHttpServer + +proc newServer* (address: string = "0.0.0.0", port: uint16 = 5000): ServerRef = + return ServerRef( + address: address, + port: port, + server: newAsyncHttpServer() + ) + +proc cookies*(req: Request): Table[string, string] = + result = initTable[string, string]() + + if (let cookie = req.headers.getOrDefault("Cookie"); cookie != ""): + var i = 0 + while true: + i += skipWhile(cookie, {' ', '\t'}, i) + var keystart = i + i += skipUntil(cookie, {'='}, i) + var keyend = i-1 + if i >= len(cookie): break + inc(i) # skip '=' + var valstart = i + i += skipUntil(cookie, {';'}, i) + result[substr(cookie, keystart, keyend)] = substr(cookie, valstart, i-1) + if i >= len(cookie): break + inc(i) # skip ';' + +proc parseQuery*(data: string): Table[string, string] = + result = initTable[string, string]() + + let data = data.split("&") + for i in data: + let timed = i.split("=") + if timed.len > 1: + result.add(decodeUrl(timed[0]), decodeUrl(timed[1])) + +proc daysForward*(days: int): DateTime = + return getTime().utc + initTimeInterval(days = days) + +template setCookie* (key: string, value: string, time: DateTime) = + headers.add("Set-Cookie", setCookie(key, value, time, request.headers["host"], noName=true)) + +proc redirect* (request: Request, url: string) {.async.}= + await request.respond(Http303, "", newHttpHeaders([("Location", url)])) + +proc respondJson* (request: Request, httpCode: HttpCode, status: string, message: string, data: JsonNode) {.async.} = + let response = %* { + "status": status, + "msg": message, + "data": data + } + + await request.respond(httpCode, $response, newHttpHeaders([("Content-Type","application/json")])) + +macro pages*(server: ServerRef, body: untyped): untyped = + ## This macro provides convenient page adding. + ## + ## `body` should be StmtList. + ## page type can be: + ## - ``equals`` + ## - ``startsWith`` + ## - ``endsWith`` + ## - ``regex`` + ## - ``notfound`` - this page uses without URL argument. + ## + ## When a new request to the server is received, variables are automatically created: + ## - ``request`` - new Request. + ## - ``url`` - matched URL. + ## - ``equals`` - URL is request.url.path + ## - ``startsWith`` - URL is text after `startswith`. + ## - ``endsWith`` - URL is text before `endswith`. + ## - ``regex`` - `url` param not created. + ## - ``notfound`` - `url` param not created. + ## - ``decoded_url`` - URL always is request.url.path + var + stmtlist = newStmtList() + notfound_declaration = false + + stmtlist.add( + newNimNode(nnkLetSection).add( # let urlParams: JsonNode = await parseQuery(request) + newNimNode(nnkIdentDefs).add( # let decode_url: string = decodeUrl(request.url.path) + ident("decoded_url"), + ident("string"), + newCall( + "decodeUrl", + newNimNode(nnkDotExpr).add( + newNimNode(nnkDotExpr).add( + ident("request"), ident("url") + ), + ident("path") + ) + ) + ) + ) + ) + stmtlist.add(newNimNode(nnkIfStmt)) + var ifstmtlist = stmtlist[1] + + for i in body: # for each page in statment list. + let + current = if i.len == 3: $i[0] else: "equals" + path = if i.len == 3: i[1] else: i[0] + slist = if i.len == 3: i[2] else: i[1] + if (i.kind == nnkCall and + (path.kind == nnkStrLit or path.kind == nnkCallStrLit or path.kind == nnkEmpty) and + slist.kind == nnkStmtList): + if current == "equals": + slist.insert(0, # let url: string = `path` + newNimNode(nnkLetSection).add( + newNimNode(nnkIdentDefs).add( + ident("url"), ident("string"), path + ) + ) + ) + ifstmtlist.add( # decoded_url == `path` + newNimNode(nnkElifBranch).add( + newCall("==", path, ident("decoded_url")), + slist + ) + ) + elif current == "startsWith": + slist.insert(0, # let url = decoded_url[`path`.len..^1] + newNimNode(nnkLetSection).add( + newNimNode(nnkIdentDefs).add( + ident("url"), + ident("string"), + newCall( + "[]", + ident("decoded_url"), + newCall("..^", newCall("len", path), newLit(1)) + ) + ) + ) + ) + ifstmtlist.add( # decode_url.startsWith(`path`) + newNimNode(nnkElifBranch).add( + newCall("startsWith", ident("decoded_url"), path), + slist + ) + ) + elif current == "endsWith": + slist.insert(0, # let url: string = decoded_url[0..^`path`.len] + newNimNode(nnkLetSection).add( + newNimNode(nnkIdentDefs).add( + ident("url"), + ident("string"), + newCall( + "[]", + ident("decoded_url"), + newCall( + "..^", newLit(0), newCall("+", newLit(1), newCall("len", path)) + ) + ) + ) + ) + ) + ifstmtlist.add( # decode_url.endsWith(`path`) + newNimNode(nnkElifBranch).add( + newCall("endsWith", ident("decoded_url"), path), + slist + ) + ) + elif current == "regex": + ifstmtlist.add( # decode_url.match(`path`) + newNimNode(nnkElifBranch).add( + newCall("match", ident("decoded_url"), path), + slist)) + + ifstmtlist.add( + newNimNode(nnkElse).add( + newCall( # await request.respond(Http404, "Not found") + "await", + newCall("respond", ident("request"), ident("Http404"), newLit("Not found"), newCall("newHttpHeaders")) + ) + ) + ) + + result = newNimNode(nnkProcDef).add( + ident("receivepages"), # procedure name. + newEmptyNode(), # for template and macros + newEmptyNode(), # generics + newNimNode(nnkFormalParams).add( # proc params + newEmptyNode(), # return type + newNimNode(nnkIdentDefs).add( # param + ident("request"), # param name + ident("Request"), # param type + newEmptyNode() # param default value + ) + ), + newNimNode(nnkPragma).add( # pragma declaration + ident("async"), + ident("gcsafe") + ), + newEmptyNode(), + stmtlist) + +macro start*(server: ServerRef): untyped = + result = quote do: + echo "Server starts on http://", `server`.address, ":", `server`.port + waitFor `server`.server.serve(Port(`server`.port), receivepages, `server`.address)
diff --git a/src/backend/hafas.nim b/src/backend/hafas.nim @@ -0,0 +1,7 @@ +import hafas/api/journeys +import hafas/api/suggestions +import hafas/api/refresh_journey + +export journeys +export suggestions +export refresh_journey
diff --git a/src/backend/hafas/api/journeys.nim b/src/backend/hafas/api/journeys.nim @@ -0,0 +1,80 @@ +import ../parse/products +import ../parse/point +import ../parse/accessibility +import ../parse/journeys_response +import ../types +import ../util +import json +import times +import asyncdispatch +import options + +proc journeys*(params: JourneysParams): Future[JourneysResponse] {.async.} = + var `when` = now().toTime() + var isDeparture = true + if params.departure.isSome: + `when` = params.departure.get.fromUnix + elif params.arrival.isSome: + `when` = params.arrival.get.fromUnix + isDeparture = false + + let req = %* { + "cfg": { + "polyEnc": "GPA" + }, + "meth": "TripSearch", + "req": { + "ctxScr": nil, + "getPasslist": params.stopovers.get(false), + "maxChg": params.transfers.get(-1), + "minChgTime": params.transferTime.get(0), + "numF": params.results.get(5), + "depLocL": [ params.fromPoint.formatPoint() ], + "viaLocL": [], + "arrLocL": [ params.toPoint.formatPoint() ], + "jnyFltrL": [ + { + "type": "PROD", + "mode": "INC", + "value": $formatProducts(params.products.get(parseProducts(1023))), + }, + { + "type": "META", + "mode": "INC", + "meta": formatAccessibility(params.accessibility.get(Accessibility.none)), + } + ], + "gisFltrL": [], + "getTariff": params.tickets.get(true), + "ushrp": params.startWithWalking.get(true), + "getPT": true, + "getIV": false, + "getPolyline": params.polylines.get(false), + "outFrwd": isDeparture, + "outDate": `when`.format("yyyyMMdd"), + "outTime": `when`.format("HHmmss"), + "trfReq": { + "jnyCl": 2, + "tvlrProf": [ + { + "type": "E", + "redtnCard": nil + } + ], + "cType": "PK" + } + } + } + + if params.laterRef.isSome: + req["req"]["ctxScr"] = %* params.laterRef.get + elif params.earlierRef.isSome: + req["req"]["ctxScr"] = %* params.earlierRef.get + + if params.viaPoint.isSome: + let viaPoint = params.viaPoint.get + req["req"]["viaLocL"] = %* [{ "loc": viaPoint.formatPoint() }] + + let data = await request(req) + + return parseJourneysResponse(data)
diff --git a/src/backend/hafas/api/refresh_journey.nim b/src/backend/hafas/api/refresh_journey.nim @@ -0,0 +1,23 @@ +import ../types +import ../parse/journeys_response +import ../util +import json +import asyncdispatch +import options + +proc refreshJourney*(params: RefreshJourneyParams): Future[Journey] {.async.} = + let req = %* { + "cfg": { + }, + "meth": "Reconstruction", + "req": { + "ctxRecon": params.refreshToken, + "getIST": true, + "getPasslist": params.stopovers.get(false), + "getPolyline": params.polylines.get(false), + "getTariff": params.tickets.get(false), + } + } + + let data = await request(req) + return parseJourneysResponse(data, true).journeys[0]
diff --git a/src/backend/hafas/api/suggestions.nim b/src/backend/hafas/api/suggestions.nim @@ -0,0 +1,29 @@ +import ../../../types +import ../parse/point +import ../util +import json +import asyncdispatch +import sequtils +import options + +proc suggestions*(params: SuggestionsParams): Future[seq[Point]] {.async.} = + let req = %* { + "cfg": { + "polyEnc": "GPA" + }, + "meth": "LocMatch", + "req": { + "input": { + "loc": { + "type": "ALL", + "name": params.query & "?" + }, + "maxLoc": params.results.get(10), + "field": "S" + } + } + } + let data = await request(req) + let locs = data["res"]["match"]["locL"].getElems() + + return locs.map(parsePoint)
diff --git a/src/backend/hafas/errors.nim b/src/backend/hafas/errors.nim @@ -0,0 +1,199 @@ +import asynchttpserver +import ../../types + +proc parseError*(errstr: string): hafasException = + case errstr: + of "H_UNKNOWN": + return hafasException( + code: SERVER_ERROR, + message: "unknown internal error", + statusCode: Http500, + ) + of "AUTH": + return hafasException( + code: ACCESS_DENIED, + message: "invalid or missing authentication data", + statusCode: Http401, + ) + of "R0001": + return hafasException( + code: INVALID_REQUEST, + message: "unknown method", + statusCode: Http400, + ) + of "R0002": + return hafasException( + code: INVALID_REQUEST, + message: "invalid or missing request parameters", + statusCode: Http400, + ) + of "R0007": + return hafasException( + code: SERVER_ERROR, + message: "internal communication error", + statusCode: Http500, + ) + of "R5000": + return hafasException( + code: ACCESS_DENIED, + message: "access denied", + statusCode: Http401, + ) + of "S1": + return hafasException( + code: SERVER_ERROR, + message: "journeys search: a connection to the backend server couldn\'t be established", + statusCode: Http503, + ) + of "LOCATION": + return hafasException( + code: INVALID_REQUEST, + message: "location/stop not found", + statusCode: Http400, + ) + of "H390": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: departure/arrival station replaced", + statusCode: Http400, + ) + of "H410": + return hafasException( + code: SERVER_ERROR, + message: "journeys search: incomplete response due to timetable change" + ) + of "H455": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: prolonged stop", + statusCode: Http400, + ) + of "H460": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: stop(s) passed multiple times", + statusCode: Http400, + ) + of "H500": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: too many trains, connection is not complete", + statusCode: Http400, + ) + of "H890": + return hafasException( + code: NOT_FOUND, + message: "journeys search unsuccessful", + statusCode: Http404, + ) + of "H891": + return hafasException( + code: NOT_FOUND, + message: "journeys search: no route found, try with an intermediate stations", + statusCode: Http404, + ) + of "H892": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: query too complex, try less intermediate stations", + statusCode: Http400, + ) + of "H895": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: departure & arrival are too near", + statusCode: Http400, + ) + of "H899": + return hafasException( + code: SERVER_ERROR, + message: "journeys search unsuccessful or incomplete due to timetable change" + ) + of "H900": + return hafasException( + code: SERVER_ERROR, + message: "journeys search unsuccessful or incomplete due to timetable change" + ) + of "H9220": + return hafasException( + code: NOT_FOUND, + message: "journeys search: no stations found close to the address", + statusCode: Http400, + ) + of "H9230": + return hafasException( + code: SERVER_ERROR, + message: "journeys search: an internal error occured", + statusCode: Http500, + ) + of "H9240": + return hafasException( + code: NOT_FOUND, + message: "journeys search unsuccessful", + statusCode: Http404, + ) + of "H9250": + return hafasException( + code: SERVER_ERROR, + message: "journeys search: leg query interrupted", + statusCode: Http500, + ) + of "H9260": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: unknown departure station", + statusCode: Http400, + ) + of "H9280": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: unknown intermediate station", + statusCode: Http400, + ) + of "H9300": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: unknown arrival station", + statusCode: Http400, + ) + of "H9320": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: the input is incorrect or incomplete", + statusCode: Http400, + ) + of "H9360": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: error in a data field", + statusCode: Http400, + ) + of "H9380": + return hafasException( + code: INVALID_REQUEST, + message: "journeys search: departure/arrival/intermediate station defined more than once", + statusCode: Http400, + ) + of "SQ001": + return hafasException( + code: SERVER_ERROR, + message: "no departures/arrivals data available", + statusCode: Http503, + ) + of "SQ005": + return hafasException( + code: NOT_FOUND, + message: "no trips found", + statusCode: Http404, + ) + of "TI001": + return hafasException( + code: SERVER_ERROR, + message: "no trip info available", + statusCode: Http503, + ) + return hafasException( + code: SERVER_ERROR, + message: "unknown HAFAS exception " & errstr, + statusCode: Http500, + )
diff --git a/src/backend/hafas/parse/accessibility.nim b/src/backend/hafas/parse/accessibility.nim @@ -0,0 +1,6 @@ +import ../types + +proc formatAccessibility*(a: Accessibility): string = + if a == none: result = "notBarrierfree" + elif a == partial: result = "limitedBarrierfree" + elif a == complete: result = "completeBarrierfree"
diff --git a/src/backend/hafas/parse/date.nim b/src/backend/hafas/parse/date.nim @@ -0,0 +1,31 @@ +import ../types +import options +import strutils +import times + +proc parseDate*(common: CommonData, time: Option[string], tzoffset: Option[int]): Option[int64] = + if time.isNone: + return none(int64) + + let tzoffset = tzoffset.get(60) # FIXME: sometimes no time zone is given. how to deal with that? + let date = common.dateStr + var time = time.get + var dayoffset = 0 + + if time.len == 8: + dayoffset = parseInt(time[0..1]) + time = time[2..7] + + var tzoffhours = align($(int(tzoffset / 60)), 2, '0') + var tzoffmins = align($(tzoffset mod 60), 2, '0') + var tzoff = tzoffhours & ":" & tzoffmins + if tzoffset >= 0: + tzoff = "+" & tzoff + + let datestr = date & time & tzoff + let dateformat = "yyyyMMddHHmmsszzz" + var dt = datestr.parse(dateformat) + + dt = dt + initTimeInterval(days = dayoffset) + return some(dt.toTime().toUnix()) +
diff --git a/src/backend/hafas/parse/journey.nim b/src/backend/hafas/parse/journey.nim @@ -0,0 +1,32 @@ +import ../types +import json +import leg +import options + +proc mkParseJourney*(common: CommonData): proc = + proc parseJourney(j: JsonNode): Journey = + var common = common + common.dateStr = j{"date"}.getStr() + + result.refreshToken = j{"ctxRecon"}.getStr() + result.legs = j{"secL"}.getElems().map(mkParseLeg(common)) + result.lastUpdated = common.timeStamp + + # combine walking legs + var i = -1 + var firstWalking = -1 + while true: + inc(i) + if i >= len(result.legs): break + if result.legs[i].isWalking: + if firstWalking == -1: + firstWalking = i + else: + result.legs[firstWalking].arrival = result.legs[i].arrival + result.legs[firstWalking].distance.get += result.legs[i].distance.get + result.legs.delete(i) + dec(i) + else: + firstWalking = -1 + + return parseJourney
diff --git a/src/backend/hafas/parse/journeys_response.nim b/src/backend/hafas/parse/journeys_response.nim @@ -0,0 +1,24 @@ +import ../types +import ./remark +import ./point +import ./operator +import ./journey +import ./line +import ./polyline +import json +import sequtils +import strutils + +proc parseJourneysResponse*(data: JsonNode, isRefresh: bool = false): JourneysResponse = + let points = map(data["res"]["common"]["locL"].getElems(), parsePoint) + let operators = map(data["res"]["common"]["opL"].getElems(), parseOperator) + let remarks = map(data["res"]["common"]["remL"].getElems(), parseRemark) + let lines = data["res"]["common"]["prodL"] + let polylines = map(data["res"]["common"]["polyL"].getElems(), mkParsePolyline(points)) + let timestamp = parseInt(data["res"]["planrtTS"].getStr()) + let common = CommonData(points: points, operators: operators, remarks: remarks, lines: lines, polylines: polylines, timestamp: timestamp) + + result.journeys = data["res"]["outConL"].getElems().map(mkParseJourney(common)) + if not isRefresh: + result.earlierRef = data["res"]["outCtxScrB"].getStr() + result.laterRef = data["res"]["outCtxScrF"].getStr()
diff --git a/src/backend/hafas/parse/leg.nim b/src/backend/hafas/parse/leg.nim @@ -0,0 +1,67 @@ +import ../types +import ./stopover +import ./msg +import ./date +import ./line +import json +import options + +proc parseLegPart(common: CommonData, lp: JsonNode): LegPart = + let h = lp.to(HafasStopParams) + let plannedDepartureTime = parseDate(common, h.dTimeS, h.dTZOffset) + let plannedArrivalTime = parseDate(common, h.aTimeS, h.aTZOffset) + + if h.dPlatfS.isSome: result.plannedPlatform = h.dPlatfS + elif h.aPlatfS.isSome: result.plannedPlatform = h.aPlatfS + if h.dPlatfR.isSome: result.prognosedPlatform = h.dPlatfR + elif h.aPlatfR.isSome: result.prognosedPlatform = h.aPlatfR + if h.dTimeR.isSome: result.prognosedTime = parseDate(common, h.dTimeR, h.dTZOffset) + elif h.aTimeR.isSome: result.prognosedTime = parseDate(common, h.aTimeR, h.aTZOffset) + + if plannedDepartureTime.isSome: result.plannedTime = plannedDepartureTime.get + elif plannedArrivalTime.isSome: result.plannedTime = plannedArrivalTime.get + else: raise newException(CatchableError, "missing departure and arrival time for leg") + + result.point = common.points[h.locX.get] + +proc mkParseLeg*(common: CommonData): proc = + proc parseLeg(l: JsonNode): Leg = + + if l{"jny"}{"polyG"}{"polyXL"}.getElems().len() > 0: + result.polyline = some(Polyline( + type: "FeatureCollection", + )) + for n in l{"jny"}{"polyG"}{"polyXL"}.getElems(): + result.polyline.get.features &= common.polylines[n.getInt()].features + + let typeStr = l{"type"}.getStr() + if typeStr == "JNY": + result.direction = some(l{"jny"}{"dirTxt"}.getStr()) + result.tripId = some(l{"jny"}{"jid"}.getStr()) + result.line = common.parseLine(l["jny"]["prodX"].getInt()) + + let stopovers = l{"jny"}{"stopL"}.getElems() + if stopovers.len > 0: + result.stopovers = some(stopovers.map(mkParseStopover(common))) + + let remarks = l{"jny"}{"msgL"}.getElems() + if remarks.len > 0: + result.remarks = some(remarks.map(mkParseMsg(common))) + + elif typeStr == "WALK" or typeStr == "TRSF": + result.isWalking = true + result.distance = some(l{"gis"}{"dist"}.getInt()) + + elif typeStr == "DEVI": + result.isTransfer = true + + else: + raise newException(CatchableError, "Unimplemented hafas leg type: " & typeStr) + + result.departure = common.parseLegPart(l{"dep"}) + result.arrival = common.parseLegPart(l{"arr"}) + + result.cancelled = l{"dep"}{"dCncl"}.getBool(false) or l{"arr"}{"aCncl"}.getBool(false) + + return parseLeg +
diff --git a/src/backend/hafas/parse/line.nim b/src/backend/hafas/parse/line.nim @@ -0,0 +1,40 @@ +import ../types +import ../util +import ./products +import json +import options + +proc parseLine*(common: CommonData, i: int): Option[Line] = + let l = common.lines[i] + + # unparsable + if l{"cls"}.getInt == 0: + return options.none(Line) + + let line = l.to(HafasProd) + var res = Line() + + res.name = line.name + res.product = parseProduct(line.cls) + res.tripNum = line.prodCtx.num + res.productName = line.prodCtx.catOut + res.fullProductName = line.prodCtx.catOutL + res.id = slug(line.prodCtx.lineId.get(line.name)) + + if line.opX.isSome: + res.operator = some(common.operators[line.opX.get]) + + # DB + + if line.nameS.isSome and (res.product == bus or res.product == tram or res.product == ferry): + res.name = line.nameS.get + + if line.addName.isSome: + # swap name and addName + res.additionalName = some(res.name) + res.name = line.addName.get + + # End DB + + res.mode = MODES[int(res.product)] + return some(res)
diff --git a/src/backend/hafas/parse/msg.nim b/src/backend/hafas/parse/msg.nim @@ -0,0 +1,12 @@ +import ../types +import json + +proc mkParseMsg*(common: CommonData): proc = + proc parseMsg(m: JsonNode): Remark = + let typeStr = m{"type"}.getStr() + if typeStr != "REM": + raise newException(CatchableError, "Unimplemented hafas msg type: " & typeStr) + return common.remarks[m{"remX"}.getInt()] + + return parseMsg +
diff --git a/src/backend/hafas/parse/operator.nim b/src/backend/hafas/parse/operator.nim @@ -0,0 +1,9 @@ +import ../../../types +import ../util +import json + +proc parseOperator*(op: JsonNode): Operator = + return (%* { + "name": op{"name"}, + "id": %* slug(op{"name"}.getStr()), + }).to(Operator)
diff --git a/src/backend/hafas/parse/point.nim b/src/backend/hafas/parse/point.nim @@ -0,0 +1,78 @@ +import ../types +import ./products +import json +import options +import tables + +proc parsePoint*(loc: JsonNode): Point = + let typeStr = loc{"type"}.getStr() + if typeStr == "S": + result.stop = some(Stop( + id: loc{"extId"}.getStr(), + name: loc{"name"}.getStr(), + location: Location( + latitude: loc{"crd"}{"y"}.getInt() / 1000000, + longitude: loc{"crd"}{"x"}.getInt() / 1000000, + ), + products: parseProducts(loc{"pCls"}.getInt()), + )) + elif typeStr == "P": + result.location = some(Location( + id: some(loc{"extId"}.getStr()), + name: some(loc{"name"}.getStr()), + latitude: loc{"crd"}{"y"}.getInt() / 1000000, + longitude: loc{"crd"}{"x"}.getInt() / 1000000, + )) + elif typeStr == "A": + result.location = some(Location( + address: some(loc{"name"}.getStr()), + latitude: loc{"crd"}{"y"}.getInt() / 1000000, + longitude: loc{"crd"}{"x"}.getInt() / 1000000, + )) + else: + raise newException(CatchableError, "Unimplemented hafas loc type: " & typeStr) + +proc formatLocationIdentifier(d: Table[string, string]): string = + for key, val in d: + result &= key + result &= "=" + result &= val + result &= "@" + +proc formatCoord(c: float): string = + return $int(c * 1000000) + +proc formatPoint*(point: Point): JsonNode = + if point.stop.isSome: + let stop = point.stop.get + return %* { + "type": "S", + "lid": formatLocationIdentifier({ + "A": "1", + "L": $stop.id, + }.toTable), + } + elif point.location.isSome: + let loc = point.location.get + if loc.address.isSome: + return %* { + "type": "A", + "lid": formatLocationIdentifier({ + "A": "2", + "O": loc.address.get, + "X": formatCoord(loc.longitude), + "Y": formatCoord(loc.latitude), + }.toTable), + } + elif loc.name.isSome and loc.id.isSome: + return %* { + "type": "P", + "lid": formatLocationIdentifier({ + "A": "4", + "O": loc.address.get, + "L": loc.id.get, + "X": formatCoord(loc.longitude), + "Y": formatCoord(loc.latitude), + }.toTable), + } + raise newException(CatchableError, "Cannot format HAFAS location")
diff --git a/src/backend/hafas/parse/polyline.nim b/src/backend/hafas/parse/polyline.nim @@ -0,0 +1,73 @@ +import ../types +import json +import options +import math + +proc gpsDistance(fromLat: float, fromLon: float, toLat: float, toLon: float): float = + proc toRad(x: float): float = x * PI / 180 + let dLat = toRad(toLat - fromLat) + let dLon = toRad(toLon - fromLon) + let fromLat = toRad(fromLat) + let toLat = toRad(toLat) + let a = pow(sin(dLat / 2), 2) + (pow(sin(dLon / 2), 2) * cos(fromLat) * cos(toLat)) + let c = 2 * arctan2(sqrt(a), sqrt(1 - a)) + return 6371 * c + +proc parseIntegers(str: string): seq[int] = + var byte = 0 + var current = 0 + var bits = 0 + for c in str: + byte = int(c) - 63 + current = current or (( byte and 31 ) shl bits) + bits += 5 + + if byte < 32: + if (current and 1) == 1: + current = -current + current = current shr 1 + + result.add(current) + + current = 0 + bits = 0 + +proc mkParsePolyline*(points: seq[Point]): proc = + proc parsePolyline(l: JsonNode): Polyline = + let line = l.to(HafasPolyLine) + + result.type = "FeatureCollection" + + var lat = 0 + var lon = 0 + + let ints = parseIntegers(line.crdEncYX) + var i = 0 + while i < len(ints): + lat += ints[i] + lon += ints[i+1] + result.features.add(Feature( + type: "Feature", + geometry: FeatureGeometry( + type: "Point", + coordinates: @[lon / 100000, lat / 100000], + ), + )) + i += 2 + + if line.ppLocRefL.isSome: + for p in line.ppLocRefL.get: + result.features[p.ppIdx].properties = points[p.locX].stop + + # sort out coordinates closer than 5m to their neighbours + var j = 1 + while true: + if j >= len(result.features): break + let last = result.features[j-1].geometry.coordinates + let current = result.features[j].geometry.coordinates + if gpsDistance(last[1], last[0], current[1], current[0]) <= 0.005: + result.features.delete(j) + continue + j += 1 + + return parsePolyline
diff --git a/src/backend/hafas/parse/products.nim b/src/backend/hafas/parse/products.nim @@ -0,0 +1,37 @@ +import ../../../types +import bitops + +proc parseProduct*(cls: int): Product = + var tmp = cls + var res = 0 + while tmp > 1: + tmp = tmp shr 1 + res += 1 + + return Product(res) + +proc parseProducts*(pCls: int): Products = + return Products( + nationalExp: pCls.testBit(0), + national: pCls.testBit(1), + regionalExp: pCls.testBit(2), + regional: pCls.testBit(3), + suburban: pCls.testBit(4), + bus: pCls.testBit(5), + ferry: pCls.testBit(6), + subway: pCls.testBit(7), + tram: pCls.testBit(8), + taxi: pCls.testBit(9), + ) + +proc formatProducts*(p: Products): int = + if p.nationalExp: result.setBit(0) + if p.national: result.setBit(1) + if p.regionalExp: result.setBit(2) + if p.regional: result.setBit(3) + if p.suburban: result.setBit(4) + if p.bus: result.setBit(5) + if p.ferry: result.setBit(6) + if p.subway: result.setBit(7) + if p.tram: result.setBit(8) + if p.taxi: result.setBit(9)
diff --git a/src/backend/hafas/parse/remark.nim b/src/backend/hafas/parse/remark.nim @@ -0,0 +1,32 @@ +import ../../../types +import json + +proc parseRemark*(rem: JsonNode): Remark = + let typeStr = rem{"type"}.getStr() + if typeStr == "M" or typeStr == "P": + return (%* { + "type": %* "status", + "summary": rem{"txtS"}, + "code": rem{"code"}, + "text": rem{"txtN"}, + }).to(Remark) + elif typeStr == "L": + return (%* { + "type": %* "status", + "code": %* "alternative-trip", + "text": rem{"txtN"}, + "tripId": rem{"jid"}, + }).to(Remark) + elif typeStr == "A" or typeStr == "I" or typeStr == "H": + return (%* { + "type": %* "hint", + "code": rem{"code"}, + "text": rem{"txtN"}, + }).to(Remark) + else: + # TODO: parse more accurately + return (%* { + "type": %* "status", + "code": rem{"code"}, + "text": rem{"txtN"}, + }).to(Remark)
diff --git a/src/backend/hafas/parse/stopover.nim b/src/backend/hafas/parse/stopover.nim @@ -0,0 +1,33 @@ +import ../types +import ./date +import options +import json + +proc parseStopoverPart(common: CommonData, mode: string, h: HafasStopParams): StopoverPart = + + if (mode != "arrival"): + result.plannedPlatform = h.dPlatfS + result.prognosedPlatform = h.dPlatfR + result.plannedTime = parseDate(common, h.dTimeS, h.dTZOffset) + result.prognosedTime = parseDate(common, h.dTimeR, h.dTZOffset) + else: + result.plannedPlatform = h.aPlatfS + result.prognosedPlatform = h.aPlatfR + result.plannedTime = parseDate(common, h.aTimeS, h.aTZOffset) + result.prognosedTime = parseDate(common, h.aTimeR, h.aTZOffset) + +proc mkParseStopover*(common: CommonData): proc = + proc parseStopover(s: JsonNode): Stopover = + let typeStr = s{"type"}.getStr() + if typeStr != "N": + echo pretty(s) + raise newException(CatchableError, "Unimplemented hafas stopover type: " & typeStr) + + let h = s.to(HafasStopParams) + result.stop = common.points[s{"locX"}.getInt()].stop.get + result.cancelled = h.aCncl.get(false) or h.dCncl.get(false) + result.arrival = common.parseStopoverPart("arrival", h) + result.departure = common.parseStopoverPart("departure", h) + + return parseStopover +
diff --git a/src/backend/hafas/todo b/src/backend/hafas/todo @@ -0,0 +1,10 @@ +- implement leg parsing with nim types +- check and pass back hafas errors +- isAdd (is additional stop) +- hafas information manager (him) remarks +- cycle information +- price information +- reachable +- profiles +- mark current alternatives +- stations
diff --git a/src/backend/hafas/types.nim b/src/backend/hafas/types.nim @@ -0,0 +1,53 @@ +import ../../types +import options +export types +import json + +type + CommonData* = object + lines*: JsonNode + remarks*: seq[Remark] + operators*: seq[Operator] + points*: seq[Point] + polylines*: seq[Polyline] + dateStr*: string + timestamp*: int64 + + HafasStopParams* = object + aTimeS*: Option[string] + aPlatfS*: Option[string] + aTZOffset*: Option[int] + aCncl*: Option[bool] + aTimeR*: Option[string] + aPlatfR*: Option[string] + dTimeS*: Option[string] + dPlatfS*: Option[string] + dTZOffset*: Option[int] + dCncl*: Option[bool] + dTimeR*: Option[string] + dPlatfR*: Option[string] + locX*: Option[int] + + HafasProdCtx* = object + name*: string + num*: string + catOut*: string + catOutL*: string + lineId*: Option[string] + + HafasProd* = object + name*: string + cls*: int + icoX*: int + nameS*: Option[string] + addName*: Option[string] + opX*: Option[int] + prodCtx*: HafasProdCtx + + HafasLocRef* = object + ppIdx*: int + locX*: int + + HafasPolyline* = object + crdEncYX*: string + ppLocRefL*: Option[seq[HafasLocRef]]
diff --git a/src/backend/hafas/util.nim b/src/backend/hafas/util.nim @@ -0,0 +1,57 @@ +import httpclient +import asyncdispatch +import md5 +import json +import strutils +import errors + +proc slug*(s: string): string = + for c in s: + if c.isAlphaNumeric(): + result &= c.toLowerAscii() + else: + result &= '-' + +proc request*(req: JsonNode): Future[JsonNode] {.async.} = + let client = newAsyncHttpClient() + + let body = %*{ + "lang": "de", + "svcReqL": [req] + } + + # TODO: move to profile + body["svcReqL"][0]["cfg"]["rtMode"] = %* "HYBRID" + body["client"] = %* { + "id": "DB", + "v": "16040000", + "type": "IPH", + "name": "DB Navigator" + } + body["ext"] = %* "DB.R19.04.a" + body["ver"] = %* "1.16" + body["auth"] = %* { + "type": "AID", + "aid": "n91dB8Z77MLdoR0K" + } + let salt = "bdI8UVj40K5fvxwf" + let bodytext = $body + let checksum = $toMD5(bodytext & salt) + let url = "https://reiseauskunft.bahn.de/bin/mgate.exe?checksum=" & checksum + + client.headers = newHttpHeaders({ + "Content-Type": "application/json", + "Accept": "application/json", + "user-agent": "my-awesome-e5f276d8fe6cprogram", + }) + + #echo pretty body + let req = await client.request(url, httpMethod = HttpPost, body = $body) + let resp = await req.body + let data = parseJson(resp) + + let error = data{"svcResL"}{0}{"err"}.getStr() + if error != "OK": + raise parseError(error) + + return data{"svcResL"}{0}
diff --git a/src/cache.nim b/src/cache.nim @@ -0,0 +1,102 @@ +import tables, random, os, times, json, asyncfile, asyncdispatch, parseutils +import types, cache_types + +randomize() + + +proc toAlphaId (n: int): string = + let chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + var tmp = n + var digitValue: int = 1 + var digit: int = 0 + while tmp > 0: + digitValue *= chars.len + digit = tmp mod digitValue + let char = int(digit * chars.len / digitValue) + result = $(chars[char]) & result + tmp -= digit + +proc fromAlphaId (s: string): int = + let chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + for char in s: + result *= chars.len + result += chars.skipUntil(char) + +proc getFreeAlphaId (): string = + result = toAlphaId(int32(rand(high(int32)))) + + while existsFile(getEnv("CACHE_PATH") & "/" & $result & ".json"): + result = toAlphaId(int32(rand(high(int32)))) + +proc cacheExists* (id: string ): bool = + return existsFile(getEnv("CACHE_PATH") & "/" & $id & ".json") + +proc getCacheObject* (reqId: string): CacheObject = + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + return parseFile(getEnv("CACHE_PATH") & "/" & $reqId & ".json").to(CacheObject) + +proc saveJourneys* (params: JourneysParams, journeysResponse: JourneysResponse): Future[CacheObject] {.async.} = + let reqId = getFreeAlphaId() + let lastUpdated = getTime().toUnix() + var journeys = initTable[string, Journey]() + var maxId = -1 + + for journey in journeysResponse.journeys: + inc(maxId) + journeys.add($maxId, journey) + + var cacheObj = CacheObject( + version: 1, + reqId: reqId, + minId: 0, + maxId: maxId, + earlierRef: journeysResponse.earlierRef, + laterRef: journeysResponse.laterRef, + lastUpdated: lastUpdated, + params: params, + journeys: journeys + ) + + var file = openAsync(getEnv("CACHE_PATH") & "/" & $reqId & ".json", fmReadWrite) + await file.write($(%* cacheObj)) + + return cacheObj + +proc updateJourneys* (reqId: string, mode: moreJourneysMode, journeysResponse: JourneysResponse): Future[CacheObject] {.async.} = + var cacheObj = getCacheObject(reqId) + + if mode == earlier: + cacheObj.minId -= journeysResponse.journeys.len + var cnt = cacheObj.minId + for journey in journeysResponse.journeys: + cacheObj.journeys.add($cnt, journey) + inc(cnt) + + else: + for journey in journeysResponse.journeys: + inc(cacheObj.maxId) + cacheObj.journeys.add($cacheObj.maxId, journey) + + cacheObj.lastUpdated = getTime().toUnix() + if mode != later: + cacheObj.earlierRef = journeysResponse.earlierRef + else: + cacheObj.laterRef = journeysResponse.laterRef + + var file = openAsync(getEnv("CACHE_PATH") & "/" & $reqId & ".json", fmReadWrite) + await file.write($(%* cacheObj)) + + return cacheObj + +proc updateJourney* (reqId: string, journeyId: string, journey: Journey): Future[CacheObject] {.async.} = + var cacheObj = getCacheObject(reqId) + + cacheObj.lastUpdated = getTime().toUnix() + cacheObj.journeys[journeyId] = journey + + var file = openAsync(getEnv("CACHE_PATH") & "/" & $reqId & ".json", fmReadWrite) + await file.write($(%* cacheObj)) + + return cacheObj+ \ No newline at end of file
diff --git a/src/cache_types.nim b/src/cache_types.nim @@ -0,0 +1,17 @@ +import tables +import types + +type + moreJourneysMode* = enum + later, earlier + + CacheObject* = object + version*: int + reqId*: string + minId*: int + maxId*: int + earlierRef*: string + laterRef*: string + lastUpdated*: int64 + params*: JourneysParams + journeys*: Table[string, Journey]+ \ No newline at end of file
diff --git a/src/endpoints/api/journeys.nim b/src/endpoints/api/journeys.nim @@ -0,0 +1,58 @@ +import json, tables, options, asyncdispatch, sequtils +import ../../types, ../../backend/hafas, ../../cache + +when not defined(release): + import hotcodereloading + +proc journeysEndpoint*(requestData: JsonNode): Future[JsonNode] {.async.} = + when not defined(release): + performCodeReload() + + var reqId = requestData{"reqId"}.getStr() + + if reqId != "": + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + let cacheObj = getCacheObject(reqId) + var response = %* { + "reqId": cacheObj.reqId, + "lastUpdated": cacheObj.lastUpdated, + "params": cacheObj.params, + "journeys": {} + } + + for key, journey in pairs(cacheObj.journeys): + response["journeys"].add(key, %* journey) + delete(response["journeys"][key], "refreshToken") + delete(response["journeys"][key], "cycle") + for legKey, leg in pairs(journey.legs): + delete(response["journeys"][key]["legs"][legKey], "cycle") + delete(response["journeys"][key]["legs"][legKey], "tripId") + + return response + + else: + var params = requestData["params"].to(JourneysParams) + + params.stopovers = some(true) + params.polylines = some(true) + params.remarks = some(true) + params.tickets = some(true) + + let cacheObj = (await saveJourneys(params, await journeys(params))) + + var response = %* { + "reqId": cacheObj.reqId, + "lastUpdated": cacheObj.lastUpdated, + "params": cacheObj.params, + "journeys": {} + } + + for key, journey in pairs(cacheObj.journeys): + response["journeys"].add(key, %* journey) + delete(response["journeys"][key], "refreshToken") + delete(response["journeys"][key], "cycle") + for legKey, leg in pairs(journey.legs): + delete(response["journeys"][key]["legs"][legKey], "cycle") + delete(response["journeys"][key]["legs"][legKey], "tripId") + + return response
diff --git a/src/endpoints/api/moreJourneys.nim b/src/endpoints/api/moreJourneys.nim @@ -0,0 +1,42 @@ +import json, tables, options, asyncdispatch, strutils +import ../../types, ../../cache_types, ../../backend/hafas, ../../cache + +proc moreJourneysEndpoint*(requestData: JsonNode): Future[JsonNode] {.async.} = + var reqId = requestData{"reqId"}.getStr() + var mode = later + + if reqId != "": + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + + if requestData{"mode"}.getStr() != "": + mode = parseEnum[moreJourneysMode](requestData{"mode"}.getStr()) + + var cacheObj = getCacheObject(reqId) + var params = cacheObj.params + + if mode != later: + params.earlierRef = some(cacheObj.earlierRef) + else: + params.laterRef = some(cacheObj.laterRef) + + let journeys = await journeys(params) + cacheObj = (await updateJourneys(reqId, mode, journeys)) + + var response = %* { + "reqId": cacheObj.reqId, + "lastUpdated": cacheObj.lastUpdated, + "params": cacheObj.params, + "journeys": {} + } + + for key, journey in pairs(cacheObj.journeys): + response["journeys"].add(key, %* journey) + delete(response["journeys"][key], "refreshToken") + delete(response["journeys"][key], "cycle") + for legKey, leg in pairs(journey.legs): + delete(response["journeys"][key]["legs"][legKey], "cycle") + delete(response["journeys"][key]["legs"][legKey], "tripId") + + return response + else: + raise newException(errorException, "MISSING_VALUES")+ \ No newline at end of file
diff --git a/src/endpoints/api/refreshJourney.nim b/src/endpoints/api/refreshJourney.nim @@ -0,0 +1,37 @@ +import json, tables, options, asyncdispatch, strutils +import ../../types, ../../cache_types, ../../backend/hafas, ../../cache + +proc refreshJourneyEndpoint*(requestData: JsonNode): Future[JsonNode] {.async.} = + let reqId = requestData{"reqId"}.getStr() + let journeyId = requestData{"journeyId"}.getStr() + + if reqId == "": raise newException(errorException, "MISSING_VALUES") + if journeyId == "": raise newException(errorException, "MISSING_VALUES") + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + + var cacheObj = getCacheObject(reqId) + if not cacheObj.journeys.hasKey(journeyId): raise newException(notFoundException, "JOURNEY_NOT_FOUND") + + let journey = await refreshJourney(RefreshJourneyParams( + refreshToken: cacheObj.journeys[journeyId].refreshToken, + stopovers: some(true), + polylines: some(true), + tickets: some(true), + )) + + cacheObj = await updateJourney(reqId, journeyId, journey) + + var response = %* { + "reqId": cacheObj.reqId, + "lastUpdated": cacheObj.lastUpdated, + "journeys": {} + } + + response["journeys"].add(journeyId, %* journey) + delete(response["journeys"][journeyId], "refreshToken") + delete(response["journeys"][journeyId], "cycle") + for legKey, leg in pairs(journey.legs): + delete(response["journeys"][journeyId]["legs"][legKey], "cycle") + delete(response["journeys"][journeyId]["legs"][legKey], "tripId") + + return response+ \ No newline at end of file
diff --git a/src/endpoints/api/suggestions.nim b/src/endpoints/api/suggestions.nim @@ -0,0 +1,5 @@ +import json, options, asyncdispatch +import ../../types, ../../backend/hafas + +proc suggestionsEndpoint* (data: JsonNode): Future[JsonNode] {.async.} = + return %* (await suggestions(data.to(SuggestionsParams)))
diff --git a/src/endpoints/journeyHandler.nim b/src/endpoints/journeyHandler.nim @@ -0,0 +1,41 @@ +import json, times, options, strutils, tables +import ../asyncWebServer +import ../utils, ../translations, ../types, ../cache_types, ../cache, ../backend/hafas +import ../formaters/formaters, ../formaters/renderJourney + +proc journeyHandler* (request: Request, server: ServerRef) {.async.} = + let urlParts = request.url.path.split("/") + let requestParams = parseQuery(request.url.query) + var headers = newHttpHeaders() + var lang = "de" + var cacheObj: CacheObject + + try: + languageHandler() + + if not cacheExists(urlParts[1]): raise newException(notFoundException, "REQUEST_NOT_FOUND") + + cacheObj = getCacheObject(urlParts[1]) + + if not cacheObj.journeys.hasKey(urlParts[2]): raise newException(notFoundException, "JOURNEY_NOT_FOUND") + + + if requestParams.hasKey("refresh"): + let journey = await refreshJourney(RefreshJourneyParams( + refreshToken: cacheObj.journeys[urlParts[2]].refreshToken, + stopovers: some(true) + )) + + cacheObj = await updateJourney(urlParts[1], urlParts[2], journey) + + var templateContext = renderJourney(cacheObj, urlParts[2]) + if not requestParams.hasKey("json"): + await request.respTemplate(Http200, "journey", templateContext, lang, headers) + else: + await request.respondJson(Http200, "success", "", templateContext) + + except notFoundException: + if not requestParams.hasKey("json"): + await request.respError(Http404, "Nichts gefunden!", "Für diese Anfrage gibts nix.") + else: + await request.respondJson(Http404, "error", getCurrentExceptionMsg().split("\n")[0], newJObject())
diff --git a/src/endpoints/journeysHandler.nim b/src/endpoints/journeysHandler.nim @@ -0,0 +1,42 @@ +import json, times, asyncdispatch, options, strutils +import ../asyncWebServer +import ../utils, ../translations, ../types, ../cache_types, ../cache, ../backend/hafas +import ../formaters/formaters, ../formaters/renderJourneys + +proc journeysHandler* (request: Request, server: ServerRef) {.async.} = + let urlParts = request.url.path.split("/") + let requestParams = parseQuery(request.url.query) + var headers = newHttpHeaders() + var lang = "de" + var cacheObj: CacheObject + + try: + languageHandler() + + if not cacheExists(urlParts[1]): raise newException(notFoundException, "REQUEST_NOT_FOUND") + cacheObj = getCacheObject(urlParts[1]) + + if requestParams.hasKey("more"): + var params = cacheObj.params + let mode = parseEnum[moreJourneysMode](requestParams["more"]) + + if mode != later: + params.earlierRef = some(cacheObj.earlierRef) + else: + params.laterRef = some(cacheObj.laterRef) + + cacheObj = await updateJourneys(urlParts[1], mode, (await journeys(params))) + + var templateContext = renderJourneys(cacheObj) + + if not requestParams.hasKey("json"): + await request.respTemplate(Http200, "journeys", templateContext, lang, headers) + else: + await request.respondJson(Http200, "success", "", templateContext) + + except notFoundException: + if not requestParams.hasKey("json"): + await request.respError(Http404, "Nichts gefunden!", "Für diese Anfrage gibts nix.") + else: + await request.respondJson(Http404, "error", getCurrentExceptionMsg().split("\n")[0], newJObject()) +
diff --git a/src/endpoints/searchHandler.nim b/src/endpoints/searchHandler.nim @@ -0,0 +1,84 @@ +import json, times, options, strutils +import ../asyncWebServer +import ../utils, ../translations, ../types, ../cache_types, ../cache, ../backend/hafas +import ../formaters/formaters, ../formaters/renderJourneys + +proc searchHandler* (request: Request, server: ServerRef) {.async.} = + if request.reqMethod != HttpPost: + let requestParams = parseQuery(request.url.query) + var headers = newHttpHeaders() + var lang = "de" + + languageHandler() + + var templateContext = %* { + "DATE": now().format("yyyy-MM-dd"), + "TIME": now().format("HH:mm") + } + + await request.respTemplate(Http200, "search", templateContext, lang, headers) + + else: + let requestParams = parseQuery(request.body) + var cacheObj: CacheObject + var params: JourneysParams + + try: + var products = %* {} + parseProduct(products, requestParams, "national") + parseProduct(products, requestParams, "national", "nationalExp") + parseProduct(products, requestParams, "regional") + parseProduct(products, requestParams, "regional", "regionalExp") + parseProduct(products, requestParams, "suburban") + parseProduct(products, requestParams, "subway") + parseProduct(products, requestParams, "tram") + parseProduct(products, requestParams, "bus") + parseProduct(products, requestParams, "ferry") + parseProduct(products, requestParams, "taxi") + + params = JourneysParams( + fromPoint: (await getPoint(requestParams["from"])), + toPoint: (await getPoint(requestParams["to"])), + ) + + params.stopovers = some(true) + params.polylines = some(false) + params.remarks = some(true) + params.tickets = some(true) + params.accessibility = some(parseEnum[Accessibility](requestParams["accessibility"])) + params.products = some(products.to(Products)) + + if requestParams.hasKey("isarr"): + params.arrival = some(parseTime(requestParams["date"] & " " & requestParams["time"], "yyyy-MM-dd HH:mm", local()).toUnix) + else: + params.departure = some(parseTime(requestParams["date"] & " " & requestParams["time"], "yyyy-MM-dd HH:mm", local()).toUnix) + + if formatPoint(params.fromPoint) == formatPoint(params.toPoint): + raise newException(errorException, "TOO_CLOSE") + + cacheObj = (await saveJourneys(params, await journeys(params))) + + if cacheObj.reqId != "": + if not requestParams.hasKey("json"): + await request.redirect("/" & cacheObj.reqId) + else: + await request.respondJson(Http200, "success", "", renderJourneys(cacheObj)) + else: + raise newException(errorException, "NO_REQID") + + except: + echo getCurrentExceptionMsg() + let exceptionMsg = getCurrentExceptionMsg().split("\n")[0] + + if not requestParams.hasKey("json"): + case exceptionMsg: + of "TOO_CLOSE": + await request.respError(Http500, "Fehler!", "Abfahrts- und Ankunftsbahnhof dürfen nicht gleich sein.") + else: + await request.respError(Http500, "Unbekannter Fehler!", "Das hätte nicht passieren dürfen, versuche es doch bitte erneut.") + else: + case exceptionMsg: + of "TOO_CLOSE": + await request.respondJson(Http500, "error", "TOO_CLOSE", newJObject()) + else: + await request.respondJson(Http500, "error", "UNKNOWN_ERROR", newJObject())
diff --git a/src/formaters/formatFullResponse.nim b/src/formaters/formatFullResponse.nim @@ -0,0 +1,19 @@ +import tables, json, ../types, ../cache_types + +proc formatFullResponse* (cacheObj: CacheObject): JsonNode = + var response = %* { + "reqId": cacheObj.reqId, + "lastUpdated": cacheObj.lastUpdated, + "params": cacheObj.params, + "journeys": {} + } + + for key, journey in pairs(cacheObj.journeys): + response["journeys"].add(key, %* journey) + delete(response["journeys"][key], "refreshToken") + delete(response["journeys"][key], "cycle") + for legKey, leg in pairs(journey.legs): + delete(response["journeys"][key]["legs"][legKey], "cycle") + delete(response["journeys"][key]["legs"][legKey], "tripId") + + return response
diff --git a/src/formaters/formaters.nim b/src/formaters/formaters.nim @@ -0,0 +1,38 @@ +import options, math, times +import ../types + +proc formatPoint* (point: Point): string {.exportc.} = + if not point.location.isNone: + let location = point.location.get + + if not location.name.isNone: + return location.name.get + else: + return location.address.get + + else: + let stop = point.stop.get + return stop.name + +proc formatDuration* (duration: int64): string {.exportc.} = + let mins = system.div(duration, 60) + + let h = floorDiv(mins, 60) + let m = floorMod(mins, 60) + + if h > 0: + return $h & "h " & $m & "min"; + + return $m & "min" + +proc formatTime* (timestamp: int64, mode: string): string {.exportc.} = + var time = fromUnix(timestamp) + + if mode != "date": + result = time.format("HH:mm") + + if now().format("ddMMYYYY") != time.format("ddMMYYYY"): + result &= ", " & time.format("dd'.'MM") + + else: + result = time.format("dd'.'MM'.'YYYY")
diff --git a/src/formaters/renderJourney.nim b/src/formaters/renderJourney.nim @@ -0,0 +1,203 @@ +import json, tables, options, math +import ../types, ../cache_types +import formaters + +proc renderJourney*(data: CacheObject, id: string): JsonNode = + result = newJObject() + + if not data.journeys.hasKey(id): + raise newException(notFoundException, "Diese Reise konnte nicht gefunden werden.") + + var journey = data.journeys[id] + + let departureLeg = journey.legs[0] + let arrivalLeg = journey.legs[journey.legs.len-1] + + var changes: int64 + var changesDuration: int64 + + var departureTime: int64 + var arrivalTime: int64 + + var lastArrival: LegPart + + if not departureLeg.departure.prognosedTime.isNone: + departureTime = departureLeg.departure.prognosedTime.get + else: + departureTime = departureLeg.departure.plannedTime + + if not arrivalLeg.arrival.prognosedTime.isNone: + arrivalTime = arrivalLeg.arrival.prognosedTime.get + else: + arrivalTime = arrivalLeg.arrival.plannedTime + + let duration = arrivalTime - departureTime + + + result.add("REQ_ID", %data.reqId) + result.add("ID", %id) + result.add("FROM", %formatPoint(departureLeg.departure.point)) + result.add("TO", %formatPoint(arrivalLeg.arrival.point)) + result.add("DATE", %formatTime(departureTime, "date")) + result.add("DURATION", %formatDuration(duration)) + result.add("CHANGES", %0) + result.add("LEGS", newJArray()) + + for leg in journey.legs: + if leg.isWalking != false: + result["LEGS"].add(%* { + "IS_WALKING": true, + "ARRIVAL_POINT": formatPoint(leg.arrival.point), + "LOCATION": formatPoint(leg.arrival.point), + "DISTANCE": leg.distance.get + }) + + elif leg.isTransfer != false: + result["LEGS"].add(%* { + "IS_TRANSFER": true, + "ARRIVAL_POINT": formatPoint(leg.arrival.point), + "DISTANCE": leg.distance.get + }) + + else: + + if lastArrival.plannedTime != 0: + var arrivalTime: int64 + var departureTime: int64 + + if not leg.departure.prognosedTime.isNone: + departureTime = leg.departure.prognosedTime.get + else: + departureTime = leg.departure.plannedTime + + if not lastArrival.prognosedTime.isNone: + arrivalTime = lastArrival.prognosedTime.get + else: + arrivalTime = lastArrival.plannedTime + + let duration = departureTime - arrivalTime + + result["LEGS"].add(%* { + "IS_CHANGE": true, + "DURATION": formatDuration(duration) + }) + + lastArrival = leg.arrival + inc(changes) + + var line = leg.line.get.name + if not leg.line.get.additionalName.isNone(): + line &= " (" & leg.line.get.additionalName.get & ")" + + var remarks = newJArray() + if not leg.remarks.isNone(): + for remark in leg.remarks.get: + if not remark.text.isNone(): + remarks.add(%remark.text.get) + + var stopovers = newJArray() + if not leg.stopovers.isNone(): + for stopover in leg.stopovers.get: + var departureTime: int64 + var arrivalTime: int64 + + var departureDelay: string + var arrivalDelay: string + + var departureTimeFormated: string + var arrivalTimeFormated: string + + var departureHasDelay: bool + var arrivalHasDelay: bool + + var platform: string + var platformHasChanged: bool + + if not stopover.departure.prognosedTime.isNone: + departureTime = stopover.departure.prognosedTime.get + elif not stopover.departure.plannedTime.isNone: + departureTime = stopover.departure.plannedTime.get + + if not stopover.arrival.prognosedTime.isNone: + arrivalTime = stopover.arrival.prognosedTime.get + elif not stopover.arrival.plannedTime.isNone: + arrivalTime = stopover.arrival.plannedTime.get + + if stopover.departure.plannedTime.isSome and stopover.departure.prognosedTime.isSome: + let delay = floorDiv((stopover.departure.prognosedTime.get - stopover.departure.plannedTime.get), 60) + + if delay != 0: + departureHasDelay = true + + if delay > 0: + departureDelay = "+" + + departureDelay &= $delay + + if stopover.arrival.plannedTime.isSome and stopover.arrival.prognosedTime.isSome: + let delay = floorDiv((stopover.arrival.prognosedTime.get - stopover.arrival.plannedTime.get), 60) + + if delay != 0: + arrivalHasDelay = true + + if delay > 0: + arrivalDelay = "+" + + arrivalDelay &= $delay + + if departureTime > 0: + departureTimeFormated = formatTime(departureTime, "") + else: + departureTimeFormated = "-" + + if arrivalTime > 0: + arrivalTimeFormated = formatTime(arrivalTime, "") + else: + arrivalTimeFormated = "-" + + + if stopover.departure.prognosedPlatform.isSome() or stopover.departure.plannedPlatform.isSome(): + if stopover.departure.prognosedPlatform.isSome(): + platform = stopover.departure.prognosedPlatform.get + platformHasChanged = true + elif stopover.departure.plannedPlatform.isSome(): + platform = stopover.departure.plannedPlatform.get + + elif stopover.arrival.prognosedPlatform.isSome() or stopover.arrival.plannedPlatform.isSome(): + if stopover.arrival.prognosedPlatform.isSome(): + platform = stopover.arrival.prognosedPlatform.get + platformHasChanged = true + elif stopover.arrival.plannedPlatform.isSome(): + platform = stopover.arrival.plannedPlatform.get + + else: + platform = "-" + + + stopovers.add(%* { + "STATION_NAME": stopover.stop.name, + "STATION_ID": stopover.stop.id, + "IS_CANCELLED": stopover.cancelled, + "ARRIVAL_TIME": arrivalTimeFormated, + "ARRIVAL_HAS_DELAY": arrivalHasDelay, + "ARRIVAL_DELAY": arrivalDelay, + "DEPARTURE_TIME": departureTimeFormated, + "DEPARTURE_HAS_DELAY": departureHasDelay, + "DEPARTURE_DELAY": departureDelay, + "PLATFORM": platform, + "PLATFORM_HAS_CHANGED": platformHasChanged + }) + + + result["LEGS"].add(%* { + "IS_VEHICLE": true, + "IS_CANCELLED": leg.cancelled, + "LINE": line, + "DIRECTION": leg.direction.get, + "ARRIVAL_POINT": formatPoint(leg.arrival.point), + "DEPARTURE_POINT": formatPoint(leg.departure.point), + "STOPOVERS": stopovers, + "REMARKS": remarks + }) + + result["CHANGES"] = %(changes-1)
diff --git a/src/formaters/renderJourneys.nim b/src/formaters/renderJourneys.nim @@ -0,0 +1,96 @@ +import json, tables, options, sequtils, strutils, algorithm, math +import ../types, ../cache_types +import formaters + +proc renderJourneys*(data: CacheObject): JsonNode = + var data = data; + + result = newJObject() + + result.add("REQ_ID", %data.reqId) + result.add("FROM", %formatPoint(data.params.fromPoint)) + result.add("TO", %formatPoint(data.params.toPoint)) + result.add("JOURNEYS", newJArray()) + + var journeys = toSeq(data.journeys.pairs).map(proc (i: (string, Journey)): (int, Journey) = (parseInt(i[0]), i[1])).sorted(proc (b, a: (int, Journey)): int = b[0] - a[0]) + + for id, journey in items(journeys): + let departureLeg = journey.legs[0] + let arrivalLeg = journey.legs[journey.legs.len-1] + + var products: seq[string] + var changes: int + var changesDuration: int + var cancelled: bool + + var departureTime: int64 + var arrivalTime: int64 + + var departureDelay: string + var arrivalDelay: string + + var departureHasDelay: bool + var arrivalHasDelay: bool + + if not departureLeg.departure.prognosedTime.isNone: + departureTime = departureLeg.departure.prognosedTime.get + else: + departureTime = departureLeg.departure.plannedTime + + if not arrivalLeg.arrival.prognosedTime.isNone: + arrivalTime = arrivalLeg.arrival.prognosedTime.get + else: + arrivalTime = arrivalLeg.arrival.plannedTime + + if departureLeg.departure.prognosedTime.isSome: + let delay = floorDiv((departureLeg.departure.prognosedTime.get - departureLeg.departure.plannedTime), 60) + + if delay != 0: + departureHasDelay = true + + if delay > 0: + departureDelay = "+" + + departureDelay &= $delay + + if arrivalLeg.arrival.prognosedTime.isSome: + let delay = floorDiv((arrivalLeg.arrival.prognosedTime.get - arrivalLeg.arrival.plannedTime), 60) + + if delay != 0: + arrivalHasDelay = true + + if delay > 0: + arrivalDelay = "+" + + arrivalDelay &= $delay + + let duration = arrivalTime - departureTime + + for leg in journey.legs: + if leg.cancelled != false: + cancelled = true + + if leg.isWalking: continue + if leg.isTransfer: continue + + inc(changes) + + if not products.contains(leg.line.get.productName): + products.add(leg.line.get.productName) + + let productsString = products.join(", ") + + result["JOURNEYS"].add(%* { + "ID": id, + "ARRIVAL": formatTime(arrivalTime, ""), + "ARRIVAL_HAS_DELAY": arrivalHasDelay, + "ARRIVAL_DELAY": arrivalDelay, + "DEPARTURE": formatTime(departureTime, ""), + "DURATION": formatDuration(duration), + "DEPARTURE_HAS_DELAY": departureHasDelay, + "DEPARTURE_DELAY": departureDelay, + "CHANGES_DUR": changesDuration, + "CHANGES": changes-1, + "PRODUCTS": productsString, + "IS_CANCELLED": cancelled + })
diff --git a/src/moustachu.nim b/src/moustachu.nim @@ -0,0 +1,197 @@ +## This is basicly the code from fenekku's moustachu project with a few changes +## you can find it here: https://github.com/fenekku/moustachu + +## A mustache templating engine written in Nim. +import strutils, sequtils, os, json +import moustachu_context, moustachu_tokenizer + +export moustachu_context + +proc lookupContext (contextStack: seq[Context], tagkey: string): Context = + ## Return the Context associated with `tagkey` where `tagkey` + ## can be a dotted tag e.g. a.b.c + ## If the Context at `tagkey` does not exist, return nil. + var currCtx = contextStack[contextStack.high] + if tagkey == ".": return currCtx + let subtagkeys = tagkey.split(".") + for i in countDown(contextStack.high, contextStack.low): + currCtx = contextStack[i] + + for subtagkey in subtagkeys: + currCtx = currCtx[subtagkey] + if currCtx == nil: + break + + if currCtx != nil: + return currCtx + + return currCtx + +proc lookupString (contextStack: seq[Context], tagkey: string): string = + ## Return the string associated with `tagkey` in Context `c`. + ## If the Context at `tagkey` does not exist, return the empty string. + result = lookupContext(contextStack, tagkey).toString() + +proc ignore (tag: string, tokens: seq[Token], index: int): int = + #ignore + var i = index + 1 + var nexttoken = tokens[i] + var openedsections = 1 + let lentokens = len(tokens) + + while i < lentokens and openedsections > 0: + if nexttoken.value == tag: + if nexttoken.tokentype in [TokenType.section, TokenType.invertedsection]: + openedsections += 1 + elif nexttoken.tokentype == TokenType.ender: + openedsections -= 1 + else: discard + else: discard + + i += 1 + if i < lentokens: + nexttoken = tokens[i] + + return i + +proc parallelReplace (str: string, substitutions: openArray[tuple[pattern: string, by: string]]): string = + ## Returns a modified copy of `str` with the `substitutions` applied + result = str + for sub in substitutions: + result = result.replace(sub[0], sub[1]) + +proc render* (tmplate: string, contextStack: seq[Context]): string = + ## Take a mustache template `tmplate`, a seq of evaluation Context's + ## and return the rendered string. This is the main procedure. + let + htmlReplaceBy = [("&", "&"), + ("<", "<"), + (">", ">"), + ("\\", "\"), + ("\"", """)] + + var renderings : seq[string] = @[] + + #Object + var sections : seq[string] = @[] + var contextStack = contextStack + + #Array + var loopStartPositions : seq[int] = @[] + var loopCounters : seq[int] = @[] + + #Indentation + var indentation = "" + + let tokens = toSeq(moustachu_tokenizer.tokenize(tmplate)) + let lentokens = len(tokens) + + var index = 0 + + while index < lentokens: + let token = tokens[index] + + case token.tokentype + of TokenType.comment: + discard + + of TokenType.escapedvariable: + var viewvalue = contextStack.lookupString(token.value) + viewvalue = viewvalue.parallelReplace(htmlReplaceBy) + renderings.add(viewvalue) + + of TokenType.unescapedvariable: + var viewvalue = contextStack.lookupString(token.value) + renderings.add(viewvalue) + + of TokenType.section: + let ctx = contextStack.lookupContext(token.value) + if ctx == nil: + index = ignore(token.value, tokens, index) + continue + elif ctx.kind == CObject: + # enter a new section + if ctx.len == 0: + index = ignore(token.value, tokens, index) + continue + else: + contextStack.add(ctx) + sections.add(token.value) + elif ctx.kind == CArray: + # update the array loop stacks + if ctx.len == 0: + index = ignore(token.value, tokens, index) + continue + else: + #do looping + index += 1 + loopStartPositions.add(index) + loopCounters.add(ctx.len) + sections.add(token.value) + contextStack.add(ctx[ctx.len - loopCounters[^1]]) + continue + elif ctx.kind == CValue: + if not ctx: + index = ignore(token.value, tokens, index) + continue + else: discard #we will render the text inside the section + + of TokenType.invertedsection: + let ctx = contextStack.lookupContext(token.value) + if ctx != nil: + if ctx.kind == CObject: + index = ignore(token.value, tokens, index) + continue + elif ctx.kind == CArray: + if ctx.len != 0: + index = ignore(token.value, tokens, index) + continue + elif ctx.kind == CValue: + if ctx: + index = ignore(token.value, tokens, index) + continue + else: discard #we will render the text inside the section + + of TokenType.ender: + var ctx = contextStack.lookupContext(token.value) + if ctx != nil: + if ctx.kind == CObject: + discard contextStack.pop() + discard sections.pop() + elif ctx.kind == CArray: + if ctx.len > 0: + loopCounters[^1] -= 1 + discard contextStack.pop() + if loopCounters[^1] == 0: + discard loopCounters.pop() + discard loopStartPositions.pop() + discard sections.pop() + else: + index = loopStartPositions[^1] + contextStack.add(ctx[ctx.len - loopCounters[^1]]) + continue + + of TokenType.indenter: + if token.value != "": + indentation = token.value + renderings.add(indentation) + + else: + renderings.add(token.value) + + index += 1 + + result = join(renderings, "") + +proc render* (tmplate: string, c: Context): string = + ## Take a mustache template `tmplate`, an evaluation Context `c` + ## and return the rendered string. + var contextStack = @[c] + result = tmplate.render(contextStack) + +proc render* (tmplate: string, jsonContext: JsonNode): string {.exportc.} = + ## Take a mustache template `tmplate`, an evaluation context as a JsonNode + ## and return the rendered string. + let nc = newContext(jsonContext) + var contextStack = @[nc] + result = tmplate.render(contextStack)
diff --git a/src/moustachu_context.nim b/src/moustachu_context.nim @@ -0,0 +1,273 @@ +import json, sequtils, strutils, tables + +type + ContextKind* = enum ## possible Context types + CArray, + CObject, + CValue + + ## Context used to render a mustache template + Context* = ref ContextObj + ContextObj = object + case kind*: ContextKind + of CValue: + val: JsonNode + of CArray: + elems: seq[Context] + of CObject: + fields: Table[string, Context] + +## Builders + +proc newContext*(j : JsonNode = nil): Context = + ## Create a new Context based on a JsonNode object + new(result) + if j == nil: + result = Context(kind: CObject) + result.fields = initTable[string, Context](4) + else: + case j.kind + of JObject: + result = Context(kind: CObject) + result.fields = initTable[string, Context](4) + for key, val in pairs(j.fields): + result.fields[key] = newContext(val) + of JArray: + result = Context(kind: CArray) + result.elems = @[] + for val in j.elems: + result.elems.add(newContext(val)) + else: + result = Context(kind: CValue) + result.val = j + +proc newContext*(c: Context): Context {.exportc.} = + ## Create a new Context based on an existing context. The new Context + ## is an unconnected copy of the existing context simply containing the + ## values of the original. + ## + ## Some code to demonstrate: + ## + ## .. code:: nim + ## + ## import moustachu + ## + ## var a = newContext() + ## a["test"] = "original" + ## + ## var b = a # copy the pointer to b + ## var c = newContext(a) # copy the content to c + ## + ## b["test"] = "changed" + ## + ## echo a["test"].toString() # -> "changed" + ## echo b["test"].toString() # -> "changed" + ## echo c["test"].toString() # -> "original" + new(result) + if c == nil: + result.kind = CObject + result.fields = initTable[string, Context](4) + else: + result.kind = c.kind + case c.kind + of CValue: + result.val = c.val + of CArray: + result.elems = @[] + for item in c.elems: + result.elems.add(newContext(item)) + of CObject: + result.fields = initTable[string, Context](4) + for key, val in pairs(c.fields): + result.fields[key] = newContext(val) + +proc newArrayContext*(): Context = + ## Create a new Context of kind CArray + result = Context(kind: CArray) + result.elems = @[] + +proc internal_set(value: string): Context = + newContext(newJString(value)) + +proc internal_set(value: int): Context = + newContext(newJInt(value)) + +proc internal_set(value: float): Context = + newContext(newJFloat(value)) + +proc internal_set(value: bool): Context = + newContext(newJBool(value)) + +## ## Getters + +proc `[]`*(c: Context, key: string): Context = + ## Return the Context associated with `key`. + ## If the Context at `key` does not exist, return nil. + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + if c.kind != CObject: return nil + if c.fields.hasKey(key): return c.fields[key] else: return nil + +proc `[]`*(c: Context, index: int): Context = + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + if c.kind != CArray: return nil else: return c.elems[index] + +## Setters + +proc `[]=`*(c: var Context, key: string, value: Context) = + ## Assign a context `value` to `key` in context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c.fields[key] = value + +proc `[]=`*(c: var Context, key: string, value: JsonNode) = + ## Convert and assign `value` to `key` in `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = newContext(value) + +proc `[]=`*(c: var Context; key: string, value: BiggestInt) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = newContext(newJInt(value)) + +proc `[]=`*(c: var Context; key: string, value: string) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = newContext(newJString(value)) + +proc `[]=`*(c: var Context; key: string, value: float) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = newContext(newJFloat(value)) + +proc `[]=`*(c: var Context; key: string, value: bool) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = newContext(newJBool(value)) + +proc `[]=`*(c: var Context, key: string, value: openarray[Context]) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + var contextList = newArrayContext() + for v in value: + contextList.elems.add(v) + c[key] = contextList + +proc `[]=`*(c: var Context, key: string, value: openarray[string]) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = map(value, proc(x: string): Context = newContext(newJString(x))) + +proc `[]=`*(c: var Context, key: string, value: openarray[int]) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = map(value, proc(x: int): Context = newContext(newJInt(x))) + +proc `[]=`*(c: var Context, key: string, value: openarray[float]) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = map(value, proc(x: float): Context = newContext(newJFloat(x))) + +proc `[]=`*(c: var Context, key: string, value: openarray[bool]) = + ## Assign `value` to `key` in Context `c` + assert(c != nil, "Context is nil. Did you forget to initialize with newContext()?") + assert(c.kind == CObject) + c[key] = map(value, proc(x: bool): Context = newContext(newJBool(x))) + +proc add*(c: Context, value: Context) = + ## Add 'value' object to array. + assert(c.kind == CArray) + c.elems.add(value) + +proc add*[T: string, int, float, bool](c: Context, value: T) = + ## Add 'value' to array. Reference later with dot substitution "{{.}}" + assert(c.kind == CArray) + c.elems.add(internal_set(value)) + +## Printers + +proc `$`*(c: Context): string = + ## Return a string representing the context. Useful for debugging + if c == nil: + result = "Context->nil" + return + result = "Context->[kind: " & $c.kind + case c.kind + of CValue: + if c.val.str == "": + result &= "\nval: " + else: + result &= "\nval: " & $c.val + of CArray: + if c.elems == @[]: + result &= "\nnot initialized" + else: + var strArray = map(c.elems, proc(c: Context): string = $c) + result &= "\nelems: [" & join(strArray, ", ") & "]" + of CObject: + var strArray : seq[string] = @[] + for key, val in pairs(c.fields): + strArray.add(key & ": " & $val) + result &= "\nfields: {" & join(strArray, ", ") & "}" + result &= "\n]" + +proc toString*(c: Context): string = + ## Return string representation of `c` relevant to mustache + if c != nil: + if c.kind == CValue: + case c.val.kind + of JString: + if c.val.str == "": + return "" + return c.val.str + of JFloat: + return c.val.fnum.formatFloat(ffDefault, -1) + of JInt: + return $c.val.num + of JNull: + return "" + of JBool: + return if c.val.bval: "true" else: "" + else: + return $c.val + else: + return $c + else: + return "" + +proc len*(c: Context): int = + if c.kind == CArray: + result = c.elems.len + elif c.kind == CObject: + result = c.fields.len + else: discard + +converter toBool*(c: Context): bool = + assert(c.kind == CValue) + case c.val.kind + of JBool: result = c.val.bval + of JNull: result = false + of JString: result = c.val.str != "" + else: result = true + +proc newContext*[T: string | int | bool | float](d: openarray[tuple[key: string, value: T ]]): Context = + ## Create a new Context based on an array of [string, T] tuples + ## + ## For example, you could do: + ## var c = NewContext({"x": 7, "y": -20}) + ## or, + ## var c = NewContext({"r": "apple", "b": "bike"}) + ## or, if you must: + ## var c = NewContext([("r", "apple"), ("b", "tunnel")]) + var c = newContext() + for entry in d: + c[entry.key] = entry.value + return c
diff --git a/src/moustachu_tokenizer.nim b/src/moustachu_tokenizer.nim @@ -0,0 +1,128 @@ +import strutils + +type + TokenType* {.pure.} = enum + rawtext, + escapedvariable, + unescapedvariable, + section, + invertedsection, + comment, + ender, + indenter + + Token* = tuple[tokentype: TokenType, value: string] + + +proc left_side_empty(tmplate: string, pivotindex: int): tuple[empty: bool, newlineindex: int] = + var ls_i = 0 + var ls_empty = false + var i = pivotindex - 1 + while i > -1 and tmplate[i] in {' ', '\t'}: dec(i) + if (i == -1) or (tmplate[i] == '\l'): + ls_i = i + ls_empty = true + return (empty: ls_empty, newlineindex: ls_i) + + +iterator tokenize*(tmplate: string): Token = + let opening = "{{" + var pos = 0 + + while pos < tmplate.len: + let originalpos = pos + var closing = "}}" + + # find start of tag + var opening_index = tmplate.find(opening, start=pos) + if opening_index == -1: + yield (tokentype: TokenType.rawtext, value: tmplate[pos..high(tmplate)]) + break + + #Check if the left side is empty + var left_side = left_side_empty(tmplate, opening_index) + var ls_empty = left_side.empty + var ls_i = left_side.newlineindex + + #Deal with text before tag + var beforetoken = (tokentype: TokenType.rawtext, value: "") + if opening_index > pos: + #safe bet for now + beforetoken.value = tmplate[pos..opening_index-1] + + pos = opening_index + opening.len + + if not (pos < tmplate.len): + yield (tokentype: TokenType.rawtext, value: tmplate[opening_index..high(tmplate)]) + break + + #Determine TokenType + var tt = TokenType.escapedvariable + + case tmplate[pos] + of '!': + tt = TokenType.comment + pos += 1 + of '&': + tt = TokenType.unescapedvariable + pos += 1 + of '{': + tt = TokenType.unescapedvariable + pos += 1 + closing &= "}" + of '#': + tt = TokenType.section + pos += 1 + of '^': + tt = TokenType.invertedsection + pos += 1 + of '/': + tt = TokenType.ender + pos += 1 + else: + tt = TokenType.escapedvariable + + #find end of tag + var closingindex = tmplate.find(closing, start=pos) + if closingindex == -1: + if beforetoken.value != "": yield beforetoken + yield (tokentype: TokenType.rawtext, value: tmplate[opening_index..pos-1]) + continue + + #Check if the right side is empty + var rs_i = 0 + var rs_empty = false + var i = 0 + if ls_empty: + i = closingindex + closing.len + while i < tmplate.len and tmplate[i] in {' ', '\t'}: inc(i) + if i == tmplate.len: + rs_i = i - 1 + rs_empty = true + elif tmplate[i] == '\c' and (i+1 < tmplate.len) and (tmplate[i+1] == '\l'): + rs_i = i + 1 + rs_empty = true + elif tmplate[i] == '\l': + rs_i = i + rs_empty = true + else: + discard + + if tt in [TokenType.comment, TokenType.section, + TokenType.invertedsection, TokenType.ender]: + # Standalone tokens + if rs_empty: + if beforetoken.value != "": + beforetoken.value = tmplate[originalpos..ls_i] + yield beforetoken + + yield (tokentype: tt, value: tmplate[pos..closingindex-1].strip) + pos = rs_i + 1 # remove new line of this line + else: + if beforetoken.value != "": yield beforetoken + yield (tokentype: tt, value: tmplate[pos..closingindex-1].strip) + pos = closingindex + closing.len + else: + if beforetoken.value != "": yield beforetoken + yield (tokentype: tt, value: tmplate[pos..closingindex-1].strip) + pos = closingindex + closing.len
diff --git a/src/oeffisearch.nim b/src/oeffisearch.nim @@ -0,0 +1,217 @@ +import os, json, times, options, strutils, asyncdispatch, re +import jester, moustachu +import types, backend/hafas, cache, cache_types +import endpoints/[suggestions, journeys, moreJourneys, refreshJourney] +import utils, translations, formaters/[formaters, renderJourneys, renderJourney, formatFullResponse] + +if getEnv("CACHE_PATH") == "": + echo "CACHE_PATH not set! Bye...." + quit() +else: + discard existsOrCreateDir(getEnv("CACHE_PATH")) + +settings: + port = Port(5_000) + bindAddr = "0.0.0.0" + +routes: + get "/": + let requestParams = params(request) + + var lang = "de" + var templateContext = %* { + "DATE": now().format("yyyy-MM-dd"), + "TIME": now().format("HH:mm") + } + + readSetLang() + respTemplate(Http200, "search", templateContext, lang) + + + post "/": + let requestParams = params(request) + var cacheObj: CacheObject + var params: JourneysParams + + try: + var products = %* {} + parseProduct(products, requestParams, "national") + parseProduct(products, requestParams, "national", "nationalExp") + parseProduct(products, requestParams, "regional") + parseProduct(products, requestParams, "regional", "regionalExp") + parseProduct(products, requestParams, "suburban") + parseProduct(products, requestParams, "subway") + parseProduct(products, requestParams, "tram") + parseProduct(products, requestParams, "bus") + parseProduct(products, requestParams, "ferry") + parseProduct(products, requestParams, "taxi") + + params = JourneysParams( + fromPoint: (await getPoint(requestParams["from"])), + toPoint: (await getPoint(requestParams["to"])), + ) + + params.stopovers = some(true) + params.polylines = some(true) + params.remarks = some(true) + params.tickets = some(true) + params.accessibility = some(parseEnum[Accessibility](requestParams["accessibility"])) + params.products = some(products.to(Products)) + + if requestParams.hasKey("isarr"): + params.arrival = some(parseTime(requestParams["date"] & " " & requestParams["time"], "yyyy-MM-dd HH:mm", local()).toUnix) + else: + params.departure = some(parseTime(requestParams["date"] & " " & requestParams["time"], "yyyy-MM-dd HH:mm", local()).toUnix) + + if formatPoint(params.fromPoint) == formatPoint(params.toPoint): + raise newException(errorException, "TOO_CLOSE") + + cacheObj = (await saveJourneys(params, await journeys(params))) + + if cacheObj.reqId != "": + redirect "/" & cacheObj.reqId + else: + raise newException(errorException, "NO_REQID") + + except: + echo getCurrentExceptionMsg() + let exceptionMsg = getCurrentExceptionMsg().split("\n")[0] + + if not requestParams.hasKey("json"): + case exceptionMsg: + of "TOO_CLOSE": + respError(Http500, "Fehler!", "Abfahrts- und Ankunftsbahnhof dürfen nicht gleich sein.") + else: + respError(Http500, "Unbekannter Fehler!", "Das hätte nicht passieren dürfen, versuche es doch bitte erneut.") + else: + case exceptionMsg: + of "TOO_CLOSE": + respApi(Http500, "error", "TOO_CLOSE", "") + else: + respApi(Http500, "error", "UNKNOWN_ERROR", "") + + + post "/api": + let endpoint = @"endpoint" + let requestParams = params(request) + + try: + let payload = parseJson(request.body) + var response: JsonNode + + case requestParams["endpoint"]: + of "suggestions": + response = await suggestionsEndpoint(payload) + of "journeys": + response = await journeysEndpoint(payload) + of "moreJourneys": + response = await moreJourneysEndpoint(payload) + of "refreshJourney": + response = await refreshJourneyEndpoint(payload) + + respApi(Http200, "success", "", response) + + except notFoundException: + respApi(Http404, "error", getCurrentExceptionMsg().split("\n")[0], "") + + except: + respApi(Http500, "error", getCurrentExceptionMsg().split("\n")[0], "") + + + get "/suggestions": + let requestParams = params(request) + var results = 10 + var suggestions: seq[string] + + if requestParams.hasKey("results"): + results = parseInt(requestParams["results"]) + + if requestParams.hasKey("query"): + let points = (await suggestions(SuggestionsParams( + query: requestParams["query"], + results: some(results) + ))) + + for point in points: + suggestions.add(formatPoint(point)) + + respApi(Http200, "success", "", %suggestions) + + + get re"^\/([A-Za-z0-9]+)$": + let reqId = request.matches[0] + let requestParams = params(request) + + var lang = "de" + var cacheObj: CacheObject + + try: + readSetLang() + + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + cacheObj = getCacheObject(reqId) + + if requestParams.hasKey("more"): + var params = cacheObj.params + let mode = parseEnum[moreJourneysMode](requestParams["more"]) + + if mode != later: + params.earlierRef = some(cacheObj.earlierRef) + else: + params.laterRef = some(cacheObj.laterRef) + + cacheObj = (await updateJourneys(reqId, mode, (await journeys(params)))) + + var templateContext = renderJourneys(cacheObj) + + if not requestParams.hasKey("json"): + respTemplate(Http200, "journeys", templateContext, lang) + else: + respApi(Http200, "success", "", templateContext) + + except notFoundException: + if not requestParams.hasKey("json"): + respError(Http404, "Nichts gefunden!", "Für diese Anfrage gibts nix.") + else: + respApi(Http404, "error", getCurrentExceptionMsg().split("\n")[0], "") + + + get re"^\/([A-Za-z0-9]+)\/([0-9-]+)$": + let reqId = request.matches[0] + let journeyId = request.matches[1] + let requestParams = params(request) + + var lang = "de" + var cacheObj: CacheObject + + try: + readSetLang() + + if not cacheExists(reqId): raise newException(notFoundException, "REQUEST_NOT_FOUND") + + cacheObj = getCacheObject(reqId) + + if not cacheObj.journeys.hasKey(journeyId): raise newException(notFoundException, "JOURNEY_NOT_FOUND") + + + if requestParams.hasKey("refresh"): + let journey = await refreshJourney(RefreshJourneyParams( + refreshToken: cacheObj.journeys[journeyId].refreshToken, + stopovers: some(true), + polylines: some(true), + tickets: some(true) + )) + + cacheObj = await updateJourney(reqId, journeyId, journey) + + var templateContext = renderJourney(cacheObj, journeyId) + if not requestParams.hasKey("json"): + respTemplate(Http200, "journey", templateContext, lang) + else: + respApi(Http200, "success", "", templateContext) + + except notFoundException: + if not requestParams.hasKey("json"): + respError(Http404, "Nichts gefunden!", "Für diese Anfrage gibts nix.") + else: + respApi(Http404, "error", getCurrentExceptionMsg().split("\n")[0], "")+ \ No newline at end of file
diff --git a/src/oeffisearch_nojs.nim b/src/oeffisearch_nojs.nim @@ -0,0 +1,95 @@ +import json, os, posix +import asyncWebServer + +import types +import options + +import endpoints/searchHandler +import endpoints/journeysHandler +import endpoints/journeyHandler + +import endpoints/api/suggestions +import endpoints/api/journeys +import endpoints/api/moreJourneys +import endpoints/api/refreshJourney + +import utils, translations, types, cache_types, cache, backend/hafas, formaters/formaters + + +proc CtrlCHook() {.noconv.} = + echo "Ctrl+C fired! \nStopping Server now!" + quit() + +proc main = # for gcsafe + setControlCHook(CtrlCHook) + + onSignal(SIGTERM): + echo "Got SIGTERM! \nStopping Server now!" + quit() + + if getEnv("CACHE_PATH") == "": + echo "CACHE_PATH not set! Bye...." + quit() + else: + discard existsOrCreateDir(getEnv("CACHE_PATH")) + + var server = newServer() # launch on http://localhost:5000 + + server.pages: + equals("/"): + await searchHandler(request, server) + + startsWith("/api/"): + try: + let query = parseJson(decodeUrl(request.url.query)) + var response: JsonNode + + if url == "suggestions": + response = await suggestionsEndpoint(query) + elif url == "journeys": + response = await journeysEndpoint(query) + elif url == "moreJourneys": + response = await moreJourneysEndpoint(query) + elif url == "refreshJourney": + response = await refreshJourneyEndpoint(query) + else: + await request.respondJson(Http404, "error", "ENDPOINT_NOT_FOUND", newJObject()) + + await request.respondJson(Http200, "success", "", response) + + except notFoundException: + await request.respondJson(Http404, "error", getCurrentExceptionMsg().split("\n")[0], newJObject()) + + except: + await request.respondJson(Http500, "error", getCurrentExceptionMsg().split("\n")[0], newJObject()) + + startsWith("/suggestions"): + let requestParams = parseQuery(request.url.query) + var results = 10 + var suggestions: seq[string] + + if requestParams.hasKey("results"): + results = parseInt(requestParams["results"]) + + if requestParams.hasKey("query"): + let points = (await suggestions(SuggestionsParams( + query: requestParams["query"], + results: some(results) + ))) + + for point in points: + suggestions.add(formatPoint(point)) + + var json = %* {"suggestions": suggestions} + await request.respondJson(Http200, "success", "", json["suggestions"]) + + regex(re"^\/([A-Za-z0-9]+)$"): + await journeysHandler(request, server) + + + regex(re"^\/([A-Za-z0-9]+)\/([0-9-]+)$"): + await journeyHandler(request, server) + + server.start() + +main()
diff --git a/src/translations.nim b/src/translations.nim @@ -0,0 +1,117 @@ +import json + +let availableTranslations* = @["en", "de"] + +let translations* = %* { + "global": { + "en": { + "LANG": "en", + "FROM": "From", + "TO": "To", + "PRODUCTS": "Products", + "DEPARTURE": "Departure", + "ARRIVAL": "Arrival", + "DURATION": "Duration", + "CHANGES": "Changes" + }, + + "de": { + "LANG": "de", + "FROM": "Von", + "TO": "Nach", + "PRODUCTS": "Verkehrsmittel", + "DEPARTURE": "Abfahrt", + "ARRIVAL": "Ankunft", + "DURATION": "Dauer", + "CHANGES": "Umstiege" + } + }, + + "search": { + "en": { + "ISARR": "Search by Arrival", + "DATE": "Date (YYYY-MM-DD)", + "TIME": "Time (HH:mm)", + "HIGHSPEED_TRAIN": "Log distance trains", + "REGIONAL_TRAIN": "Regional trains", + "SUBURBAN_TRAIN": "Suburban trains", + "SUBWAY": "Subway", + "TRAM": "Tram", + "BUS": "Bus", + "FERRY": "Ferry", + "TAXI": "Taxi", + "ACCESSIBILITY": "Accessibility", + "ACCESSIBILITY_NONE": "none", + "ACCESSIBILITY_PARTIAL": "partial", + "ACCESSIBILITY_FULL": "full", + "SEARCH": "Search", + "LANGUAGE": "Language" + }, + + "de": { + "ISARR": "Ankunftszeit statt Abfahrtszeit", + "DATE": "Datum (im Format YYYY-MM-DD)", + "TIME": "Uhrzeit (im Format HH:mm)", + "HIGHSPEED_TRAIN": "Fernverkehr", + "REGIONAL_TRAIN": "Regionalverkehr", + "SUBURBAN_TRAIN": "S-Bahn", + "SUBWAY": "U-Bahn", + "TRAM": "Tram", + "BUS": "Bus", + "FERRY": "Fähre", + "TAXI": "Taxi", + "ACCESSIBILITY": "Barrierefreiheit", + "ACCESSIBILITY_NONE": "keine Einschränkungen", + "ACCESSIBILITY_PARTIAL": "Bedingt barrierefrei", + "ACCESSIBILITY_FULL": "Barrierefrei", + "SEARCH": "Suchen", + "LANGUAGE": "Sprache" + } + }, + + "journeys": { + "en": { + "BACK": "Back to search", + "EARLIER": "erlier", + "LATER": "later", + "DETAILS": "Details" + }, + + "de": { + "BACK": "Zurück zur Suche", + "EARLIER": "früher", + "LATER": "später", + "DETAILS": "Details" + } + }, + + "journey": { + "en": { + "BACK": "Back to overview", + "DATE": "Date", + "STATION": "Station", + "PLATFORM": "Platform", + "GO_TO": "Go to", + "APPRX": "apprx.", + "METERS": "meters", + "TRAVEL_TO": "Travel to ", + "CHANGE_DURATION": "to change", + "CANCELLED": "cancelled!", + "RELOAD": "Refresh" + }, + + "de": { + "BACK": "Zurück zur Übersicht", + "DATE": "Datum", + "STATION": "Station", + "PLATFORM": "Gleis", + "GO_TO": "Laufe nach", + "APPRX": "ca.", + "METERS": "Meter", + "TRAVEL_TO": "Reise nach", + "CHANGE_DURATION": "Umstiegszeit", + "CANCELLED": "Fällt aus", + "RELOAD": "Datenstand erneuern" + } + } +}+ \ No newline at end of file
diff --git a/src/types.nim b/src/types.nim @@ -0,0 +1,203 @@ +import options +import httpcore + +type + NimHttpResponse* = object + code*: HttpCode + msg*: string + headers*: HttpHeaders + + Stop* = object + id*: string + name*: string + location*: Location + products*: Products + station*: Option[Station] + + Station* = object + id*: int + name*: string + location*: Location + products*: Products + + Location* = object + latitude*: float + longitude*: float + name*: Option[string] + address*: Option[string] + id*: Option[string] + + Product* = enum + nationalExp, national, regionalExp, regional, suburban, bus, ferry, subway, tram, taxi + + Mode* = enum + Train, Bus, Watercraft, Taxi, Walking + + Products* = object + nationalExp*: bool + national*: bool + regionalExp*: bool + regional*: bool + suburban*: bool + bus*: bool + ferry*: bool + subway*: bool + tram*: bool + taxi*: bool + + Point* = object + stop*: Option[Stop] + location*: Option[Location] + + Journey* = object + refreshToken*: string + lastUpdated*: int64 + legs*: seq[Leg] + cycle*: Option[Cycle] + price*: Option[Price] + + LegPart* = object + point*: Point + plannedTime*: int64 + prognosedTime*: Option[int64] + plannedPlatform*: Option[string] + prognosedPlatform*: Option[string] + + Leg* = object + isWalking*: bool + isTransfer*: bool + cancelled*: bool + departure*: LegPart + arrival*: LegPart + polyline*: Option[Polyline] + distance*: Option[int] # required for isWalking or isTransfer + tripId*: Option[string] # required for not isWalking and not isTranfer + line*: Option[Line] # required for not isWalking and not isTranfer + direction*: Option[string] # required for not isWalking and not isTranfer + cycle*: Option[Cycle] + stopovers*: Option[seq[Stopover]] + remarks*: Option[seq[Remark]] + + Line* = object + id*: string + name*: string + mode*: Mode + product*: Product + tripNum*: string + productName*: string + fullProductName*: string + operator*: Option[Operator] + additionalName*: Option[string] + + Operator* = object + id*: string + name*: string + + Cycle* = object + min*: Option[int] + max*: Option[int] + nr*: Option[int] + + Price* = object + amount*: Option[float] + currency*: Option[string] + hint*: Option[string] + + StopoverPart* = object + plannedTime*: Option[int64] + prognosedTime*: Option[int64] + plannedPlatform*: Option[string] + prognosedPlatform*: Option[string] + + Stopover* = object + stop*: Stop + cancelled*: bool + departure*: StopoverPart + arrival*: StopoverPart + + Remark* = object + `type`*: Option[string] + code*: Option[string] + summary*: Option[string] + text*: Option[string] + tripId*: Option[string] + + JourneysResponse* = object + earlierRef*: string + laterRef*: string + journeys*: seq[Journey] + + Accessibility* = enum + none, partial, complete + + SuggestionsParams* = object + query*: string + results*: Option[int] #default value: 10 + stations*: Option[bool] #default value: true + poi*: Option[bool] #default value: true + addresses*: Option[bool] #default value: true + + JourneysParams* = object + fromPoint*: Point + toPoint*: Point + viaPoint*: Option[Point] #default value: null support in hafas backend: ✅ + earlierRef*: Option[string] #default value: null support in hafas backend: ✅ + laterRef*: Option[string] #default value: null support in hafas backend: ✅ + results*: Option[int] #default value: 5 support in hafas backend: ✅ + stopovers*: Option[bool] #default value: false support in hafas backend: ✅ + polylines*: Option[bool] #default value: false support in hafas backend: ✅ + remarks*: Option[bool] #default value: true support in hafas backend: + bikeFriendly*: Option[bool] #default value: false support in hafas backend: + tickets*: Option[bool] #default value: false support in hafas backend: ✅ + startWithWalking*: Option[bool] #default value: true support in hafas backend: ✅ + scheduledDays*: Option[bool] + accessibility*: Option[Accessibility] #default value: none support in hafas backend: ✅ + transfers*: Option[int] #default value: -1 support in hafas backend: ✅ + transferTime*: Option[int] #default value: 00 support in hafas backend: ✅ + arrival*: Option[int64] #default value: null support in hafas backend: ✅ + departure*: Option[int64] #default value: null support in hafas backend: ✅ + products*: Option[Products] #default value: all true support in hafas backend: ✅ + + RefreshJourneyParams* = object + refreshToken*: string + stopovers*: Option[bool] #default value: false support in hafas backend: ✅ + polylines*: Option[bool] #default value: false support in hafas backend: ✅ + tickets*: Option[bool] #default value: false support in hafas backend: ✅ + + Polyline* = object + `type`*: string + features*: seq[Feature] + + Feature* = object + `type`*: string + properties*: Option[Stop] + geometry*: FeatureGeometry + + FeatureGeometry* = object + `type`*: string + coordinates*: seq[float] + + + notFoundException* = object of Exception + errorException* = object of Exception + + hafasExceptionKind* = enum + SERVER_ERROR, ACCESS_DENIED, INVALID_REQUEST, NOT_FOUND + + hafasException* = ref object of Exception + code*: hafasExceptionKind + message*: string + statusCode*: HttpCode + +const MODES* = [ + Train, # nationalExp + Train, # national + Train, # regionalExp + Train, # regional + Train, # suburban + Bus, # bus + Watercraft, # ferry + Train, # subway + Train, # tram + Taxi, # taxi +]
diff --git a/src/utils.nim b/src/utils.nim @@ -0,0 +1,63 @@ +import json, asyncdispatch, asynchttpserver, options, strutils, httpcore +import types, translations, backend/hafas +import moustachu, moustachu_tokenizer, moustachu_context + +proc getPoint* (name: string): Future[Point] {.async} = + let points = (await suggestions(SuggestionsParams( + query: name, + results: some(1), + addresses: some(false), + poi: some(false) + ))) + + if points.len > 0: + result = points[0] + else: + raise newException(notFoundException, "Zur Eingabe: \"" & name & "\" konnte nichts gefunden werden.") + +proc addTranslations* (old: JsonNode, new: JsonNode): JsonNode = + for key, value in pairs(new): + old.add("LABEL_" & key, value) + + return old + +template parseProduct* (data: untyped, form: untyped, name: string, new_name: string="") = + if new_name != "": + if form.hasKey(name) != true: + data.add(new_name, %false) + else: + data.add(new_name, %true) + else: + if form.hasKey(name) != true: + data.add(name, %false) + else: + data.add(name, %true) + +template languageHandler* () = + let cookies = cookies(request) + + if cookies.hasKey("lang") and availableTranslations.contains(cookies["lang"]): + lang = cookies["lang"] + + if requestParams.hasKey("lang") and availableTranslations.contains(requestParams["lang"]): + lang = requestParams["lang"] + setCookie("lang", lang, daysForward(90)) + +proc respError* (request: Request, httpCode: HttpCode, header: string, body: string) {.async.} = + let response = render(readFile("templates/error.tpl"), %* { + "HEAD": header, + "BODY": body + }) + + await request.respond(httpCode, response) + +proc respTemplate* (request: Request, httpCode: HttpCode, name: string, templateContext: JsonNode, lang: string="", headers: HttpHeaders=newHttpHeaders()) {.async.} = + var templateContext = templateContext + + if lang != "": + templateContext = templateContext.addTranslations(translations["global"][lang]) + templateContext = templateContext.addTranslations(translations[name][lang]) + + let response = render(readFile("templates/" & name & ".tpl"), templateContext) + + await request.respond(httpCode, response, newHttpHeaders([("Content-Type", "text/html; charset=UTF-8")]))
diff --git a/templates/error.tpl b/templates/error.tpl @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html lang="de"> + <head> + <title>Fehler - Öffisearch</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="/assets/style.css"> + </head> + <body class="center"> + <div class="search"> + <h1 class="center">{{HEAD}}</h1> + <p class="center">{{BODY}}</p> + </div> + </body> +</html>+ \ No newline at end of file
diff --git a/templates/journey.tpl b/templates/journey.tpl @@ -0,0 +1,71 @@ + <!DOCTYPE html> +<html lang="de"> + <head> + <title>Öffisearch</title> + <meta charset="UTF-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#ffffff"> + <meta name="description" content="Plan your public transport journeys"> + + <link rel="icon" type="image/png" sizes="64x64" href="/assets/favicon-64x64.png"> + <link rel="manifest" href="/assets/manifest.json"> + <link rel="stylesheet" type="text/css" href="/assets/style.css"> + + <link rel="modulepreload" href="/assets/js/lit-html.js"> + <link rel="modulepreload" href="/assets/js/helpers.js"> + </head> + <body class="journey"> + <header> + <a class="back" href="/{{REQ_ID}}" title="{{LABEL_BACK}}">{{LABEL_BACK}}</a> + <h2>{{FROM}} → {{TO}}</h2> + <p><b>{{LABEL_DURATION}}: {{DURATION}} | {{LABEL_CHANGES}}: {{CHANGES}} | {{LABEL_DATE}}: {{DATE}}</b></p> + <a class="reload" href="/{{REQ_ID}}/{{ID}}?refresh=1" title="{{LABEL_RELOAD}}">{{LABEL_RELOAD}}</a> + </header> + + {{#LEGS}} + {{#IS_WALKING}} + <p class="walk">{{LABEL_GO_TO}} {{ARRIVAL_POINT}} ({{LABEL_APPRX}} {{DISTANCE}} {{LABEL_METERS}})</p> + {{/IS_WALKING}} + {{#IS_TRANSVER}} + <p class="transfer">{{LABEL_TRAVEL_TO}} {{ARRIVAL_POINT}}</p> + {{/IS_TRANSVER}} + {{#IS_CHANGE}} + <p class="change">{{DURATION}} {{LABEL_CHANGE_DURATION}}</p> + {{/IS_CHANGE}} + {{#IS_VEHICLE}} + <table> + <thead> + <tr> + <td colspan="4"> + <span>{{LINE}} → {{DIRECTION}} {{#IS_CANCELLED}}<b class="cancelled-text"> {{LABEL_CANCELLED}}!</b>{{/IS_CANCELLED}}</span> + </td> + </tr> + <tr> + <th>{{LABEL_ARRIVAL}}</th> + <th>{{LABEL_DEPARTURE}}</th> + <th class="station-column">{{LABEL_STATION}}</th> + <th>{{LABEL_PLATFORM}}</th> + </tr> + </thead> + <tbody> + {{#STOPOVERS}} + <tr class="stop{{#IS_CANCELLED}} cancelled{{/IS_CANCELLED}}"> + <td><span>{{ARRIVAL_TIME}}{{#ARRIVAL_HAS_DELAY}} <b>({{ARRIVAL_DELAY}})</b>{{/ARRIVAL_HAS_DELAY}}</span></td> + <td><span>{{DEPARTURE_TIME}}{{#DEPARTURE_HAS_DELAY}} <b>({{DEPARTURE_DELAY}})</b>{{/DEPARTURE_HAS_DELAY}}</span></td> + <td><a href="https://marudor.de/regional/{{STATION_ID}}?searchType=hafas">{{STATION_NAME}}</a></td> + <td><span>{{PLATFORM}}</span></td> + </tr> + {{/STOPOVERS}} + {{#REMARKS}} + <tr><td colspan="4"><span>{{.}}</span></td></tr> + {{/REMARKS}} + </tbody> + </table> + {{/IS_VEHICLE}} + {{/LEGS}} + + <div id="overlay" class="hidden"></div> + <script type="module" src="/assets/js/journeys.js" defer></script> + </body> +</html>
diff --git a/templates/journeys.tpl b/templates/journeys.tpl @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html lang="de"> + <head> + <title>Öffisearch</title> + <meta charset="UTF-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#ffffff"> + <meta name="description" content="Plan your public transport journeys"> + + <link rel="icon" type="image/png" sizes="64x64" href="/assets/favicon-64x64.png"> + <link rel="manifest" href="/assets/manifest.json"> + <link rel="stylesheet" type="text/css" href="/assets/style.css"> + + <link rel="modulepreload" href="/assets/js/lit-html.js"> + <link rel="modulepreload" href="/assets/js/helpers.js"> + </head> + <body class="journeys"> + <header> + <a class="back" href="/" title="{{LABEL_BACK}}">{{LABEL_BACK}}</a> + <h3>{{LABEL_FROM}}: {{FROM}}</h3> + <h3>{{LABEL_TO}}: {{TO}}</h3> + </header> + + <a class="loadMore flipped" href="?more=earlier" title="{{LABEL_EARLIER}}">{{LABEL_EARLIER}}</a> + + <table> + <thead> + <tr> + <th>{{LABEL_DEPARTURE}}</th> + <th>{{LABEL_ARRIVAL}}</th> + <th>{{LABEL_DURATION}}</th> + <th>{{LABEL_CHANGES}}</th> + <th>{{LABEL_PRODUCTS}}</th> + <th></th> + </tr> + </thead> + <tbody> + {{#JOURNEYS}} + <tr data-link="/{{REQ_ID}}/{{ID}}"> + <td><span>{{DEPARTURE}}{{#DEPARTURE_HAS_DELAY}} <b>({{DEPARTURE_DELAY}})</b>{{/DEPARTURE_HAS_DELAY}}</span></td> + <td><span>{{ARRIVAL}}{{#ARRIVAL_HAS_DELAY}} <b>({{ARRIVAL_DELAY}})</b>{{/ARRIVAL_HAS_DELAY}}</span></td> + <td><span>{{DURATION}}</span></td> + <td><span>{{CHANGES}}</span></td> + <td><span>{{PRODUCTS}}</span></td> + <td><a class="details-button" href="/{{REQ_ID}}/{{ID}}">{{LABEL_DETAILS}}</a></td> + </tr> + {{/JOURNEYS}} + </tbody> + </table> + + <a class="loadMore" href="?more=later" title="{{LABEL_LATER}}">{{LABEL_LATER}}</a> + + <div id="overlay" class="hidden"></div> + <script type="module" src="/assets/js/journeys.js" defer></script> + </body> +</html>
diff --git a/templates/search.tpl b/templates/search.tpl @@ -0,0 +1,133 @@ +<!DOCTYPE html> +<html lang="de"> + <head> + <title>Öffisearch</title> + <meta charset="UTF-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#ffffff"> + <meta name="description" content="Plan your public transport journeys"> + + <link rel="icon" type="image/png" sizes="64x64" href="/assets/favicon-64x64.png"> + <link rel="manifest" href="/assets/manifest.json"> + <link rel="stylesheet" type="text/css" href="/assets/style.css"> + + <link rel="modulepreload" href="/assets/js/lit-html.js"> + <link rel="modulepreload" href="/assets/js/helpers.js"> + </head> + <body class="center"> + <form method="post" class="search"> + <div class="title"> + <div class="logo"></div> + <h1>Öffisearch</h1> + </div> + <label for="from">{{LABEL_FROM}}:</label> + <input type="text" name="from" id="from" placeholder="{{LABEL_FROM}}" autocomplete="off" required> + <div class="suggestions" id="fromSuggestions"></div> + + <label for="to">{{LABEL_TO}}:</label> + <input type="text" name="to" id="to" placeholder="{{LABEL_TO}}" autocomplete="off" required> + <div class="suggestions" id="toSuggestions"></div> + + <div class="row"> + <label class="switch"> + <input type="checkbox" name="isarr"> + <span class="slider {{LABEL_LANG}}"></span> + <label for="isarr">{{LABEL_ISARR}} <br></label> + </label> + + <label for="date">{{LABEL_DATE}}:</label> + <input type="date" name="date" id="date" value="{{DATE}}" placeholder="{{LABEL_DATE}}" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" required> + + <label for="time"><br>{{LABEL_TIME}}:</label> + <input type="time" name="time" id="time" value="{{TIME}}" placeholder="{{LABEL_TIME}}" pattern="[0-9]{2}:[0-9]{2}" required> + </div> + + <div class="row"> + <span class="hidden">{{LABEL_PRODUCTS}}:</span> + <div class="selector"> + <input type="checkbox" id="national" name="national" checked> + <label for="national" title="{{LABEL_HIGHSPEED_TRAIN}}">{{LABEL_HIGHSPEED_TRAIN}}<br></label> + + <input type="checkbox" id="regional" name="regional" checked> + <label for="regional" title="{{LABEL_REGIONAL_TRAIN}}">{{LABEL_REGIONAL_TRAIN}}<br></label> + + <input type="checkbox" id="suburban" name="suburban" checked> + <label for="suburban" title="{{LABEL_SUBURBAN_TRAIN}}">{{LABEL_SUBURBAN_TRAIN}}<br></label> + + <input type="checkbox" id="subway" name="subway" checked> + <label for="subway" title="{{LABEL_SUBWAY}}">{{LABEL_SUBWAY}}<br></label> + + <input type="checkbox" id="tram" name="tram" checked> + <label for="tram" title="{{LABEL_TRAM}}">{{LABEL_TRAM}}<br></label> + + <input type="checkbox" id="bus" name="bus" checked> + <label for="bus" title="{{LABEL_BUS}}">{{LABEL_BUS}}<br></label> + + <input type="checkbox" id="ferry" name="ferry" checked> + <label for="ferry" title="{{LABEL_FERRY}}">{{LABEL_FERRY}}<br></label> + + <input type="checkbox" id="taxi" name="taxi" checked> + <label for="taxi" title="{{LABEL_TAXI}}">{{LABEL_TAXI}}<br></label> + </div> + + <span class="hidden">{{LABEL_ACCESSIBILITY}}:</span> + <div class="selector"> + <input type="radio" id="accessibilityNone" name="accessibility" value="none" checked> + <label for="accessibilityNone" title="{{LABEL_ACCESSIBILITY_NONE}}">{{LABEL_ACCESSIBILITY_NONE}}<br></label> + + <input type="radio" id="accessibilityPartial" name="accessibility" value="partial"> + <label for="accessibilityPartial" title="{{LABEL_ACCESSIBILITY_PARTIAL}}">{{LABEL_ACCESSIBILITY_PARTIAL}}<br></label> + + <input type="radio" id="accessibilityComplete" name="accessibility" value="complete"> + <label for="accessibilityComplete" title="{{LABEL_ACCESSIBILITY_FULL}}">{{LABEL_ACCESSIBILITY_FULL}}<br></label> + </div> + + <div class="selector"> + <div id="btn-swap" class="btn swap hidden"></div> + </div> + + <button class="btn go" type="submit" tabindex="0" id="go"> + {{LABEL_SEARCH}} + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71z"/></svg> + </button> + </div> + + <input type="checkbox" id="btn-history" class="btn history hidden"> + <label for="btn-history"></label> + <div class="history"> + <div class="row history"> + <div class="history from"> + <small>Von:</small><br> + Berlin Hbf, Tief</div> + <div class="history arrow">Berlin</div> + <div class="history to"> + <small>Nach:</small><br> + Kiel, Teplizer Allee</div> + </div> + <div class="row history"> + <div class="history from"> + <small>Von:</small><br> + Köln Ostbahnhof</div> + <div class="history arrow">Berlin</div> + <div class="history to"> + <small>Nach:</small><br> + Karlsruhe, Hbf</div> + </div> + <div class="row history"> + <div class="history from"> + <small>Von:</small><br> + Berlin Flughafen (BER)</div> + <div class="history arrow">Berlin</div> + <div class="history to"> + <small>Nach:</small><br> + Münschen Hbf</div> + </div> + </div> + <center>{{LABEL_LANGUAGE}}: <a href="/?lang=de">Deutsch</a> · <a href="/?lang=en">Englisch</a></center> + </form> + + <div id="overlay" class="hidden"></div> + <script type="module" src="/assets/js/search.js" defer></script> + </body> +</html>