diff --git a/404.php b/404.php index 5012025..05f2e69 100755 --- a/404.php +++ b/404.php @@ -1,16 +1,16 @@ +head("404.php"); ?>
- Erreur 404 + Le texte 'erreur 404' en train d'être mangé par des fourmies

La page à laquelle vous avez tenté d'accéder a été dévorée par une armée de fourmies affamées !



- + Retour à la page d'accueil diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..be3f7b2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU 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 + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/LICENSE.html b/LICENSE.html new file mode 100755 index 0000000..43a19ed --- /dev/null +++ b/LICENSE.html @@ -0,0 +1,748 @@ + + + + GNU AFFERO GENERAL PUBLIC LICENSE + + + + +

GNU AFFERO GENERAL PUBLIC LICENSE

+

Version 3, 19 November 2007

+ +

Copyright © 2007 Free Software Foundation, + Inc. <https://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

+ +

How to Apply These Terms to Your New Programs

+ +

If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms.

+ +

To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + state the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found.

+ +
    <one line to give the program's name and a brief idea of what it does.>
+        Copyright (C) <year>  <name of author>
+
+        This program is free software: you can redistribute it and/or modify
+        it under the terms of the GNU Affero General Public License as
+        published by the Free Software Foundation, either version 3 of the
+        License, or (at your option) any later version.
+
+        This program is distributed in the hope that it will be useful,
+        but WITHOUT ANY WARRANTY; without even the implied warranty of
+        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        GNU Affero General Public License for more details.
+
+        You should have received a copy of the GNU Affero General Public License
+        along with this program.  If not, see <https://www.gnu.org/licenses/>.
+    
+ +

Also add information on how to contact you by electronic and paper mail.

+ +

If your software can interact with users remotely through a computer + network, you should also make sure that it provides a way for users to + get its source. For example, if your program is a web application, its + interface could display a "Source" link that leads users to an archive + of the code. There are many ways you could offer source, and different + solutions will be better for different programs; see section 13 for the + specific requirements.

+ +

You should also get your employer (if you work as a programmer) or school, + if any, to sign a "copyright disclaimer" for the program, if necessary. + For more information on this, and how to apply and follow the GNU AGPL, see + <https://www.gnu.org/licenses/>.

+ + diff --git a/LICENSE.md b/LICENSE.md new file mode 100755 index 0000000..cba6f6a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,660 @@ +### GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU 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 + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for +the specific requirements. + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU AGPL, see . diff --git a/README.md b/README.md index 6c6c22b..645ecf8 100755 --- a/README.md +++ b/README.md @@ -1,29 +1,28 @@ # Présentation Voici le code source de mon site : . -Ce code est testé avec les dernières version de PHP et MySQL. +Il devrait fonctionner simplement avec la dernière version de PHP et un serveur Web. -Le site Web dépend d'une base de donnée ; pour faire fonctionner ce site vous devrez importer le fichier bdd.sql dans une base de donnée nommé _my_webapp_ et placer dans le dossier parent de _web_ un fichier _loginsbdd.php_ sous la forme : +Si vous avez besoin d'aide vous pouvez me contacter sur Mastodon : [@Miraty@social.antopie.org](https://social.antopie.org/@miraty) ou par mail : [miraty+gitea@antopie.org](mailto:miraty+gitea@antopie.org). - antopie.org. +# Bibliothèques utilisées -# Structure +Le dossier bibli contient des dépendances inclusent dans ce site. -- **web** - - **bibli** _Contient des bibliothèques diverses\* - - **fontello** _Le pack d'icones\* - - **sense3** _Les "publicités"\* - - **ubuntu** _Les polices d'Ubuntu utilisés sur le site\* - - **less.js** _Le JS pour compiler le code LESS en CSS\* - - **less.min.js** _Même chose en plus léger\* - - **nomalize.css** _Du CSS qui réinitalise le CSS pour que tous les navigateurs aient le même rendu\* - - **inc** _Les fichiers PHP qui ne sont pas des pages Web et qui sont inclus dans d'autres\* - - **media** _Image, vidéo, audio\* - - **README.md** _Le fichier Markdown que vous êtes en train de lire\* - - **bdd.sql** _Contient la structure de la base de données\* -- **loginsbdd.php** _Les identifiants de la base de données_ +Nom | Description | Licence | Source | Version +-------- | -------- | -------- | -------- +ubuntu | La police Ubuntu | Ubuntu Font License v1.0 | https://design.ubuntu.com/font/ +fontello | Pack d'icônes | SIL, BSD, MIT, CC-BY | http://fontello.com/ +lessphp | Compilateur Less en PHP | MIT ou GPLv3 | https://github.com/leafo/lessphp | 0.5.0 +sense3 | "Publicités" pour le libre | MIT | https://sense3.org/ +normalize.css | Standardisation de l'affichage | MIT | https://necolas.github.io/normalize.css/ | 8.0.1 + + +# Licence + +Le site web d'Antopie est un logiciel libre ; vous pouvez le diffuser et le modifier suivant les termes de la GNU Affero General Public License telle que publiée par la Free Software Foundation ; soit la version 3 de cette licence, soit (à votre convenance) une version ultérieure. + +Le site web d'Antopie est diffusé dans l’espoir qu’il sera utile, mais SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIALISATION ou d’ADÉQUATION À UN USAGE PARTICULIER. Voyez la GNU Affero General Public License pour plus de détails. + +Vous devriez avoir reçu une copie de la GNU Affero General Public License avec ce code. Sinon, consultez https://www.gnu.org/licenses/ \ No newline at end of file diff --git a/abcdefg/polices/harry.ttf b/abcdefg/polices/harry.ttf new file mode 100755 index 0000000..220e69a Binary files /dev/null and b/abcdefg/polices/harry.ttf differ diff --git a/abcdefg/polices/hocuspocus.ttf b/abcdefg/polices/hocuspocus.ttf new file mode 100755 index 0000000..48dc679 Binary files /dev/null and b/abcdefg/polices/hocuspocus.ttf differ diff --git a/abcdefg/polices/minecraft.ttf b/abcdefg/polices/minecraft.ttf new file mode 100755 index 0000000..85c1472 Binary files /dev/null and b/abcdefg/polices/minecraft.ttf differ diff --git a/abcdefg/polices/simplicity.ttf b/abcdefg/polices/simplicity.ttf new file mode 100755 index 0000000..b41c3cf Binary files /dev/null and b/abcdefg/polices/simplicity.ttf differ diff --git a/abcdefg/polices/splatch.ttf b/abcdefg/polices/splatch.ttf new file mode 100755 index 0000000..e98dff6 Binary files /dev/null and b/abcdefg/polices/splatch.ttf differ diff --git a/abcdefg/polices/traveling.ttf b/abcdefg/polices/traveling.ttf new file mode 100755 index 0000000..5d9d7c9 Binary files /dev/null and b/abcdefg/polices/traveling.ttf differ diff --git a/abcdefg/polices/ubuntu-title.ttf b/abcdefg/polices/ubuntu-title.ttf new file mode 100755 index 0000000..d1ad5ef Binary files /dev/null and b/abcdefg/polices/ubuntu-title.ttf differ diff --git a/abcdefg/polices/varsity.ttf b/abcdefg/polices/varsity.ttf new file mode 100755 index 0000000..c261600 Binary files /dev/null and b/abcdefg/polices/varsity.ttf differ diff --git a/aleatoire.php b/aleatoire.php deleted file mode 100755 index f3bd499..0000000 --- a/aleatoire.php +++ /dev/null @@ -1,63 +0,0 @@ - -

- Générateur Aléatoire -

- - - - -
- Bienvenue dans ce programme de choix aléatoire.
- Il permet de tirer au sort une possibilité parmis plusieurs.
- 1) Choisissez parmi combien de possibilités vous voulez tirer au sort.
- 2) Donner un nom à chaque possibilité.
- 3) Le programme vous donnera aléatoirement un des noms.
- -
- -
- - - - -
- - - Choix : -
- - - - -
- - - - - - - La valeur choisie aléatoirement est , numéro - - - - - - - - - - Erreur - - - diff --git a/antmusique.php b/antmusique.php deleted file mode 100755 index 5f7932b..0000000 --- a/antmusique.php +++ /dev/null @@ -1,44 +0,0 @@ - - - -

Les AntMusiques

-
- Les AntMusiques sont publiées sous LFTCQTV. -


- - Tout Télécharger (32 Mo) - -

- SHA256 : 06f48e208a4fb517a4d0be98a72ec5c54f662188eed8d9ddc219e3cfd3f93249 -

- SHA1 : 9967acdd91d61e86d9118d7e819ce73504235d91 -

- MD5 : e718e24cc38a95924fa96efd4be10c7c - - -
- -
-

- AntMusique : -

- -

- Télécharger -
- - -
- -
- - diff --git a/apropos.php b/apropos.php deleted file mode 100755 index 20323c7..0000000 --- a/apropos.php +++ /dev/null @@ -1,54 +0,0 @@ - - -

À propos

- -
- Site réalisé par Miraty et publié sous license libre CeCILL. -

- Accéder au code source sur Gitea -
-
-
- Les icones de ce site sont celles du pack Fontello. -
-
-
- Les "publicité" du site sont celles du projet sense3 créé par JosephK et diffusé sous licence MIT. -
-
-
- Merci à Zarkaa pour avoir réalisé le logo Ant et l'image de la page 404. -
- -
-
- -
- Ce site ne charge aucun contenu depuis des sites tiers et n'utilise que des technologies libres. -
- -

-
- - Me contacter : -

- Par E-mail : miraty<arrow-base>antopie<point>org -

- Sur Mastodon : @miraty@social.antopie.org - - - -
- - - - -

- -
- En partenariat avec wiziix et Madaho. -
- - - diff --git a/bdd.sql b/bdd.sql deleted file mode 100755 index 43a9fca..0000000 --- a/bdd.sql +++ /dev/null @@ -1,296 +0,0 @@ --- phpMyAdmin SQL Dump --- version 4.6.6deb5 --- https://www.phpmyadmin.net/ --- --- Client : localhost:3306 --- Généré le : Jeu 30 Août 2018 à 16:06 --- Version du serveur : 5.7.23-0ubuntu0.18.04.1 --- Version de PHP : 7.2.7-0ubuntu0.18.04.2 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; - --- --- Base de données : `anternet` --- - --- -------------------------------------------------------- - --- --- Structure de la table `articles` --- - -CREATE TABLE `articles` ( - `id` int(11) NOT NULL, - `titre` varchar(255) NOT NULL, - `pseudo` varchar(255) NOT NULL, - `article` text NOT NULL, - `moment` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- -------------------------------------------------------- - --- --- Structure de la table `codeFourmie` --- - -CREATE TABLE `codeFourmie` ( - `id` int(11) NOT NULL, - `codeSource` varchar(255) NOT NULL, - `codeCompilé` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Contenu de la table `codeFourmie` --- - -INSERT INTO `codeFourmie` (`id`, `codeSource`, `codeCompilé`) VALUES -(1, '#\\[bleu\\]#', ''), -(10, '#\\[vert\\]#', ''), -(11, '#\\[rouge\\]#', ''), -(12, '#\\[rose\\]#', ''), -(13, '#\\[cyan\\]#', ''), -(14, '#\\[gris\\]#', ''), -(15, '#\\[bleufoncé\\]#', ''), -(16, '#\\[cyanfoncé\\]#', ''), -(17, '#\\[jaunefoncé\\]#', ''), -(18, '#\\[rosefoncé\\]#', ''), -(19, '#\\[rougefoncé\\]#', ''), -(20, '#\\[boite\\]#', ''), -(21, '#\\[souligné\\]#', ''), -(22, '#\\[italique\\]#', ''), -(23, '#\\[grand\\]#', ''), -(24, '#\\[gras\\]#', ''), -(25, '#\\[orange\\]#', ''), -(26, '#\\[/lien\\]#', ' '), -(27, '#\\[lien\\|#', ''), -(29, '#\\[l\\]#', '
'), -(30, '#:\\)#', ''), -(31, '#\\[vertfoncé\\]#', ''); - --- -------------------------------------------------------- - --- --- Structure de la table `commentaires` --- - -CREATE TABLE `commentaires` ( - `id` int(11) NOT NULL, - `pseudo` varchar(60) NOT NULL, - `anonyme` varchar(3) NOT NULL, - `commentaire` text NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- -------------------------------------------------------- - --- --- Structure de la table `commentairesArticle` --- - -CREATE TABLE `commentairesArticle` ( - `id` int(11) NOT NULL, - `titre` varchar(255) NOT NULL, - `pseudo` varchar(255) NOT NULL, - `commentaire` text NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- -------------------------------------------------------- - --- --- Structure de la table `compte` --- - -CREATE TABLE `compte` ( - `id` int(11) NOT NULL, - `pseudo` varchar(60) NOT NULL, - `mdp` varchar(500) NOT NULL, - `confirmerLien` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- -------------------------------------------------------- - --- --- Structure de la table `navigateur` --- - -CREATE TABLE `navigateur` ( - `id` int(11) NOT NULL, - `nomDeCode` text NOT NULL, - `nomComplet` text NOT NULL, - `editeur` text NOT NULL, - `source` text NOT NULL, - `libre` text NOT NULL, - `bibliModule` text NOT NULL, - `description` text NOT NULL, - `monAvis` text NOT NULL, - `lienTelecharger` text NOT NULL, - `lienWikipedia` text NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Contenu de la table `navigateur` --- - -INSERT INTO `navigateur` (`id`, `nomDeCode`, `nomComplet`, `editeur`, `source`, `libre`, `bibliModule`, `description`, `monAvis`, `lienTelecharger`, `lienWikipedia`) VALUES -(1, 'cliqz', 'Cliqz', 'Cliqz', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Cliqz est navigateur intégrant un moteur de recherche directement dans la barre d\'adresse. Il suffit simplement de taper sa recherche, et les résultats s\'affichent instantanément en dessous. Il existe également sous forme d\'extension Firefox. ', 'C\'est cool', 'https://cliqz.com/en/desktop', 'https://de.wikipedia.org/wiki/Cliqz'), -(2, 'firefoxdeveloperedition', 'Firefox Developer Edition', 'Mozilla', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Firefox Developer Edition est un navigateur spécialisé pour le développement Web. ', 'C\'est Firefox mais pour les développeurs', 'https://www.mozilla.org/fr/firefox/developer/all/', 'https://fr.wikipedia.org/wiki/Mozilla_Firefox#Versions_de_d%C3%A9veloppement'), -(3, 'firefox', 'Firefox', 'Mozilla', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Firefox est le navigateur créé par Mozilla .', 'C\'est le meilleur navigateur !', 'https://www.mozilla.org/fr/firefox/', 'https://fr.wikipedia.org/wiki/Mozilla_Firefox'), -(4, 'tor', 'Tor', 'The Tor Project', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Tor Browser est un navigateur spécial : en plus de permettre de naviguer sur le Web \"banal\", il permet de se connecter au DarkNet Tor pour accéder au DarkWeb. Il inclut donc le \"VPN\" spécial, l\'extention HTTPS Everywhere et NoScript. ', 'C\'est utile à condition d\'avoir besoin d\'être anonyme. Sinon on pert juste du temps à charger les pages.', 'https://www.torproject.org/download/download-easy.html', 'https://fr.wikipedia.org/wiki/Tor_Browser'), -(5, 'waterfox', 'Waterfox', 'Alex Kontos', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Waterfox est un navigateur historiquement optimisé pour les processeurs 64 bits. ', 'C\'est une sotre de version semi-rétro de Firefox.', 'https://www.waterfoxproject.org/downloads', 'https://fr.wikipedia.org/wiki/Waterfox'), -(6, 'cyberfox', 'Cyberfox', ' 8pecxstudios', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Cyberfox est un navigateur basé sur Firefox qui combine le menu à droite et l\'ancien menu en haut à gauche.', 'C\'est pour les nostalgiques des anciennes version de Firefox.', 'https://cyberfox.8pecxstudios.com/', 'https://wikipedia.org/wiki/Cyberfox'), -(7, 'palemoon', 'Pale Moon', 'Moonchild Productions', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Pale Moon est un navigateur basé sur une ancienne version de Firefox (la 27.6.2). ', 'C\'est pour les TRÈS nostalgiques des TRÈS anciennes versions de Firefox', 'https://www.palemoon.org/', 'https://fr.wikipedia.org/wiki/Pale_Moon'), -(8, 'seamonkey', 'SeaMonkey', 'Mozilla', 'Firefox', 'icon-check-1 vert', 'Firefox', 'Sea Monkey est un projet abandonné par Mozilla, remplacé par Firefox et Thunderbird. Il incluait un navigateur Web, un éditeur HTMl, et un client d\'E-mails. ', 'C\'est très vieux et moche...', 'https://www.seamonkey-project.org/releases/', 'https://fr.wikipedia.org/wiki/SeaMonkey'), -(9, 'chromium', 'Chromium', 'Google', 'Chromium', 'icon-check-1 vert', 'Chrome Web Store', 'Chromium est le projet source de Chrome déstiné aux développeurs. ', 'C\'est utile si on veut utiliser Chrome mais en libre.', 'https://download-chromium.appspot.com/', 'https://fr.wikipedia.org/wiki/Chromium_(navigateur_web)'), -(10, 'chrome', 'Chrome', 'Google', 'Chromium', 'icon-cancel-3 rouge', 'Chrome Web Store', 'Chrome est le navigateur développé par Google. ', 'C\'est nul !', 'https://www.google.com/chrome/browser/desktop/index.html', 'https://fr.wikipedia.org/wiki/Google_Chrome'), -(11, 'vivaldi', 'Vivaldi', 'Vivaldi Technologies', 'Chromium', 'icon-cancel-3 rouge', 'Chrome Web Store', 'Vivaldi est le projet lancé par un ancien PDG de Opera. Il est basé sur Chromium, mais dispose d\'une interface graphique très belle, et de quelques petites fonctionnalitées interressantes. ', 'Il y a beaucoup de fonctionnalités et de personnalisation. ', 'https://vivaldi.com/', 'https://fr.wikipedia.org/wiki/Vivaldi_(navigateur_web)'), -(12, 'torch', 'Torch', 'Torch Media', 'Chromium', 'icon-cancel-3 rouge', 'Chrome Web Store', 'Torch est navigateur basé sur le projet Chromium. Il inclu plusieurs fonctionnalitées supplémentaires, comme un client torrent. ', 'Il y a des fonctionnalités inédites, mais peu utiles dans un navigateur Web.', 'https://torchbrowser.com/', 'https://en.wikipedia.org/wiki/Torch_(browser)'), -(13, 'brave', 'Brave', 'Brendan Eich', 'Chromium', 'icon-check-1 vert', 'Aucune', 'Un navigateur créé par un co-fondateur de Mozilla.', 'Protecteur de la vie privée mais avec des publicités', 'https://www.brave.com/', 'https://fr.wikipedia.org/wiki/Brave_(navigateur_web)'), -(14, 'midori', 'Midori', 'Christian Dywan', 'Midori', 'icon-check-1 vert', 'Aucune', 'Midori est un navigateur Web basé sur Chromium pour son moteur de rendu, mais graphiquement original. ', 'C\'est un peu vieillot', 'http://midori-browser.org/', 'https://fr.wikipedia.org/wiki/Midori'), -(15, 'maxthon', 'Maxthon', 'Maxthon', 'Internet Explorer', 'icon-cancel-3 rouge', 'Maxthon', 'Maxthon est un navigateur chinois qui fonctionne avec le moteur de rendu de Internet Explorer. ', 'C\'est original', 'http://fr.maxthon.com/', 'https://fr.wikipedia.org/wiki/Maxthon'), -(16, 'opera', 'Opera', 'Opera Software', 'Opera', 'icon-cancel-3 rouge', 'Opera', 'Opera est un navigateur Web indépendant. ', 'C\'est un navigateur totalement indépendant et original.', 'https://www.opera.com/fr/computer', 'https://fr.wikipedia.org/wiki/Opera'), -(17, 'yandex', 'Yandex Browser', 'Yandex', 'Chromium', 'icon-cancel-3 rouge', 'Opera', 'Yandex Browser est un navigateur web développé par l\'entreprise russe Yandex et basé sur le projet libre Chromium.', 'C\'est plutôt joli.', 'https://browser.yandex.com/', 'https://fr.wikipedia.org/wiki/Yandex_Browser'), -(18, 'internetexplorer', 'Internet Explorer', 'Microsoft', 'Internet Explorer', 'icon-cancel-3 rouge', 'Aucune', 'Internet Explorer est l\'un des plus vieux navigateurs Web. Il appartient à Microsoft et ne fonctionne que sur les ordinateurs sous Windows. ', 'Il a été très utilisé par le passé mais a été dépassé par d\'autres navigateurs.', 'Ben, non.', 'https://fr.wikipedia.org/wiki/Internet_Explorer'), -(19, 'edge', 'Edge', 'Microsoft', 'Internet Explorer', 'icon-cancel-3 rouge', 'Aucune', 'Edge est une nouvelle version graphique d\' Internet Explorer. Comme Internet Explorer, il appartient à Microsoft et ne fonctionne qu\'avec les ordinateurs sous Windows. ', 'C\'est forcément mieux qu\'Internet Explorer, mais ça reste nul.', 'https://fr.wikipedia.org/wiki/Microsoft_Edge', 'https://fr.wikipedia.org/wiki/Microsoft_Edge'), -(20, 'safari', 'Safari', 'Apple', 'Safari', 'icon-cancel-3 rouge', 'Aucune', 'Safari appartient à Apple et ne fonctionne que sur les ordinateurs sous Mac. ', '', 'Ben non, c\'est toujours pas ça !', 'https://fr.wikipedia.org/wiki/Safari_(navigateur_web)'), -(21, 'konqueror', 'Konqueror', 'KDE', 'Konqueror', 'icon-check-1 vert', 'Aucune', 'Le navigateur Web KDE, dont le moteur de rendu, KHTML sert de base à WebKit d\'Apple (utilisé dans Safari). Il peut aussi servir d\'explorateur de fichiers.', '', 'https://kubuntu.org', ''); - --- -------------------------------------------------------- - --- --- Structure de la table `pages` --- - -CREATE TABLE `pages` ( - `id` int(11) NOT NULL, - `adresse` varchar(255) NOT NULL, - `titre` varchar(255) NOT NULL, - `description` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Contenu de la table `pages` --- - -INSERT INTO `pages` (`id`, `adresse`, `titre`, `description`) VALUES -(1, 'index.php', 'Accueil', 'Page d\'accueil'), -(2, 'aleatoire.php', 'Tirage au sort', 'Programme de tirage au sort pour choisir aléatoirement quelque chose'), -(3, 'antmusique.php', 'AntMusiques', '10 AntMusiques créées par Miraty'), -(4, 'apropos.php', 'À propos', 'À propos du site Antopie.org/web'), -(5, 'cave.definition.php', 'Définitions', 'Des définitions simples concernant l\'informatique et internet'), -(6, 'cave.mdr.php', 'Moteurs de recherche', 'Liste et descriptions de moteurs de recherche'), -(7, 'cave.module.php', 'Modules complémentaires', 'Liste et descriptions de modules complémentaires (addons) pour Firefox'), -(8, 'cave.navigateur.php', 'Navigateurs Web', 'Liste et descriptions de navigateurs Web pour choisir le meilleur'), -(9, 'cave.os.php', 'Systèmes d\'exploitation', 'Liste et descriptions de systèmes d\'exploitation'), -(10, 'cgu.php', 'Conditions d\'utilisation', 'Conditions générales d\'utilisation de site Antopie.org'), -(11, 'commentaire.php', 'Espace commentaire', 'Espace commentaire pour envoyer un message à propos du site ou lire ceux des autres'), -(12, 'connexion.php', 'Connexion', 'Page de connexion à son compte Ant'), -(13, 'deconnexion.php', 'Déconnexion', 'Effacer sa session PHP (sa connexion à son compte)'), -(14, 'fourmiliere.php', 'La fourmilière', 'Un espace de blog pour n\'importe qui'), -(15, 'liste_des_nombres.php', 'Liste des nombres de 1 à 1 million', 'Un page recensant, ligne par ligne, le premier million des nombres entier'), -(16, 'monnavigateur.php', 'Mon navigateur', 'À propos de mon navigateur'), -(17, 'signup.php', 'Créer un compte Ant', 'Page de création de compte Ant'), -(18, 'confirmationlien.php', 'Confirmation de lien', 'Souhaitez-vous suivre ce lien ?'), -(19, '404.php', 'Erreur 404', 'Erreur 404'); - --- --- Index pour les tables exportées --- - --- --- Index pour la table `articles` --- -ALTER TABLE `articles` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `codeFourmie` --- -ALTER TABLE `codeFourmie` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `commentaires` --- -ALTER TABLE `commentaires` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `commentairesArticle` --- -ALTER TABLE `commentairesArticle` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `compte` --- -ALTER TABLE `compte` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `navigateur` --- -ALTER TABLE `navigateur` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- Index pour la table `pages` --- -ALTER TABLE `pages` - ADD PRIMARY KEY (`id`), - ADD KEY `id` (`id`); - --- --- AUTO_INCREMENT pour les tables exportées --- - --- --- AUTO_INCREMENT pour la table `articles` --- -ALTER TABLE `articles` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT pour la table `codeFourmie` --- -ALTER TABLE `codeFourmie` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32; --- --- AUTO_INCREMENT pour la table `commentaires` --- -ALTER TABLE `commentaires` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; --- --- AUTO_INCREMENT pour la table `commentairesArticle` --- -ALTER TABLE `commentairesArticle` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT pour la table `compte` --- -ALTER TABLE `compte` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42; --- --- AUTO_INCREMENT pour la table `navigateur` --- -ALTER TABLE `navigateur` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; --- --- AUTO_INCREMENT pour la table `pages` --- -ALTER TABLE `pages` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/bibli/animate.min.css b/bibli/animate.min.css new file mode 100644 index 0000000..e5ccfcf --- /dev/null +++ b/bibli/animate.min.css @@ -0,0 +1,11 @@ + @charset "UTF-8"; + +/*! + * animate.css -http://daneden.me/animate + * Version - 3.7.0 + * Licensed under the MIT license - http://opensource.org/licenses/MIT + * + * Copyright (c) 2018 Daniel Eden + */ + +@-webkit-keyframes bounce{0%,20%,53%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0);animation-timing-function:cubic-bezier(.215,.61,.355,1);transform:translateZ(0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-30px,0);animation-timing-function:cubic-bezier(.755,.05,.855,.06);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-15px,0);animation-timing-function:cubic-bezier(.755,.05,.855,.06);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0,-4px,0);transform:translate3d(0,-4px,0)}}@keyframes bounce{0%,20%,53%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0);animation-timing-function:cubic-bezier(.215,.61,.355,1);transform:translateZ(0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-30px,0);animation-timing-function:cubic-bezier(.755,.05,.855,.06);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-15px,0);animation-timing-function:cubic-bezier(.755,.05,.855,.06);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0,-4px,0);transform:translate3d(0,-4px,0)}}.bounce{-webkit-animation-name:bounce;-webkit-transform-origin:center bottom;animation-name:bounce;transform-origin:center bottom}@-webkit-keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}.flash{-webkit-animation-name:flash;animation-name:flash}@-webkit-keyframes pulse{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes pulse{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.pulse{-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes rubberBand{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes rubberBand{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.rubberBand{-webkit-animation-name:rubberBand;animation-name:rubberBand}@-webkit-keyframes shake{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}@keyframes shake{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}.shake{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes headShake{0%{-webkit-transform:translateX(0);transform:translateX(0)}6.5%{-webkit-transform:translateX(-6px) rotateY(-9deg);transform:translateX(-6px) rotateY(-9deg)}18.5%{-webkit-transform:translateX(5px) rotateY(7deg);transform:translateX(5px) rotateY(7deg)}31.5%{-webkit-transform:translateX(-3px) rotateY(-5deg);transform:translateX(-3px) rotateY(-5deg)}43.5%{-webkit-transform:translateX(2px) rotateY(3deg);transform:translateX(2px) rotateY(3deg)}50%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes headShake{0%{-webkit-transform:translateX(0);transform:translateX(0)}6.5%{-webkit-transform:translateX(-6px) rotateY(-9deg);transform:translateX(-6px) rotateY(-9deg)}18.5%{-webkit-transform:translateX(5px) rotateY(7deg);transform:translateX(5px) rotateY(7deg)}31.5%{-webkit-transform:translateX(-3px) rotateY(-5deg);transform:translateX(-3px) rotateY(-5deg)}43.5%{-webkit-transform:translateX(2px) rotateY(3deg);transform:translateX(2px) rotateY(3deg)}50%{-webkit-transform:translateX(0);transform:translateX(0)}}.headShake{-webkit-animation-name:headShake;-webkit-animation-timing-function:ease-in-out;animation-name:headShake;animation-timing-function:ease-in-out}@-webkit-keyframes swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}.swing{-webkit-animation-name:swing;-webkit-transform-origin:top center;animation-name:swing;transform-origin:top center}@-webkit-keyframes tada{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate(-3deg);transform:scale3d(.9,.9,.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(3deg);transform:scale3d(1.1,1.1,1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(-3deg);transform:scale3d(1.1,1.1,1.1) rotate(-3deg)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes tada{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate(-3deg);transform:scale3d(.9,.9,.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(3deg);transform:scale3d(1.1,1.1,1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(-3deg);transform:scale3d(1.1,1.1,1.1) rotate(-3deg)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.tada{-webkit-animation-name:tada;animation-name:tada}@-webkit-keyframes wobble{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-25%,0,0) rotate(-5deg);transform:translate3d(-25%,0,0) rotate(-5deg)}30%{-webkit-transform:translate3d(20%,0,0) rotate(3deg);transform:translate3d(20%,0,0) rotate(3deg)}45%{-webkit-transform:translate3d(-15%,0,0) rotate(-3deg);transform:translate3d(-15%,0,0) rotate(-3deg)}60%{-webkit-transform:translate3d(10%,0,0) rotate(2deg);transform:translate3d(10%,0,0) rotate(2deg)}75%{-webkit-transform:translate3d(-5%,0,0) rotate(-1deg);transform:translate3d(-5%,0,0) rotate(-1deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-25%,0,0) rotate(-5deg);transform:translate3d(-25%,0,0) rotate(-5deg)}30%{-webkit-transform:translate3d(20%,0,0) rotate(3deg);transform:translate3d(20%,0,0) rotate(3deg)}45%{-webkit-transform:translate3d(-15%,0,0) rotate(-3deg);transform:translate3d(-15%,0,0) rotate(-3deg)}60%{-webkit-transform:translate3d(10%,0,0) rotate(2deg);transform:translate3d(10%,0,0) rotate(2deg)}75%{-webkit-transform:translate3d(-5%,0,0) rotate(-1deg);transform:translate3d(-5%,0,0) rotate(-1deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble}@-webkit-keyframes jello{0%,11.1%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}22.2%{-webkit-transform:skewX(-12.5deg) skewY(-12.5deg);transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{-webkit-transform:skewX(6.25deg) skewY(6.25deg);transform:skewX(6.25deg) skewY(6.25deg)}44.4%{-webkit-transform:skewX(-3.125deg) skewY(-3.125deg);transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{-webkit-transform:skewX(1.5625deg) skewY(1.5625deg);transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{-webkit-transform:skewX(-.78125deg) skewY(-.78125deg);transform:skewX(-.78125deg) skewY(-.78125deg)}77.7%{-webkit-transform:skewX(.390625deg) skewY(.390625deg);transform:skewX(.390625deg) skewY(.390625deg)}88.8%{-webkit-transform:skewX(-.1953125deg) skewY(-.1953125deg);transform:skewX(-.1953125deg) skewY(-.1953125deg)}}@keyframes jello{0%,11.1%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}22.2%{-webkit-transform:skewX(-12.5deg) skewY(-12.5deg);transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{-webkit-transform:skewX(6.25deg) skewY(6.25deg);transform:skewX(6.25deg) skewY(6.25deg)}44.4%{-webkit-transform:skewX(-3.125deg) skewY(-3.125deg);transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{-webkit-transform:skewX(1.5625deg) skewY(1.5625deg);transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{-webkit-transform:skewX(-.78125deg) skewY(-.78125deg);transform:skewX(-.78125deg) skewY(-.78125deg)}77.7%{-webkit-transform:skewX(.390625deg) skewY(.390625deg);transform:skewX(.390625deg) skewY(.390625deg)}88.8%{-webkit-transform:skewX(-.1953125deg) skewY(-.1953125deg);transform:skewX(-.1953125deg) skewY(-.1953125deg)}}.jello{-webkit-animation-name:jello;-webkit-transform-origin:center;animation-name:jello;transform-origin:center}@-webkit-keyframes heartBeat{0%{-webkit-transform:scale(1);transform:scale(1)}14%{-webkit-transform:scale(1.3);transform:scale(1.3)}28%{-webkit-transform:scale(1);transform:scale(1)}42%{-webkit-transform:scale(1.3);transform:scale(1.3)}70%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes heartBeat{0%{-webkit-transform:scale(1);transform:scale(1)}14%{-webkit-transform:scale(1.3);transform:scale(1.3)}28%{-webkit-transform:scale(1);transform:scale(1)}42%{-webkit-transform:scale(1.3);transform:scale(1.3)}70%{-webkit-transform:scale(1);transform:scale(1)}}.heartBeat{-webkit-animation-duration:1.3s;-webkit-animation-name:heartBeat;-webkit-animation-timing-function:ease-in-out;animation-duration:1.3s;animation-name:heartBeat;animation-timing-function:ease-in-out}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{-webkit-transform:scale3d(1.03,1.03,1.03);opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{-webkit-transform:scaleX(1);opacity:1;transform:scaleX(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{-webkit-transform:scale3d(1.03,1.03,1.03);opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{-webkit-transform:scaleX(1);opacity:1;transform:scaleX(1)}}.bounceIn{-webkit-animation-duration:.75s;-webkit-animation-name:bounceIn;animation-duration:.75s;animation-name:bounceIn}@-webkit-keyframes bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(0,-3000px,0);opacity:0;transform:translate3d(0,-3000px,0)}60%{-webkit-transform:translate3d(0,25px,0);opacity:1;transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(0,-3000px,0);opacity:0;transform:translate3d(0,-3000px,0)}60%{-webkit-transform:translate3d(0,25px,0);opacity:1;transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.bounceInDown{-webkit-animation-name:bounceInDown;animation-name:bounceInDown}@-webkit-keyframes bounceInLeft{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(-3000px,0,0);opacity:0;transform:translate3d(-3000px,0,0)}60%{-webkit-transform:translate3d(25px,0,0);opacity:1;transform:translate3d(25px,0,0)}75%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}90%{-webkit-transform:translate3d(5px,0,0);transform:translate3d(5px,0,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInLeft{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(-3000px,0,0);opacity:0;transform:translate3d(-3000px,0,0)}60%{-webkit-transform:translate3d(25px,0,0);opacity:1;transform:translate3d(25px,0,0)}75%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}90%{-webkit-transform:translate3d(5px,0,0);transform:translate3d(5px,0,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.bounceInLeft{-webkit-animation-name:bounceInLeft;animation-name:bounceInLeft}@-webkit-keyframes bounceInRight{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(3000px,0,0);opacity:0;transform:translate3d(3000px,0,0)}60%{-webkit-transform:translate3d(-25px,0,0);opacity:1;transform:translate3d(-25px,0,0)}75%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}90%{-webkit-transform:translate3d(-5px,0,0);transform:translate3d(-5px,0,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInRight{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(3000px,0,0);opacity:0;transform:translate3d(3000px,0,0)}60%{-webkit-transform:translate3d(-25px,0,0);opacity:1;transform:translate3d(-25px,0,0)}75%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}90%{-webkit-transform:translate3d(-5px,0,0);transform:translate3d(-5px,0,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.bounceInRight{-webkit-animation-name:bounceInRight;animation-name:bounceInRight}@-webkit-keyframes bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(0,3000px,0);opacity:0;transform:translate3d(0,3000px,0)}60%{-webkit-transform:translate3d(0,-20px,0);opacity:1;transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:translate3d(0,3000px,0);opacity:0;transform:translate3d(0,3000px,0)}60%{-webkit-transform:translate3d(0,-20px,0);opacity:1;transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.bounceInUp{-webkit-animation-name:bounceInUp;animation-name:bounceInUp}@-webkit-keyframes bounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{-webkit-transform:scale3d(1.1,1.1,1.1);opacity:1;transform:scale3d(1.1,1.1,1.1)}to{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}}@keyframes bounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{-webkit-transform:scale3d(1.1,1.1,1.1);opacity:1;transform:scale3d(1.1,1.1,1.1)}to{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}}.bounceOut{-webkit-animation-duration:.75s;-webkit-animation-name:bounceOut;animation-duration:.75s;animation-name:bounceOut}@-webkit-keyframes bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{-webkit-transform:translate3d(0,-20px,0);opacity:1;transform:translate3d(0,-20px,0)}to{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}}@keyframes bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{-webkit-transform:translate3d(0,-20px,0);opacity:1;transform:translate3d(0,-20px,0)}to{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}}.bounceOutDown{-webkit-animation-name:bounceOutDown;animation-name:bounceOutDown}@-webkit-keyframes bounceOutLeft{20%{-webkit-transform:translate3d(20px,0,0);opacity:1;transform:translate3d(20px,0,0)}to{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes bounceOutLeft{20%{-webkit-transform:translate3d(20px,0,0);opacity:1;transform:translate3d(20px,0,0)}to{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}}.bounceOutLeft{-webkit-animation-name:bounceOutLeft;animation-name:bounceOutLeft}@-webkit-keyframes bounceOutRight{20%{-webkit-transform:translate3d(-20px,0,0);opacity:1;transform:translate3d(-20px,0,0)}to{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}}@keyframes bounceOutRight{20%{-webkit-transform:translate3d(-20px,0,0);opacity:1;transform:translate3d(-20px,0,0)}to{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}}.bounceOutRight{-webkit-animation-name:bounceOutRight;animation-name:bounceOutRight}@-webkit-keyframes bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{-webkit-transform:translate3d(0,20px,0);opacity:1;transform:translate3d(0,20px,0)}to{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{-webkit-transform:translate3d(0,20px,0);opacity:1;transform:translate3d(0,20px,0)}to{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}}.bounceOutUp{-webkit-animation-name:bounceOutUp;animation-name:bounceOutUp}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes fadeInDown{0%{-webkit-transform:translate3d(0,-100%,0);opacity:0;transform:translate3d(0,-100%,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInDown{0%{-webkit-transform:translate3d(0,-100%,0);opacity:0;transform:translate3d(0,-100%,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}@-webkit-keyframes fadeInDownBig{0%{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInDownBig{0%{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInDownBig{-webkit-animation-name:fadeInDownBig;animation-name:fadeInDownBig}@-webkit-keyframes fadeInLeft{0%{-webkit-transform:translate3d(-100%,0,0);opacity:0;transform:translate3d(-100%,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInLeft{0%{-webkit-transform:translate3d(-100%,0,0);opacity:0;transform:translate3d(-100%,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}@-webkit-keyframes fadeInLeftBig{0%{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInLeftBig{0%{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}@-webkit-keyframes fadeInRight{0%{-webkit-transform:translate3d(100%,0,0);opacity:0;transform:translate3d(100%,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInRight{0%{-webkit-transform:translate3d(100%,0,0);opacity:0;transform:translate3d(100%,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}@-webkit-keyframes fadeInRightBig{0%{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInRightBig{0%{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInRightBig{-webkit-animation-name:fadeInRightBig;animation-name:fadeInRightBig}@-webkit-keyframes fadeInUp{0%{-webkit-transform:translate3d(0,100%,0);opacity:0;transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInUp{0%{-webkit-transform:translate3d(0,100%,0);opacity:0;transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}@-webkit-keyframes fadeInUpBig{0%{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes fadeInUpBig{0%{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.fadeInUpBig{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOutDown{0%{opacity:1}to{-webkit-transform:translate3d(0,100%,0);opacity:0;transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{-webkit-transform:translate3d(0,100%,0);opacity:0;transform:translate3d(0,100%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}@-webkit-keyframes fadeOutDownBig{0%{opacity:1}to{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}}@keyframes fadeOutDownBig{0%{opacity:1}to{-webkit-transform:translate3d(0,2000px,0);opacity:0;transform:translate3d(0,2000px,0)}}.fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}@-webkit-keyframes fadeOutLeft{0%{opacity:1}to{-webkit-transform:translate3d(-100%,0,0);opacity:0;transform:translate3d(-100%,0,0)}}@keyframes fadeOutLeft{0%{opacity:1}to{-webkit-transform:translate3d(-100%,0,0);opacity:0;transform:translate3d(-100%,0,0)}}.fadeOutLeft{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1}to{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes fadeOutLeftBig{0%{opacity:1}to{-webkit-transform:translate3d(-2000px,0,0);opacity:0;transform:translate3d(-2000px,0,0)}}.fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}@-webkit-keyframes fadeOutRight{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0);opacity:0;transform:translate3d(100%,0,0)}}@keyframes fadeOutRight{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0);opacity:0;transform:translate3d(100%,0,0)}}.fadeOutRight{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}@-webkit-keyframes fadeOutRightBig{0%{opacity:1}to{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}}@keyframes fadeOutRightBig{0%{opacity:1}to{-webkit-transform:translate3d(2000px,0,0);opacity:0;transform:translate3d(2000px,0,0)}}.fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}@-webkit-keyframes fadeOutUp{0%{opacity:1}to{-webkit-transform:translate3d(0,-100%,0);opacity:0;transform:translate3d(0,-100%,0)}}@keyframes fadeOutUp{0%{opacity:1}to{-webkit-transform:translate3d(0,-100%,0);opacity:0;transform:translate3d(0,-100%,0)}}.fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}@-webkit-keyframes fadeOutUpBig{0%{opacity:1}to{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes fadeOutUpBig{0%{opacity:1}to{-webkit-transform:translate3d(0,-2000px,0);opacity:0;transform:translate3d(0,-2000px,0)}}.fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}@-webkit-keyframes flip{0%{-webkit-animation-timing-function:ease-out;-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);animation-timing-function:ease-out;transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn)}40%{-webkit-animation-timing-function:ease-out;-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);animation-timing-function:ease-out;transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg)}50%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);animation-timing-function:ease-in;transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg)}80%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);animation-timing-function:ease-in;transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg)}to{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);animation-timing-function:ease-in;transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg)}}@keyframes flip{0%{-webkit-animation-timing-function:ease-out;-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);animation-timing-function:ease-out;transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn)}40%{-webkit-animation-timing-function:ease-out;-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);animation-timing-function:ease-out;transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg)}50%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);animation-timing-function:ease-in;transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg)}80%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);animation-timing-function:ease-in;transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg)}to{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);animation-timing-function:ease-in;transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg)}}.animated.flip{-webkit-animation-name:flip;-webkit-backface-visibility:visible;animation-name:flip;backface-visibility:visible}@-webkit-keyframes flipInX{0%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0;transform:perspective(400px) rotateX(90deg)}40%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in;transform:perspective(400px) rotateX(-20deg)}60%{-webkit-transform:perspective(400px) rotateX(10deg);opacity:1;transform:perspective(400px) rotateX(10deg)}80%{-webkit-transform:perspective(400px) rotateX(-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes flipInX{0%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0;transform:perspective(400px) rotateX(90deg)}40%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in;transform:perspective(400px) rotateX(-20deg)}60%{-webkit-transform:perspective(400px) rotateX(10deg);opacity:1;transform:perspective(400px) rotateX(10deg)}80%{-webkit-transform:perspective(400px) rotateX(-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}.flipInX{-webkit-animation-name:flipInX;-webkit-backface-visibility:visible!important;animation-name:flipInX;backface-visibility:visible!important}@-webkit-keyframes flipInY{0%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateY(90deg);animation-timing-function:ease-in;opacity:0;transform:perspective(400px) rotateY(90deg)}40%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateY(-20deg);animation-timing-function:ease-in;transform:perspective(400px) rotateY(-20deg)}60%{-webkit-transform:perspective(400px) rotateY(10deg);opacity:1;transform:perspective(400px) rotateY(10deg)}80%{-webkit-transform:perspective(400px) rotateY(-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes flipInY{0%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateY(90deg);animation-timing-function:ease-in;opacity:0;transform:perspective(400px) rotateY(90deg)}40%{-webkit-animation-timing-function:ease-in;-webkit-transform:perspective(400px) rotateY(-20deg);animation-timing-function:ease-in;transform:perspective(400px) rotateY(-20deg)}60%{-webkit-transform:perspective(400px) rotateY(10deg);opacity:1;transform:perspective(400px) rotateY(10deg)}80%{-webkit-transform:perspective(400px) rotateY(-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}.flipInY{-webkit-animation-name:flipInY;-webkit-backface-visibility:visible!important;animation-name:flipInY;backface-visibility:visible!important}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateX(-20deg);opacity:1;transform:perspective(400px) rotateX(-20deg)}to{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0;transform:perspective(400px) rotateX(90deg)}}@keyframes flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateX(-20deg);opacity:1;transform:perspective(400px) rotateX(-20deg)}to{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0;transform:perspective(400px) rotateX(90deg)}}.flipOutX{-webkit-animation-duration:.75s;-webkit-animation-name:flipOutX;-webkit-backface-visibility:visible!important;animation-duration:.75s;animation-name:flipOutX;backface-visibility:visible!important}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateY(-15deg);opacity:1;transform:perspective(400px) rotateY(-15deg)}to{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0;transform:perspective(400px) rotateY(90deg)}}@keyframes flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateY(-15deg);opacity:1;transform:perspective(400px) rotateY(-15deg)}to{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0;transform:perspective(400px) rotateY(90deg)}}.flipOutY{-webkit-animation-duration:.75s;-webkit-animation-name:flipOutY;-webkit-backface-visibility:visible!important;animation-duration:.75s;animation-name:flipOutY;backface-visibility:visible!important}@-webkit-keyframes lightSpeedIn{0%{-webkit-transform:translate3d(100%,0,0) skewX(-30deg);opacity:0;transform:translate3d(100%,0,0) skewX(-30deg)}60%{-webkit-transform:skewX(20deg);opacity:1;transform:skewX(20deg)}80%{-webkit-transform:skewX(-5deg);transform:skewX(-5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes lightSpeedIn{0%{-webkit-transform:translate3d(100%,0,0) skewX(-30deg);opacity:0;transform:translate3d(100%,0,0) skewX(-30deg)}60%{-webkit-transform:skewX(20deg);opacity:1;transform:skewX(20deg)}80%{-webkit-transform:skewX(-5deg);transform:skewX(-5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.lightSpeedIn{-webkit-animation-name:lightSpeedIn;-webkit-animation-timing-function:ease-out;animation-name:lightSpeedIn;animation-timing-function:ease-out}@-webkit-keyframes lightSpeedOut{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) skewX(30deg);opacity:0;transform:translate3d(100%,0,0) skewX(30deg)}}@keyframes lightSpeedOut{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) skewX(30deg);opacity:0;transform:translate3d(100%,0,0) skewX(30deg)}}.lightSpeedOut{-webkit-animation-name:lightSpeedOut;-webkit-animation-timing-function:ease-in;animation-name:lightSpeedOut;animation-timing-function:ease-in}@-webkit-keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);-webkit-transform-origin:center;opacity:0;transform:rotate(-200deg);transform-origin:center}to{-webkit-transform:translateZ(0);-webkit-transform-origin:center;opacity:1;transform:translateZ(0);transform-origin:center}}@keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);-webkit-transform-origin:center;opacity:0;transform:rotate(-200deg);transform-origin:center}to{-webkit-transform:translateZ(0);-webkit-transform-origin:center;opacity:1;transform:translateZ(0);transform-origin:center}}.rotateIn{-webkit-animation-name:rotateIn;animation-name:rotateIn}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(-45deg);transform-origin:left bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:left bottom;opacity:1;transform:translateZ(0);transform-origin:left bottom}}@keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(-45deg);transform-origin:left bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:left bottom;opacity:1;transform:translateZ(0);transform-origin:left bottom}}.rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform:rotate(45deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(45deg);transform-origin:right bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:right bottom;opacity:1;transform:translateZ(0);transform-origin:right bottom}}@keyframes rotateInDownRight{0%{-webkit-transform:rotate(45deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(45deg);transform-origin:right bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:right bottom;opacity:1;transform:translateZ(0);transform-origin:right bottom}}.rotateInDownRight{-webkit-animation-name:rotateInDownRight;animation-name:rotateInDownRight}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform:rotate(45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(45deg);transform-origin:left bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:left bottom;opacity:1;transform:translateZ(0);transform-origin:left bottom}}@keyframes rotateInUpLeft{0%{-webkit-transform:rotate(45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(45deg);transform-origin:left bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:left bottom;opacity:1;transform:translateZ(0);transform-origin:left bottom}}.rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(-90deg);transform-origin:right bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:right bottom;opacity:1;transform:translateZ(0);transform-origin:right bottom}}@keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(-90deg);transform-origin:right bottom}to{-webkit-transform:translateZ(0);-webkit-transform-origin:right bottom;opacity:1;transform:translateZ(0);transform-origin:right bottom}}.rotateInUpRight{-webkit-animation-name:rotateInUpRight;animation-name:rotateInUpRight}@-webkit-keyframes rotateOut{0%{-webkit-transform-origin:center;opacity:1;transform-origin:center}to{-webkit-transform:rotate(200deg);-webkit-transform-origin:center;opacity:0;transform:rotate(200deg);transform-origin:center}}@keyframes rotateOut{0%{-webkit-transform-origin:center;opacity:1;transform-origin:center}to{-webkit-transform:rotate(200deg);-webkit-transform-origin:center;opacity:0;transform:rotate(200deg);transform-origin:center}}.rotateOut{-webkit-animation-name:rotateOut;animation-name:rotateOut}@-webkit-keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;opacity:1;transform-origin:left bottom}to{-webkit-transform:rotate(45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(45deg);transform-origin:left bottom}}@keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;opacity:1;transform-origin:left bottom}to{-webkit-transform:rotate(45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(45deg);transform-origin:left bottom}}.rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft}@-webkit-keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;opacity:1;transform-origin:right bottom}to{-webkit-transform:rotate(-45deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(-45deg);transform-origin:right bottom}}@keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;opacity:1;transform-origin:right bottom}to{-webkit-transform:rotate(-45deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(-45deg);transform-origin:right bottom}}.rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight}@-webkit-keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;opacity:1;transform-origin:left bottom}to{-webkit-transform:rotate(-45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(-45deg);transform-origin:left bottom}}@keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;opacity:1;transform-origin:left bottom}to{-webkit-transform:rotate(-45deg);-webkit-transform-origin:left bottom;opacity:0;transform:rotate(-45deg);transform-origin:left bottom}}.rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft}@-webkit-keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;opacity:1;transform-origin:right bottom}to{-webkit-transform:rotate(90deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(90deg);transform-origin:right bottom}}@keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;opacity:1;transform-origin:right bottom}to{-webkit-transform:rotate(90deg);-webkit-transform-origin:right bottom;opacity:0;transform:rotate(90deg);transform-origin:right bottom}}.rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight}@-webkit-keyframes hinge{0%{-webkit-animation-timing-function:ease-in-out;-webkit-transform-origin:top left;animation-timing-function:ease-in-out;transform-origin:top left}20%,60%{-webkit-animation-timing-function:ease-in-out;-webkit-transform:rotate(80deg);-webkit-transform-origin:top left;animation-timing-function:ease-in-out;transform:rotate(80deg);transform-origin:top left}40%,80%{-webkit-animation-timing-function:ease-in-out;-webkit-transform:rotate(60deg);-webkit-transform-origin:top left;animation-timing-function:ease-in-out;opacity:1;transform:rotate(60deg);transform-origin:top left}to{-webkit-transform:translate3d(0,700px,0);opacity:0;transform:translate3d(0,700px,0)}}@keyframes hinge{0%{-webkit-animation-timing-function:ease-in-out;-webkit-transform-origin:top left;animation-timing-function:ease-in-out;transform-origin:top left}20%,60%{-webkit-animation-timing-function:ease-in-out;-webkit-transform:rotate(80deg);-webkit-transform-origin:top left;animation-timing-function:ease-in-out;transform:rotate(80deg);transform-origin:top left}40%,80%{-webkit-animation-timing-function:ease-in-out;-webkit-transform:rotate(60deg);-webkit-transform-origin:top left;animation-timing-function:ease-in-out;opacity:1;transform:rotate(60deg);transform-origin:top left}to{-webkit-transform:translate3d(0,700px,0);opacity:0;transform:translate3d(0,700px,0)}}.hinge{-webkit-animation-duration:2s;-webkit-animation-name:hinge;animation-duration:2s;animation-name:hinge}@-webkit-keyframes jackInTheBox{0%{-webkit-transform:scale(.1) rotate(30deg);-webkit-transform-origin:center bottom;opacity:0;transform:scale(.1) rotate(30deg);transform-origin:center bottom}50%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}70%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{-webkit-transform:scale(1);opacity:1;transform:scale(1)}}@keyframes jackInTheBox{0%{-webkit-transform:scale(.1) rotate(30deg);-webkit-transform-origin:center bottom;opacity:0;transform:scale(.1) rotate(30deg);transform-origin:center bottom}50%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}70%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{-webkit-transform:scale(1);opacity:1;transform:scale(1)}}.jackInTheBox{-webkit-animation-name:jackInTheBox;animation-name:jackInTheBox}@-webkit-keyframes rollIn{0%{-webkit-transform:translate3d(-100%,0,0) rotate(-120deg);opacity:0;transform:translate3d(-100%,0,0) rotate(-120deg)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}@keyframes rollIn{0%{-webkit-transform:translate3d(-100%,0,0) rotate(-120deg);opacity:0;transform:translate3d(-100%,0,0) rotate(-120deg)}to{-webkit-transform:translateZ(0);opacity:1;transform:translateZ(0)}}.rollIn{-webkit-animation-name:rollIn;animation-name:rollIn}@-webkit-keyframes rollOut{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) rotate(120deg);opacity:0;transform:translate3d(100%,0,0) rotate(120deg)}}@keyframes rollOut{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) rotate(120deg);opacity:0;transform:translate3d(100%,0,0) rotate(120deg)}}.rollOut{-webkit-animation-name:rollOut;animation-name:rollOut}@-webkit-keyframes zoomIn{0%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes zoomIn{0%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}.zoomIn{-webkit-animation-name:zoomIn;animation-name:zoomIn}@-webkit-keyframes zoomInDown{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0)}}@keyframes zoomInDown{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0)}}.zoomInDown{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes zoomInLeft{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(10px,0,0)}}@keyframes zoomInLeft{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(10px,0,0)}}.zoomInLeft{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes zoomInRight{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(1000px,0,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(-10px,0,0)}}@keyframes zoomInRight{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(1000px,0,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(-10px,0,0)}}.zoomInRight{-webkit-animation-name:zoomInRight;animation-name:zoomInRight}@-webkit-keyframes zoomInUp{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,1000px,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0)}}@keyframes zoomInUp{0%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,1000px,0)}60%{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0)}}.zoomInUp{-webkit-animation-name:zoomInUp;animation-name:zoomInUp}@-webkit-keyframes zoomOut{0%{opacity:1}50%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes zoomOut{0%{opacity:1}50%{-webkit-transform:scale3d(.3,.3,.3);opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.zoomOut{-webkit-animation-name:zoomOut;animation-name:zoomOut}@-webkit-keyframes zoomOutDown{40%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0)}to{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);-webkit-transform-origin:center bottom;animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);transform-origin:center bottom}}@keyframes zoomOutDown{40%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0)}to{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);-webkit-transform-origin:center bottom;animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);transform-origin:center bottom}}.zoomOutDown{-webkit-animation-name:zoomOutDown;animation-name:zoomOutDown}@-webkit-keyframes zoomOutLeft{40%{-webkit-transform:scale3d(.475,.475,.475) translate3d(42px,0,0);opacity:1;transform:scale3d(.475,.475,.475) translate3d(42px,0,0)}to{-webkit-transform:scale(.1) translate3d(-2000px,0,0);-webkit-transform-origin:left center;opacity:0;transform:scale(.1) translate3d(-2000px,0,0);transform-origin:left center}}@keyframes zoomOutLeft{40%{-webkit-transform:scale3d(.475,.475,.475) translate3d(42px,0,0);opacity:1;transform:scale3d(.475,.475,.475) translate3d(42px,0,0)}to{-webkit-transform:scale(.1) translate3d(-2000px,0,0);-webkit-transform-origin:left center;opacity:0;transform:scale(.1) translate3d(-2000px,0,0);transform-origin:left center}}.zoomOutLeft{-webkit-animation-name:zoomOutLeft;animation-name:zoomOutLeft}@-webkit-keyframes zoomOutRight{40%{-webkit-transform:scale3d(.475,.475,.475) translate3d(-42px,0,0);opacity:1;transform:scale3d(.475,.475,.475) translate3d(-42px,0,0)}to{-webkit-transform:scale(.1) translate3d(2000px,0,0);-webkit-transform-origin:right center;opacity:0;transform:scale(.1) translate3d(2000px,0,0);transform-origin:right center}}@keyframes zoomOutRight{40%{-webkit-transform:scale3d(.475,.475,.475) translate3d(-42px,0,0);opacity:1;transform:scale3d(.475,.475,.475) translate3d(-42px,0,0)}to{-webkit-transform:scale(.1) translate3d(2000px,0,0);-webkit-transform-origin:right center;opacity:0;transform:scale(.1) translate3d(2000px,0,0);transform-origin:right center}}.zoomOutRight{-webkit-animation-name:zoomOutRight;animation-name:zoomOutRight}@-webkit-keyframes zoomOutUp{40%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0)}to{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);-webkit-transform-origin:center bottom;animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);transform-origin:center bottom}}@keyframes zoomOutUp{40%{-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19);opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0)}to{-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);-webkit-transform-origin:center bottom;animation-timing-function:cubic-bezier(.175,.885,.32,1);opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);transform-origin:center bottom}}.zoomOutUp{-webkit-animation-name:zoomOutUp;animation-name:zoomOutUp}@-webkit-keyframes slideInDown{0%{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInDown{0%{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.slideInDown{-webkit-animation-name:slideInDown;animation-name:slideInDown}@-webkit-keyframes slideInLeft{0%{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInLeft{0%{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.slideInLeft{-webkit-animation-name:slideInLeft;animation-name:slideInLeft}@-webkit-keyframes slideInRight{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInRight{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.slideInRight{-webkit-animation-name:slideInRight;animation-name:slideInRight}@-webkit-keyframes slideInUp{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInUp{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.slideInUp{-webkit-animation-name:slideInUp;animation-name:slideInUp}@-webkit-keyframes slideOutDown{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:hidden}}@keyframes slideOutDown{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:hidden}}.slideOutDown{-webkit-animation-name:slideOutDown;animation-name:slideOutDown}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:hidden}}@keyframes slideOutLeft{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:hidden}}.slideOutLeft{-webkit-animation-name:slideOutLeft;animation-name:slideOutLeft}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:hidden}}@keyframes slideOutRight{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:hidden}}.slideOutRight{-webkit-animation-name:slideOutRight;animation-name:slideOutRight}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:hidden}}@keyframes slideOutUp{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:hidden}}.slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}.animated{-webkit-animation-duration:1s;-webkit-animation-fill-mode:both;animation-duration:1s;animation-fill-mode:both}.animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animated.delay-1s{-webkit-animation-delay:1s;animation-delay:1s}.animated.delay-2s{-webkit-animation-delay:2s;animation-delay:2s}.animated.delay-3s{-webkit-animation-delay:3s;animation-delay:3s}.animated.delay-4s{-webkit-animation-delay:4s;animation-delay:4s}.animated.delay-5s{-webkit-animation-delay:5s;animation-delay:5s}.animated.fast{-webkit-animation-duration:.8s;animation-duration:.8s}.animated.faster{-webkit-animation-duration:.5s;animation-duration:.5s}.animated.slow{-webkit-animation-duration:2s;animation-duration:2s}.animated.slower{-webkit-animation-duration:3s;animation-duration:3s}@media (prefers-reduced-motion),(print){.animated{-webkit-animation:unset!important;-webkit-transition:none!important;animation:unset!important;transition:none!important}} diff --git a/bibli/fontello/LICENSE.txt b/bibli/fontello/LICENSE similarity index 100% rename from bibli/fontello/LICENSE.txt rename to bibli/fontello/LICENSE diff --git a/bibli/fontello/README.txt b/bibli/fontello/README.txt deleted file mode 100755 index beaab33..0000000 --- a/bibli/fontello/README.txt +++ /dev/null @@ -1,75 +0,0 @@ -This webfont is generated by http://fontello.com open source project. - - -================================================================================ -Please, note, that you should obey original font licenses, used to make this -webfont pack. Details available in LICENSE.txt file. - -- Usually, it's enough to publish content of LICENSE.txt file somewhere on your - site in "About" section. - -- If your project is open-source, usually, it will be ok to make LICENSE.txt - file publicly available in your repository. - -- Fonts, used in Fontello, don't require a clickable link on your site. - But any kind of additional authors crediting is welcome. -================================================================================ - - -Comments on archive content ---------------------------- - -- /font/* - fonts in different formats - -- /css/* - different kinds of css, for all situations. Should be ok with - twitter bootstrap. Also, you can skip style and assign icon classes - directly to text elements, if you don't mind about IE7. - -- demo.html - demo file, to show your webfont content - -- LICENSE.txt - license info about source fonts, used to build your one. - -- config.json - keeps your settings. You can import it back into fontello - anytime, to continue your work - - -Why so many CSS files ? ------------------------ - -Because we like to fit all your needs :) - -- basic file, .css - is usually enough, it contains @font-face - and character code definitions - -- *-ie7.css - if you need IE7 support, but still don't wish to put char codes - directly into html - -- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face - rules, but still wish to benefit from css generation. That can be very - convenient for automated asset build systems. When you need to update font - - no need to manually edit files, just override old version with archive - content. See fontello source code for examples. - -- *-embedded.css - basic css file, but with embedded WOFF font, to avoid - CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain. - We strongly recommend to resolve this issue by `Access-Control-Allow-Origin` - server headers. But if you ok with dirty hack - this file is for you. Note, - that data url moved to separate @font-face to avoid problems with konami.pattern.length) { + konami.input = konami.input.substr((konami.input.length - konami.pattern.length)); + } + if (konami.input === konami.pattern) { + konami.code(konami._currentLink); + konami.input = ''; + e.preventDefault(); + return false; + } + }, + load: function (link) { + this._currentLink = link; + this.addEvent(document, "keydown", this.keydownHandler, this); + this.iphone.load(link); + }, + unload: function () { + this.removeEvent(document, 'keydown', this.keydownHandler); + this.iphone.unload(); + }, + code: function (link) { + window.location = link + }, + iphone: { + start_x: 0, + start_y: 0, + stop_x: 0, + stop_y: 0, + tap: false, + capture: false, + orig_keys: "", + keys: ["UP", "UP", "DOWN", "DOWN", "LEFT", "RIGHT", "LEFT", "RIGHT", "TAP", "TAP"], + input: [], + code: function (link) { + konami.code(link); + }, + touchmoveHandler: function (e) { + if (e.touches.length === 1 && konami.iphone.capture === true) { + var touch = e.touches[0]; + konami.iphone.stop_x = touch.pageX; + konami.iphone.stop_y = touch.pageY; + konami.iphone.tap = false; + konami.iphone.capture = false; + konami.iphone.check_direction(); + } + }, + touchendHandler: function () { + konami.iphone.input.push(konami.iphone.check_direction()); + + if (konami.iphone.input.length > konami.iphone.keys.length) konami.iphone.input.shift(); + + if (konami.iphone.input.length === konami.iphone.keys.length) { + var match = true; + for (var i = 0; i < konami.iphone.keys.length; i++) { + if (konami.iphone.input[i] !== konami.iphone.keys[i]) { + match = false; + } + } + if (match) { + konami.iphone.code(konami._currentLink); + } + } + }, + touchstartHandler: function (e) { + konami.iphone.start_x = e.changedTouches[0].pageX; + konami.iphone.start_y = e.changedTouches[0].pageY; + konami.iphone.tap = true; + konami.iphone.capture = true; + }, + load: function (link) { + this.orig_keys = this.keys; + konami.addEvent(document, "touchmove", this.touchmoveHandler); + konami.addEvent(document, "touchend", this.touchendHandler, false); + konami.addEvent(document, "touchstart", this.touchstartHandler); + }, + unload: function () { + konami.removeEvent(document, 'touchmove', this.touchmoveHandler); + konami.removeEvent(document, 'touchend', this.touchendHandler); + konami.removeEvent(document, 'touchstart', this.touchstartHandler); + }, + check_direction: function () { + x_magnitude = Math.abs(this.start_x - this.stop_x); + y_magnitude = Math.abs(this.start_y - this.stop_y); + x = ((this.start_x - this.stop_x) < 0) ? "RIGHT" : "LEFT"; + y = ((this.start_y - this.stop_y) < 0) ? "DOWN" : "UP"; + result = (x_magnitude > y_magnitude) ? x : y; + result = (this.tap === true) ? "TAP" : result; + return result; + } + } + } + + typeof callback === "string" && konami.load(callback); + if (typeof callback === "function") { + konami.code = callback; + konami.load(); + } + + return konami; +}; + + +if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { + module.exports = Konami; +} else { + if (typeof define === 'function' && define.amd) { + define([], function() { + return Konami; + }); + } else { + window.Konami = Konami; + } +} diff --git a/bibli/less.js b/bibli/less.js deleted file mode 100755 index fda7fac..0000000 --- a/bibli/less.js +++ /dev/null @@ -1,12522 +0,0 @@ -/*! - * Less - Leaner CSS v3.7.1 - * http://lesscss.org - * - * Copyright (c) 2009-2018, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - */ - - /** * @license Apache-2.0 - */ - -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.less = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) || - options.isFileProtocol ? 'development' - : 'production'); - - var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash); - if (dumpLineNumbers) { - options.dumpLineNumbers = dumpLineNumbers[1]; - } - - if (options.useFileCache === undefined) { - options.useFileCache = true; - } - - if (options.onReady === undefined) { - options.onReady = true; - } -}; - -},{"./browser":3,"./utils":11}],2:[function(require,module,exports){ -/** - * Kicks off less and compiles any stylesheets - * used in the browser distributed version of less - * to kick-start less using the browser api - */ -/* global window, document */ - -// TODO - consider switching this out for a recommendation for this polyfill? -// -// Browsers have good Promise support -require('promise/polyfill'); - -var options = require('../less/default-options')(); - -if (window.less) { - for (key in window.less) { - if (window.less.hasOwnProperty(key)) { - options[key] = window.less[key]; - } - } -} -require('./add-default-options')(window, options); - -options.plugins = options.plugins || []; - -if (window.LESS_PLUGINS) { - options.plugins = options.plugins.concat(window.LESS_PLUGINS); -} - -var less = module.exports = require('./index')(window, options); - -window.less = less; - -var css, head, style; - -// Always restore page visibility -function resolveOrReject(data) { - if (data.filename) { - console.warn(data); - } - if (!options.async) { - head.removeChild(style); - } -} - -if (options.onReady) { - if (/!watch/.test(window.location.hash)) { - less.watch(); - } - // Simulate synchronous stylesheet loading by hiding page rendering - if (!options.async) { - css = 'body { display: none !important }'; - head = document.head || document.getElementsByTagName('head')[0]; - style = document.createElement('style'); - - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - head.appendChild(style); - } - less.registerStylesheetsImmediately(); - less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject); -} - -},{"../less/default-options":16,"./add-default-options":1,"./index":8,"promise/polyfill":103}],3:[function(require,module,exports){ -var utils = require('./utils'); -module.exports = { - createCSS: function (document, styles, sheet) { - // Strip the query-string - var href = sheet.href || ''; - - // If there is no title set, use the filename, minus the extension - var id = 'less:' + (sheet.title || utils.extractId(href)); - - // If this has already been inserted into the DOM, we may need to replace it - var oldStyleNode = document.getElementById(id); - var keepOldStyleNode = false; - - // Create a new stylesheet node for insertion or (if necessary) replacement - var styleNode = document.createElement('style'); - styleNode.setAttribute('type', 'text/css'); - if (sheet.media) { - styleNode.setAttribute('media', sheet.media); - } - styleNode.id = id; - - if (!styleNode.styleSheet) { - styleNode.appendChild(document.createTextNode(styles)); - - // If new contents match contents of oldStyleNode, don't replace oldStyleNode - keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 && - oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue); - } - - var head = document.getElementsByTagName('head')[0]; - - // If there is no oldStyleNode, just append; otherwise, only append if we need - // to replace oldStyleNode with an updated stylesheet - if (oldStyleNode === null || keepOldStyleNode === false) { - var nextEl = sheet && sheet.nextSibling || null; - if (nextEl) { - nextEl.parentNode.insertBefore(styleNode, nextEl); - } else { - head.appendChild(styleNode); - } - } - if (oldStyleNode && keepOldStyleNode === false) { - oldStyleNode.parentNode.removeChild(oldStyleNode); - } - - // For IE. - // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash. - // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head - if (styleNode.styleSheet) { - try { - styleNode.styleSheet.cssText = styles; - } catch (e) { - throw new Error('Couldn\'t reassign styleSheet.cssText.'); - } - } - }, - currentScript: function(window) { - var document = window.document; - return document.currentScript || (function() { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - })(); - } -}; - -},{"./utils":11}],4:[function(require,module,exports){ -// Cache system is a bit outdated and could do with work - -module.exports = function(window, options, logger) { - var cache = null; - if (options.env !== 'development') { - try { - cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage; - } catch (_) {} - } - return { - setCSS: function(path, lastModified, modifyVars, styles) { - if (cache) { - logger.info('saving ' + path + ' to cache.'); - try { - cache.setItem(path, styles); - cache.setItem(path + ':timestamp', lastModified); - if (modifyVars) { - cache.setItem(path + ':vars', JSON.stringify(modifyVars)); - } - } catch (e) { - // TODO - could do with adding more robust error handling - logger.error('failed to save "' + path + '" to local storage for caching.'); - } - } - }, - getCSS: function(path, webInfo, modifyVars) { - var css = cache && cache.getItem(path), - timestamp = cache && cache.getItem(path + ':timestamp'), - vars = cache && cache.getItem(path + ':vars'); - - modifyVars = modifyVars || {}; - vars = vars || "{}"; // if not set, treat as the JSON representation of an empty object - - if (timestamp && webInfo.lastModified && - (new Date(webInfo.lastModified).valueOf() === - new Date(timestamp).valueOf()) && - JSON.stringify(modifyVars) === vars) { - // Use local copy - return css; - } - } - }; -}; - -},{}],5:[function(require,module,exports){ -var utils = require('./utils'), - browser = require('./browser'); - -module.exports = function(window, less, options) { - - function errorHTML(e, rootHref) { - var id = 'less-error-message:' + utils.extractId(rootHref || ''); - var template = '
  • {content}
  • '; - var elem = window.document.createElement('div'), timer, content, errors = []; - var filename = e.filename || rootHref; - var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1]; - - elem.id = id; - elem.className = 'less-error-message'; - - content = '

    ' + (e.type || 'Syntax') + 'Error: ' + (e.message || 'There is an error in your .less file') + - '

    ' + '
    ' + - '
      ' + errors.join('') + '
    '; - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += '
    Stack Trace
    ' + e.stack.split('\n').slice(1).join('
    '); - } - elem.innerHTML = content; - - // CSS for error messages - browser.createCSS(window.document, [ - '.less-error-message ul, .less-error-message li {', - 'list-style-type: none;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'margin: 0;', - '}', - '.less-error-message label {', - 'font-size: 12px;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'color: #cc7777;', - '}', - '.less-error-message pre {', - 'color: #dd6666;', - 'padding: 4px 0;', - 'margin: 0;', - 'display: inline-block;', - '}', - '.less-error-message pre.line {', - 'color: #ff0000;', - '}', - '.less-error-message h3 {', - 'font-size: 20px;', - 'font-weight: bold;', - 'padding: 15px 0 5px 0;', - 'margin: 0;', - '}', - '.less-error-message a {', - 'color: #10a', - '}', - '.less-error-message .error {', - 'color: red;', - 'font-weight: bold;', - 'padding-bottom: 2px;', - 'border-bottom: 1px dashed red;', - '}' - ].join('\n'), { title: 'error-message' }); - - elem.style.cssText = [ - 'font-family: Arial, sans-serif', - 'border: 1px solid #e00', - 'background-color: #eee', - 'border-radius: 5px', - '-webkit-border-radius: 5px', - '-moz-border-radius: 5px', - 'color: #e00', - 'padding: 15px', - 'margin-bottom: 15px' - ].join(';'); - - if (options.env === 'development') { - timer = setInterval(function () { - var document = window.document, - body = document.body; - if (body) { - if (document.getElementById(id)) { - body.replaceChild(elem, document.getElementById(id)); - } else { - body.insertBefore(elem, body.firstChild); - } - clearInterval(timer); - } - }, 10); - } - } - - function removeErrorHTML(path) { - var node = window.document.getElementById('less-error-message:' + utils.extractId(path)); - if (node) { - node.parentNode.removeChild(node); - } - } - - function removeErrorConsole(path) { - // no action - } - - function removeError(path) { - if (!options.errorReporting || options.errorReporting === 'html') { - removeErrorHTML(path); - } else if (options.errorReporting === 'console') { - removeErrorConsole(path); - } else if (typeof options.errorReporting === 'function') { - options.errorReporting('remove', path); - } - } - - function errorConsole(e, rootHref) { - var template = '{line} {content}'; - var filename = e.filename || rootHref; - var errors = []; - var content = (e.type || 'Syntax') + 'Error: ' + (e.message || 'There is an error in your .less file') + - ' in ' + filename; - - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += ' on line ' + e.line + ', column ' + (e.column + 1) + ':\n' + - errors.join('\n'); - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += '\nStack Trace\n' + e.stack; - } - less.logger.error(content); - } - - function error(e, rootHref) { - if (!options.errorReporting || options.errorReporting === 'html') { - errorHTML(e, rootHref); - } else if (options.errorReporting === 'console') { - errorConsole(e, rootHref); - } else if (typeof options.errorReporting === 'function') { - options.errorReporting('add', e, rootHref); - } - } - - return { - add: error, - remove: removeError - }; -}; - -},{"./browser":3,"./utils":11}],6:[function(require,module,exports){ -/* global window, XMLHttpRequest */ - -module.exports = function(options, logger) { - - var AbstractFileManager = require('../less/environment/abstract-file-manager.js'); - - var fileCache = {}; - - // TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load - var FileManager = function() { - }; - - FileManager.prototype = new AbstractFileManager(); - - FileManager.prototype.alwaysMakePathsAbsolute = function alwaysMakePathsAbsolute() { - return true; - }; - FileManager.prototype.join = function join(basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return this.extractUrlParts(laterPath, basePath).path; - }; - FileManager.prototype.doXHR = function doXHR(url, type, callback, errback) { - - var xhr = new XMLHttpRequest(); - var async = options.isFileProtocol ? options.fileAsync : true; - - if (typeof xhr.overrideMimeType === 'function') { - xhr.overrideMimeType('text/css'); - } - logger.debug('XHR: Getting \'' + url + '\''); - xhr.open('GET', url, async); - xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5'); - xhr.send(null); - - function handleResponse(xhr, callback, errback) { - if (xhr.status >= 200 && xhr.status < 300) { - callback(xhr.responseText, - xhr.getResponseHeader('Last-Modified')); - } else if (typeof errback === 'function') { - errback(xhr.status, url); - } - } - - if (options.isFileProtocol && !options.fileAsync) { - if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) { - callback(xhr.responseText); - } else { - errback(xhr.status, url); - } - } else if (async) { - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - handleResponse(xhr, callback, errback); - } - }; - } else { - handleResponse(xhr, callback, errback); - } - }; - FileManager.prototype.supports = function(filename, currentDirectory, options, environment) { - return true; - }; - - FileManager.prototype.clearFileCache = function() { - fileCache = {}; - }; - - FileManager.prototype.loadFile = function loadFile(filename, currentDirectory, options, environment) { - // TODO: Add prefix support like less-node? - // What about multiple paths? - - if (currentDirectory && !this.isPathAbsolute(filename)) { - filename = currentDirectory + filename; - } - - filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename; - - options = options || {}; - - // sheet may be set to the stylesheet for the initial load or a collection of properties including - // some context variables for imports - var hrefParts = this.extractUrlParts(filename, window.location.href); - var href = hrefParts.url; - var self = this; - - return new Promise(function(resolve, reject) { - if (options.useFileCache && fileCache[href]) { - try { - var lessText = fileCache[href]; - return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }}); - } catch (e) { - return reject({ filename: href, message: 'Error loading file ' + href + ' error was ' + e.message }); - } - } - - self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { - // per file cache - fileCache[href] = data; - - // Use remote copy (re-parse) - resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified }}); - }, function doXHRError(status, url) { - reject({ type: 'File', message: '\'' + url + '\' wasn\'t found (' + status + ')', href: href }); - }); - }); - }; - - return FileManager; -}; - -},{"../less/environment/abstract-file-manager.js":17}],7:[function(require,module,exports){ -module.exports = function() { - - var functionRegistry = require('./../less/functions/function-registry'); - - function imageSize() { - throw { - type: 'Runtime', - message: 'Image size functions are not supported in browser version of less' - }; - } - - var imageFunctions = { - 'image-size': function(filePathNode) { - imageSize(this, filePathNode); - return -1; - }, - 'image-width': function(filePathNode) { - imageSize(this, filePathNode); - return -1; - }, - 'image-height': function(filePathNode) { - imageSize(this, filePathNode); - return -1; - } - }; - - functionRegistry.addMultiple(imageFunctions); -}; - -},{"./../less/functions/function-registry":26}],8:[function(require,module,exports){ -// -// index.js -// Should expose the additional browser functions on to the less object -// -var addDataAttr = require('./utils').addDataAttr, - browser = require('./browser'); - -module.exports = function(window, options) { - var document = window.document; - var less = require('../less')(); - - less.options = options; - var environment = less.environment, - FileManager = require('./file-manager')(options, less.logger), - fileManager = new FileManager(); - environment.addFileManager(fileManager); - less.FileManager = FileManager; - less.PluginLoader = require('./plugin-loader'); - - require('./log-listener')(less, options); - var errors = require('./error-reporting')(window, less, options); - var cache = less.cache = options.cache || require('./cache')(window, options, less.logger); - require('./image-size')(less.environment); - - // Setup user functions - Deprecate? - if (options.functions) { - less.functions.functionRegistry.addMultiple(options.functions); - } - - var typePattern = /^text\/(x-)?less$/; - - function clone(obj) { - return JSON.parse(JSON.stringify(obj || {})); - } - - // only really needed for phantom - function bind(func, thisArg) { - var curryArgs = Array.prototype.slice.call(arguments, 2); - return function() { - var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); - return func.apply(thisArg, args); - }; - } - - function loadStyles(modifyVars) { - var styles = document.getElementsByTagName('style'), - style; - - for (var i = 0; i < styles.length; i++) { - style = styles[i]; - if (style.type.match(typePattern)) { - var instanceOptions = clone(options); - instanceOptions.modifyVars = modifyVars; - var lessText = style.innerHTML || ''; - instanceOptions.filename = document.location.href.replace(/#.*$/, ''); - - /* jshint loopfunc:true */ - // use closure to store current style - less.render(lessText, instanceOptions, - bind(function(style, e, result) { - if (e) { - errors.add(e, 'inline'); - } else { - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = result.css; - } else { - style.innerHTML = result.css; - } - } - }, null, style)); - } - } - } - - function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { - - var instanceOptions = clone(options); - addDataAttr(instanceOptions, sheet); - instanceOptions.mime = sheet.type; - - if (modifyVars) { - instanceOptions.modifyVars = modifyVars; - } - - function loadInitialFileCallback(loadedFile) { - - var data = loadedFile.contents, - path = loadedFile.filename, - webInfo = loadedFile.webInfo; - - var newFileInfo = { - currentDirectory: fileManager.getPath(path), - filename: path, - rootFilename: path, - relativeUrls: instanceOptions.relativeUrls}; - - newFileInfo.entryPath = newFileInfo.currentDirectory; - newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory; - - if (webInfo) { - webInfo.remaining = remaining; - - var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars); - if (!reload && css) { - webInfo.local = true; - callback(null, css, data, sheet, webInfo, path); - return; - } - - } - - // TODO add tests around how this behaves when reloading - errors.remove(path); - - instanceOptions.rootFileInfo = newFileInfo; - less.render(data, instanceOptions, function(e, result) { - if (e) { - e.href = path; - callback(e); - } else { - cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css); - callback(null, result.css, data, sheet, webInfo, path); - } - }); - } - - fileManager.loadFile(sheet.href, null, instanceOptions, environment) - .then(function(loadedFile) { - loadInitialFileCallback(loadedFile); - }).catch(function(err) { - console.log(err); - callback(err); - }); - - } - - function loadStyleSheets(callback, reload, modifyVars) { - for (var i = 0; i < less.sheets.length; i++) { - loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars); - } - } - - function initRunningMode() { - if (less.env === 'development') { - less.watchTimer = setInterval(function () { - if (less.watchMode) { - fileManager.clearFileCache(); - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - } else if (css) { - browser.createCSS(window.document, css, sheet); - } - }); - } - }, options.poll); - } - } - - // - // Watch mode - // - less.watch = function () { - if (!less.watchMode ) { - less.env = 'development'; - initRunningMode(); - } - this.watchMode = true; - return true; - }; - - less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; }; - - // - // Synchronously get all tags with the 'rel' attribute set to - // "stylesheet/less". - // - less.registerStylesheetsImmediately = function() { - var links = document.getElementsByTagName('link'); - less.sheets = []; - - for (var i = 0; i < links.length; i++) { - if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) && - (links[i].type.match(typePattern)))) { - less.sheets.push(links[i]); - } - } - }; - - // - // Asynchronously get all tags with the 'rel' attribute set to - // "stylesheet/less", returning a Promise. - // - less.registerStylesheets = function() { - return new Promise(function(resolve, reject) { - less.registerStylesheetsImmediately(); - resolve(); - }); - }; - - // - // With this function, it's possible to alter variables and re-render - // CSS without reloading less-files - // - less.modifyVars = function(record) { - return less.refresh(true, record, false); - }; - - less.refresh = function (reload, modifyVars, clearFileCache) { - if ((reload || clearFileCache) && clearFileCache !== false) { - fileManager.clearFileCache(); - } - return new Promise(function (resolve, reject) { - var startTime, endTime, totalMilliseconds, remainingSheets; - startTime = endTime = new Date(); - - // Set counter for remaining unprocessed sheets - remainingSheets = less.sheets.length; - - if (remainingSheets === 0) { - - endTime = new Date(); - totalMilliseconds = endTime - startTime; - less.logger.info('Less has finished and no sheets were loaded.'); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - - } else { - // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - reject(e); - return; - } - if (webInfo.local) { - less.logger.info('Loading ' + sheet.href + ' from cache.'); - } else { - less.logger.info('Rendered ' + sheet.href + ' successfully.'); - } - browser.createCSS(window.document, css, sheet); - less.logger.info('CSS for ' + sheet.href + ' generated in ' + (new Date() - endTime) + 'ms'); - - // Count completed sheet - remainingSheets--; - - // Check if the last remaining sheet was processed and then call the promise - if (remainingSheets === 0) { - totalMilliseconds = new Date() - startTime; - less.logger.info('Less has finished. CSS generated in ' + totalMilliseconds + 'ms'); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - } - endTime = new Date(); - }, reload, modifyVars); - } - - loadStyles(modifyVars); - }); - }; - - less.refreshStyles = loadStyles; - return less; -}; - -},{"../less":36,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./image-size":7,"./log-listener":9,"./plugin-loader":10,"./utils":11}],9:[function(require,module,exports){ -module.exports = function(less, options) { - - var logLevel_debug = 4, - logLevel_info = 3, - logLevel_warn = 2, - logLevel_error = 1; - - // The amount of logging in the javascript console. - // 3 - Debug, information and errors - // 2 - Information and errors - // 1 - Errors - // 0 - None - // Defaults to 2 - options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error); - - if (!options.loggers) { - options.loggers = [{ - debug: function(msg) { - if (options.logLevel >= logLevel_debug) { - console.log(msg); - } - }, - info: function(msg) { - if (options.logLevel >= logLevel_info) { - console.log(msg); - } - }, - warn: function(msg) { - if (options.logLevel >= logLevel_warn) { - console.warn(msg); - } - }, - error: function(msg) { - if (options.logLevel >= logLevel_error) { - console.error(msg); - } - } - }]; - } - for (var i = 0; i < options.loggers.length; i++) { - less.logger.addListener(options.loggers[i]); - } -}; - -},{}],10:[function(require,module,exports){ -// TODO: Add tests for browser @plugin -/* global window */ - -var AbstractPluginLoader = require('../less/environment/abstract-plugin-loader.js'); - -/** - * Browser Plugin Loader - */ -var PluginLoader = function(less) { - this.less = less; - // Should we shim this.require for browser? Probably not? -}; - -PluginLoader.prototype = new AbstractPluginLoader(); - -PluginLoader.prototype.loadPlugin = function(filename, basePath, context, environment, fileManager) { - return new Promise(function(fulfill, reject) { - fileManager.loadFile(filename, basePath, context, environment) - .then(fulfill).catch(reject); - }); -}; - -module.exports = PluginLoader; - - -},{"../less/environment/abstract-plugin-loader.js":18}],11:[function(require,module,exports){ -module.exports = { - extractId: function(href) { - return href.replace(/^[a-z-]+:\/+?[^\/]+/, '') // Remove protocol & domain - .replace(/[\?\&]livereload=\w+/, '') // Remove LiveReload cachebuster - .replace(/^\//, '') // Remove root / - .replace(/\.[a-zA-Z]+$/, '') // Remove simple extension - .replace(/[^\.\w-]+/g, '-') // Replace illegal characters - .replace(/\./g, ':'); // Replace dots with colons(for valid id) - }, - addDataAttr: function(options, tag) { - for (var opt in tag.dataset) { - if (tag.dataset.hasOwnProperty(opt)) { - if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') { - options[opt] = tag.dataset[opt]; - } else { - try { - options[opt] = JSON.parse(tag.dataset[opt]); - } - catch (_) {} - } - } - } - } -}; - -},{}],12:[function(require,module,exports){ -var contexts = {}; -module.exports = contexts; -var MATH = require('./math-constants'); - -var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) { - if (!original) { return; } - - for (var i = 0; i < propertiesToCopy.length; i++) { - if (original.hasOwnProperty(propertiesToCopy[i])) { - destination[propertiesToCopy[i]] = original[propertiesToCopy[i]]; - } - } -}; - -/* - parse is used whilst parsing - */ -var parseCopyProperties = [ - // options - 'paths', // option - unmodified - paths to search for imports on - 'relativeUrls', // option - whether to adjust URL's to be relative - 'rootpath', // option - rootpath to append to URL's - 'strictImports', // option - - 'insecure', // option - whether to allow imports from insecure ssl hosts - 'dumpLineNumbers', // option - whether to dump line numbers - 'compress', // option - whether to compress - 'syncImport', // option - whether to import synchronously - 'chunkInput', // option - whether to chunk input. more performant but causes parse issues. - 'mime', // browser only - mime type for sheet import - 'useFileCache', // browser only - whether to use the per file session cache - // context - 'processImports', // option & context - whether to process imports. if false then imports will not be imported. - // Used by the import manager to stop multiple import visitors being created. - 'pluginManager' // Used as the plugin manager for the session -]; - -contexts.Parse = function(options) { - copyFromOriginal(options, this, parseCopyProperties); - - if (typeof this.paths === 'string') { this.paths = [this.paths]; } -}; - -var evalCopyProperties = [ - 'paths', // additional include paths - 'compress', // whether to compress - 'ieCompat', // whether to enforce IE compatibility (IE8 data-uri) - 'math', // whether math has to be within parenthesis - 'strictUnits', // whether units need to evaluate correctly - 'sourceMap', // whether to output a source map - 'importMultiple', // whether we are currently importing multiple copies - 'urlArgs', // whether to add args into url tokens - 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false - 'pluginManager', // Used as the plugin manager for the session - 'importantScope' // used to bubble up !important statements -]; - -contexts.Eval = function(options, frames) { - copyFromOriginal(options, this, evalCopyProperties); - - if (typeof this.paths === 'string') { this.paths = [this.paths]; } - - this.frames = frames || []; - this.importantScope = this.importantScope || []; -}; - -contexts.Eval.prototype.enterCalc = function () { - if (!this.calcStack) { - this.calcStack = []; - } - this.calcStack.push(true); - this.inCalc = true; -}; - -contexts.Eval.prototype.exitCalc = function () { - this.calcStack.pop(); - if (!this.calcStack) { - this.inCalc = false; - } -}; - -contexts.Eval.prototype.inParenthesis = function () { - if (!this.parensStack) { - this.parensStack = []; - } - this.parensStack.push(true); -}; - -contexts.Eval.prototype.outOfParenthesis = function () { - this.parensStack.pop(); -}; - -contexts.Eval.prototype.inCalc = false; -contexts.Eval.prototype.mathOn = true; -contexts.Eval.prototype.isMathOn = function (op) { - if (!this.mathOn) { - return false; - } - if (op === '/' && this.math !== MATH.ALWAYS && (!this.parensStack || !this.parensStack.length)) { - return false; - } - if (this.math > MATH.PARENS_DIVISION) { - return this.parensStack && this.parensStack.length; - } - return true; -}; - -contexts.Eval.prototype.isPathRelative = function (path) { - return !/^(?:[a-z-]+:|\/|#)/i.test(path); -}; - -contexts.Eval.prototype.normalizePath = function( path ) { - var - segments = path.split('/').reverse(), - segment; - - path = []; - while (segments.length !== 0 ) { - segment = segments.pop(); - switch ( segment ) { - case '.': - break; - case '..': - if ((path.length === 0) || (path[path.length - 1] === '..')) { - path.push( segment ); - } else { - path.pop(); - } - break; - default: - path.push( segment ); - break; - } - } - - return path.join('/'); -}; - -// todo - do the same for the toCSS ? - -},{"./math-constants":39}],13:[function(require,module,exports){ -module.exports = { - 'aliceblue':'#f0f8ff', - 'antiquewhite':'#faebd7', - 'aqua':'#00ffff', - 'aquamarine':'#7fffd4', - 'azure':'#f0ffff', - 'beige':'#f5f5dc', - 'bisque':'#ffe4c4', - 'black':'#000000', - 'blanchedalmond':'#ffebcd', - 'blue':'#0000ff', - 'blueviolet':'#8a2be2', - 'brown':'#a52a2a', - 'burlywood':'#deb887', - 'cadetblue':'#5f9ea0', - 'chartreuse':'#7fff00', - 'chocolate':'#d2691e', - 'coral':'#ff7f50', - 'cornflowerblue':'#6495ed', - 'cornsilk':'#fff8dc', - 'crimson':'#dc143c', - 'cyan':'#00ffff', - 'darkblue':'#00008b', - 'darkcyan':'#008b8b', - 'darkgoldenrod':'#b8860b', - 'darkgray':'#a9a9a9', - 'darkgrey':'#a9a9a9', - 'darkgreen':'#006400', - 'darkkhaki':'#bdb76b', - 'darkmagenta':'#8b008b', - 'darkolivegreen':'#556b2f', - 'darkorange':'#ff8c00', - 'darkorchid':'#9932cc', - 'darkred':'#8b0000', - 'darksalmon':'#e9967a', - 'darkseagreen':'#8fbc8f', - 'darkslateblue':'#483d8b', - 'darkslategray':'#2f4f4f', - 'darkslategrey':'#2f4f4f', - 'darkturquoise':'#00ced1', - 'darkviolet':'#9400d3', - 'deeppink':'#ff1493', - 'deepskyblue':'#00bfff', - 'dimgray':'#696969', - 'dimgrey':'#696969', - 'dodgerblue':'#1e90ff', - 'firebrick':'#b22222', - 'floralwhite':'#fffaf0', - 'forestgreen':'#228b22', - 'fuchsia':'#ff00ff', - 'gainsboro':'#dcdcdc', - 'ghostwhite':'#f8f8ff', - 'gold':'#ffd700', - 'goldenrod':'#daa520', - 'gray':'#808080', - 'grey':'#808080', - 'green':'#008000', - 'greenyellow':'#adff2f', - 'honeydew':'#f0fff0', - 'hotpink':'#ff69b4', - 'indianred':'#cd5c5c', - 'indigo':'#4b0082', - 'ivory':'#fffff0', - 'khaki':'#f0e68c', - 'lavender':'#e6e6fa', - 'lavenderblush':'#fff0f5', - 'lawngreen':'#7cfc00', - 'lemonchiffon':'#fffacd', - 'lightblue':'#add8e6', - 'lightcoral':'#f08080', - 'lightcyan':'#e0ffff', - 'lightgoldenrodyellow':'#fafad2', - 'lightgray':'#d3d3d3', - 'lightgrey':'#d3d3d3', - 'lightgreen':'#90ee90', - 'lightpink':'#ffb6c1', - 'lightsalmon':'#ffa07a', - 'lightseagreen':'#20b2aa', - 'lightskyblue':'#87cefa', - 'lightslategray':'#778899', - 'lightslategrey':'#778899', - 'lightsteelblue':'#b0c4de', - 'lightyellow':'#ffffe0', - 'lime':'#00ff00', - 'limegreen':'#32cd32', - 'linen':'#faf0e6', - 'magenta':'#ff00ff', - 'maroon':'#800000', - 'mediumaquamarine':'#66cdaa', - 'mediumblue':'#0000cd', - 'mediumorchid':'#ba55d3', - 'mediumpurple':'#9370d8', - 'mediumseagreen':'#3cb371', - 'mediumslateblue':'#7b68ee', - 'mediumspringgreen':'#00fa9a', - 'mediumturquoise':'#48d1cc', - 'mediumvioletred':'#c71585', - 'midnightblue':'#191970', - 'mintcream':'#f5fffa', - 'mistyrose':'#ffe4e1', - 'moccasin':'#ffe4b5', - 'navajowhite':'#ffdead', - 'navy':'#000080', - 'oldlace':'#fdf5e6', - 'olive':'#808000', - 'olivedrab':'#6b8e23', - 'orange':'#ffa500', - 'orangered':'#ff4500', - 'orchid':'#da70d6', - 'palegoldenrod':'#eee8aa', - 'palegreen':'#98fb98', - 'paleturquoise':'#afeeee', - 'palevioletred':'#d87093', - 'papayawhip':'#ffefd5', - 'peachpuff':'#ffdab9', - 'peru':'#cd853f', - 'pink':'#ffc0cb', - 'plum':'#dda0dd', - 'powderblue':'#b0e0e6', - 'purple':'#800080', - 'rebeccapurple':'#663399', - 'red':'#ff0000', - 'rosybrown':'#bc8f8f', - 'royalblue':'#4169e1', - 'saddlebrown':'#8b4513', - 'salmon':'#fa8072', - 'sandybrown':'#f4a460', - 'seagreen':'#2e8b57', - 'seashell':'#fff5ee', - 'sienna':'#a0522d', - 'silver':'#c0c0c0', - 'skyblue':'#87ceeb', - 'slateblue':'#6a5acd', - 'slategray':'#708090', - 'slategrey':'#708090', - 'snow':'#fffafa', - 'springgreen':'#00ff7f', - 'steelblue':'#4682b4', - 'tan':'#d2b48c', - 'teal':'#008080', - 'thistle':'#d8bfd8', - 'tomato':'#ff6347', - 'turquoise':'#40e0d0', - 'violet':'#ee82ee', - 'wheat':'#f5deb3', - 'white':'#ffffff', - 'whitesmoke':'#f5f5f5', - 'yellow':'#ffff00', - 'yellowgreen':'#9acd32' -}; -},{}],14:[function(require,module,exports){ -module.exports = { - colors: require('./colors'), - unitConversions: require('./unit-conversions') -}; - -},{"./colors":13,"./unit-conversions":15}],15:[function(require,module,exports){ -module.exports = { - length: { - 'm': 1, - 'cm': 0.01, - 'mm': 0.001, - 'in': 0.0254, - 'px': 0.0254 / 96, - 'pt': 0.0254 / 72, - 'pc': 0.0254 / 72 * 12 - }, - duration: { - 's': 1, - 'ms': 0.001 - }, - angle: { - 'rad': 1 / (2 * Math.PI), - 'deg': 1 / 360, - 'grad': 1 / 400, - 'turn': 1 - } -}; -},{}],16:[function(require,module,exports){ -// Export a new default each time -module.exports = function() { - return { - /* Inline Javascript - @plugin still allowed */ - javascriptEnabled: false, - - /* Outputs a makefile import dependency list to stdout. */ - depends: false, - - /* (DEPRECATED) Compress using less built-in compression. - * This does an okay job but does not utilise all the tricks of - * dedicated css compression. */ - compress: false, - - /* Runs the less parser and just reports errors without any output. */ - lint: false, - - /* Sets available include paths. - * If the file in an @import rule does not exist at that exact location, - * less will look for it at the location(s) passed to this option. - * You might use this for instance to specify a path to a library which - * you want to be referenced simply and relatively in the less files. */ - paths: [], - - /* color output in the terminal */ - color: true, - - /* The strictImports controls whether the compiler will allow an @import inside of either - * @media blocks or (a later addition) other selector blocks. - * See: https://github.com/less/less.js/issues/656 */ - strictImports: false, - - /* Allow Imports from Insecure HTTPS Hosts */ - insecure: false, - - /* Allows you to add a path to every generated import and url in your css. - * This does not affect less import statements that are processed, just ones - * that are left in the output css. */ - rootpath: '', - - /* By default URLs are kept as-is, so if you import a file in a sub-directory - * that references an image, exactly the same URL will be output in the css. - * This option allows you to re-write URL's in imported files so that the - * URL is always relative to the base imported file */ - relativeUrls: false, - - /* Compatibility with IE8. Used for limiting data-uri length */ - ieCompat: false, // true until 3.0 - - /* How to process math - * 0 always - eagerly try to solve all operations - * 1 parens-division - require parens for division "/" - * 2 parens | strict - require parens for all operations - * 3 strict-legacy - legacy strict behavior (super-strict) - */ - math: 0, - - /* Without this option, less attempts to guess at the output unit when it does maths. */ - strictUnits: false, - - /* Effectively the declaration is put at the top of your base Less file, - * meaning it can be used but it also can be overridden if this variable - * is defined in the file. */ - globalVars: null, - - /* As opposed to the global variable option, this puts the declaration at the - * end of your base file, meaning it will override anything defined in your Less file. */ - modifyVars: null, - - /* This option allows you to specify a argument to go on to every URL. */ - urlArgs: '' - } -} -},{}],17:[function(require,module,exports){ -var abstractFileManager = function() { -}; - -abstractFileManager.prototype.getPath = function (filename) { - var j = filename.lastIndexOf('?'); - if (j > 0) { - filename = filename.slice(0, j); - } - j = filename.lastIndexOf('/'); - if (j < 0) { - j = filename.lastIndexOf('\\'); - } - if (j < 0) { - return ''; - } - return filename.slice(0, j + 1); -}; - -abstractFileManager.prototype.tryAppendExtension = function(path, ext) { - return /(\.[a-z]*$)|([\?;].*)$/.test(path) ? path : path + ext; -}; - -abstractFileManager.prototype.tryAppendLessExtension = function(path) { - return this.tryAppendExtension(path, '.less'); -}; - -abstractFileManager.prototype.supportsSync = function() { - return false; -}; - -abstractFileManager.prototype.alwaysMakePathsAbsolute = function() { - return false; -}; - -abstractFileManager.prototype.isPathAbsolute = function(filename) { - return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename); -}; -// TODO: pull out / replace? -abstractFileManager.prototype.join = function(basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return basePath + laterPath; -}; - -abstractFileManager.prototype.pathDiff = function pathDiff(url, baseUrl) { - // diff between two paths to create a relative path - - var urlParts = this.extractUrlParts(url), - baseUrlParts = this.extractUrlParts(baseUrl), - i, max, urlDirectories, baseUrlDirectories, diff = ''; - if (urlParts.hostPart !== baseUrlParts.hostPart) { - return ''; - } - max = Math.max(baseUrlParts.directories.length, urlParts.directories.length); - for (i = 0; i < max; i++) { - if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; } - } - baseUrlDirectories = baseUrlParts.directories.slice(i); - urlDirectories = urlParts.directories.slice(i); - for (i = 0; i < baseUrlDirectories.length - 1; i++) { - diff += '../'; - } - for (i = 0; i < urlDirectories.length - 1; i++) { - diff += urlDirectories[i] + '/'; - } - return diff; -}; -// helper function, not part of API -abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, baseUrl) { - // urlParts[1] = protocol://hostname/ OR / - // urlParts[2] = / if path relative to host base - // urlParts[3] = directories - // urlParts[4] = filename - // urlParts[5] = parameters - - var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i, - urlParts = url.match(urlPartsRegex), - returner = {}, rawDirectories = [], directories = [], i, baseUrlParts; - - if (!urlParts) { - throw new Error('Could not parse sheet href - \'' + url + '\''); - } - - // Stylesheets in IE don't always return the full path - if (baseUrl && (!urlParts[1] || urlParts[2])) { - baseUrlParts = baseUrl.match(urlPartsRegex); - if (!baseUrlParts) { - throw new Error('Could not parse page url - \'' + baseUrl + '\''); - } - urlParts[1] = urlParts[1] || baseUrlParts[1] || ''; - if (!urlParts[2]) { - urlParts[3] = baseUrlParts[3] + urlParts[3]; - } - } - - if (urlParts[3]) { - rawDirectories = urlParts[3].replace(/\\/g, '/').split('/'); - - // collapse '..' and skip '.' - for (i = 0; i < rawDirectories.length; i++) { - - if (rawDirectories[i] === '..') { - directories.pop(); - } - else if (rawDirectories[i] !== '.') { - directories.push(rawDirectories[i]); - } - - } - } - - returner.hostPart = urlParts[1]; - returner.directories = directories; - returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/'); - returner.path = (urlParts[1] || '') + directories.join('/'); - returner.filename = urlParts[4]; - returner.fileUrl = returner.path + (urlParts[4] || ''); - returner.url = returner.fileUrl + (urlParts[5] || ''); - return returner; -}; - -module.exports = abstractFileManager; - -},{}],18:[function(require,module,exports){ -var functionRegistry = require('../functions/function-registry'), - LessError = require('../less-error'); - -var AbstractPluginLoader = function() { - // Implemented by Node.js plugin loader - this.require = function() { - return null; - } -}; - -AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports, pluginOptions, fileInfo) { - - var loader, - registry, - pluginObj, - localModule, - pluginManager, - filename, - result; - - pluginManager = context.pluginManager; - - if (fileInfo) { - if (typeof fileInfo === 'string') { - filename = fileInfo; - } - else { - filename = fileInfo.filename; - } - } - var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename; - - if (filename) { - pluginObj = pluginManager.get(filename); - - if (pluginObj) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - return pluginObj; - } - } - localModule = { - exports: {}, - pluginManager: pluginManager, - fileInfo: fileInfo - }; - registry = functionRegistry.create(); - - var registerPlugin = function(obj) { - pluginObj = obj; - }; - - try { - loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents); - loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo); - } - catch (e) { - return new LessError(e, imports, filename); - } - - if (!pluginObj) { - pluginObj = localModule.exports; - } - pluginObj = this.validatePlugin(pluginObj, filename, shortname); - - if (pluginObj instanceof LessError) { - return pluginObj; - } - - if (pluginObj) { - pluginObj.imports = imports; - pluginObj.filename = filename; - - // For < 3.x (or unspecified minVersion) - setOptions() before install() - if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - - if (result) { - return result; - } - } - - // Run on first load - pluginManager.addPlugin(pluginObj, fileInfo.filename, registry); - pluginObj.functions = registry.getLocalFunctions(); - - // Need to call setOptions again because the pluginObj might have functions - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - - // Run every @plugin call - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - - } - else { - return new LessError({ message: 'Not a valid plugin' }, imports, filename); - } - - return pluginObj; - -}; - -AbstractPluginLoader.prototype.trySetOptions = function(plugin, filename, name, options) { - if (options && !plugin.setOptions) { - return new LessError({ - message: 'Options have been provided but the plugin ' + - name + ' does not support any options.' - }); - } - try { - plugin.setOptions && plugin.setOptions(options); - } - catch (e) { - return new LessError(e); - } -}; - -AbstractPluginLoader.prototype.validatePlugin = function(plugin, filename, name) { - if (plugin) { - // support plugins being a function - // so that the plugin can be more usable programmatically - if (typeof plugin === 'function') { - plugin = new plugin(); - } - - if (plugin.minVersion) { - if (this.compareVersion(plugin.minVersion, this.less.version) < 0) { - return new LessError({ - message: 'Plugin ' + name + ' requires version ' + - this.versionToString(plugin.minVersion) - }); - } - } - return plugin; - } - return null; -}; - -AbstractPluginLoader.prototype.compareVersion = function(aVersion, bVersion) { - if (typeof aVersion === 'string') { - aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/); - aVersion.shift(); - } - for (var i = 0; i < aVersion.length; i++) { - if (aVersion[i] !== bVersion[i]) { - return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1; - } - } - return 0; -}; -AbstractPluginLoader.prototype.versionToString = function(version) { - var versionString = ''; - for (var i = 0; i < version.length; i++) { - versionString += (versionString ? '.' : '') + version[i]; - } - return versionString; -}; -AbstractPluginLoader.prototype.printUsage = function(plugins) { - for (var i = 0; i < plugins.length; i++) { - var plugin = plugins[i]; - if (plugin.printUsage) { - plugin.printUsage(); - } - } -}; - -module.exports = AbstractPluginLoader; - - -},{"../functions/function-registry":26,"../less-error":37}],19:[function(require,module,exports){ -/** - * @todo Document why this abstraction exists, and the relationship between - * environment, file managers, and plugin manager - */ - -var logger = require('../logger'); -var environment = function(externalEnvironment, fileManagers) { - this.fileManagers = fileManagers || []; - externalEnvironment = externalEnvironment || {}; - - var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'], - requiredFunctions = [], - functions = requiredFunctions.concat(optionalFunctions); - - for (var i = 0; i < functions.length; i++) { - var propName = functions[i], - environmentFunc = externalEnvironment[propName]; - if (environmentFunc) { - this[propName] = environmentFunc.bind(externalEnvironment); - } else if (i < requiredFunctions.length) { - this.warn('missing required function in environment - ' + propName); - } - } -}; - -environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) { - - if (!filename) { - logger.warn('getFileManager called with no filename.. Please report this issue. continuing.'); - } - if (currentDirectory == null) { - logger.warn('getFileManager called with null directory.. Please report this issue. continuing.'); - } - - var fileManagers = this.fileManagers; - if (options.pluginManager) { - fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers()); - } - for (var i = fileManagers.length - 1; i >= 0 ; i--) { - var fileManager = fileManagers[i]; - if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) { - return fileManager; - } - } - return null; -}; - -environment.prototype.addFileManager = function (fileManager) { - this.fileManagers.push(fileManager); -}; - -environment.prototype.clearFileManagers = function () { - this.fileManagers = []; -}; - -module.exports = environment; - -},{"../logger":38}],20:[function(require,module,exports){ - -var functionRegistry = require('./function-registry'), - Anonymous = require('../tree/anonymous'), - Keyword = require('../tree/keyword'); - -functionRegistry.addMultiple({ - boolean: function(condition) { - return condition ? Keyword.True : Keyword.False; - }, - - 'if': function(condition, trueValue, falseValue) { - return condition ? trueValue - : (falseValue || new Anonymous); - } -}); - -},{"../tree/anonymous":50,"../tree/keyword":70,"./function-registry":26}],21:[function(require,module,exports){ -var Color = require('../tree/color'), - functionRegistry = require('./function-registry'); - -// Color Blending -// ref: http://www.w3.org/TR/compositing-1 - -function colorBlend(mode, color1, color2) { - var ab = color1.alpha, cb, // backdrop - as = color2.alpha, cs, // source - ar, cr, r = []; // result - - ar = as + ab * (1 - as); - for (var i = 0; i < 3; i++) { - cb = color1.rgb[i] / 255; - cs = color2.rgb[i] / 255; - cr = mode(cb, cs); - if (ar) { - cr = (as * cs + ab * (cb - - as * (cb + cs - cr))) / ar; - } - r[i] = cr * 255; - } - - return new Color(r, ar); -} - -var colorBlendModeFunctions = { - multiply: function(cb, cs) { - return cb * cs; - }, - screen: function(cb, cs) { - return cb + cs - cb * cs; - }, - overlay: function(cb, cs) { - cb *= 2; - return (cb <= 1) ? - colorBlendModeFunctions.multiply(cb, cs) : - colorBlendModeFunctions.screen(cb - 1, cs); - }, - softlight: function(cb, cs) { - var d = 1, e = cb; - if (cs > 0.5) { - e = 1; - d = (cb > 0.25) ? Math.sqrt(cb) - : ((16 * cb - 12) * cb + 4) * cb; - } - return cb - (1 - 2 * cs) * e * (d - cb); - }, - hardlight: function(cb, cs) { - return colorBlendModeFunctions.overlay(cs, cb); - }, - difference: function(cb, cs) { - return Math.abs(cb - cs); - }, - exclusion: function(cb, cs) { - return cb + cs - 2 * cb * cs; - }, - - // non-w3c functions: - average: function(cb, cs) { - return (cb + cs) / 2; - }, - negation: function(cb, cs) { - return 1 - Math.abs(cb + cs - 1); - } -}; - -for (var f in colorBlendModeFunctions) { - if (colorBlendModeFunctions.hasOwnProperty(f)) { - colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]); - } -} - -functionRegistry.addMultiple(colorBlend); - -},{"../tree/color":55,"./function-registry":26}],22:[function(require,module,exports){ -var Dimension = require('../tree/dimension'), - Color = require('../tree/color'), - Quoted = require('../tree/quoted'), - Anonymous = require('../tree/anonymous'), - functionRegistry = require('./function-registry'), - colorFunctions; - -function clamp(val) { - return Math.min(1, Math.max(0, val)); -} -function hsla(color) { - return colorFunctions.hsla(color.h, color.s, color.l, color.a); -} -function number(n) { - if (n instanceof Dimension) { - return parseFloat(n.unit.is('%') ? n.value / 100 : n.value); - } else if (typeof n === 'number') { - return n; - } else { - throw { - type: 'Argument', - message: 'color functions take numbers as parameters' - }; - } -} -function scaled(n, size) { - if (n instanceof Dimension && n.unit.is('%')) { - return parseFloat(n.value * size / 100); - } else { - return number(n); - } -} -colorFunctions = { - rgb: function (r, g, b) { - return colorFunctions.rgba(r, g, b, 1.0); - }, - rgba: function (r, g, b, a) { - var rgb = [r, g, b].map(function (c) { return scaled(c, 255); }); - a = number(a); - return new Color(rgb, a); - }, - hsl: function (h, s, l) { - return colorFunctions.hsla(h, s, l, 1.0); - }, - hsla: function (h, s, l, a) { - - var m1, m2; - - function hue(h) { - h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); - if (h * 6 < 1) { - return m1 + (m2 - m1) * h * 6; - } - else if (h * 2 < 1) { - return m2; - } - else if (h * 3 < 2) { - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - } - else { - return m1; - } - } - - h = (number(h) % 360) / 360; - s = clamp(number(s)); l = clamp(number(l)); a = clamp(number(a)); - - m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - m1 = l * 2 - m2; - - return colorFunctions.rgba(hue(h + 1 / 3) * 255, - hue(h) * 255, - hue(h - 1 / 3) * 255, - a); - }, - - hsv: function(h, s, v) { - return colorFunctions.hsva(h, s, v, 1.0); - }, - - hsva: function(h, s, v, a) { - h = ((number(h) % 360) / 360) * 360; - s = number(s); v = number(v); a = number(a); - - var i, f; - i = Math.floor((h / 60) % 6); - f = (h / 60) - i; - - var vs = [v, - v * (1 - s), - v * (1 - f * s), - v * (1 - (1 - f) * s)]; - var perm = [[0, 3, 1], - [2, 0, 1], - [1, 0, 3], - [1, 2, 0], - [3, 1, 0], - [0, 1, 2]]; - - return colorFunctions.rgba(vs[perm[i][0]] * 255, - vs[perm[i][1]] * 255, - vs[perm[i][2]] * 255, - a); - }, - - hue: function (color) { - return new Dimension(color.toHSL().h); - }, - saturation: function (color) { - return new Dimension(color.toHSL().s * 100, '%'); - }, - lightness: function (color) { - return new Dimension(color.toHSL().l * 100, '%'); - }, - hsvhue: function(color) { - return new Dimension(color.toHSV().h); - }, - hsvsaturation: function (color) { - return new Dimension(color.toHSV().s * 100, '%'); - }, - hsvvalue: function (color) { - return new Dimension(color.toHSV().v * 100, '%'); - }, - red: function (color) { - return new Dimension(color.rgb[0]); - }, - green: function (color) { - return new Dimension(color.rgb[1]); - }, - blue: function (color) { - return new Dimension(color.rgb[2]); - }, - alpha: function (color) { - return new Dimension(color.toHSL().a); - }, - luma: function (color) { - return new Dimension(color.luma() * color.alpha * 100, '%'); - }, - luminance: function (color) { - var luminance = - (0.2126 * color.rgb[0] / 255) + - (0.7152 * color.rgb[1] / 255) + - (0.0722 * color.rgb[2] / 255); - - return new Dimension(luminance * color.alpha * 100, '%'); - }, - saturate: function (color, amount, method) { - // filter: saturate(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s += hsl.s * amount.value / 100; - } - else { - hsl.s += amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - desaturate: function (color, amount, method) { - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s -= hsl.s * amount.value / 100; - } - else { - hsl.s -= amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - lighten: function (color, amount, method) { - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l += hsl.l * amount.value / 100; - } - else { - hsl.l += amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - darken: function (color, amount, method) { - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l -= hsl.l * amount.value / 100; - } - else { - hsl.l -= amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - fadein: function (color, amount, method) { - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a += hsl.a * amount.value / 100; - } - else { - hsl.a += amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(hsl); - }, - fadeout: function (color, amount, method) { - var hsl = color.toHSL(); - - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a -= hsl.a * amount.value / 100; - } - else { - hsl.a -= amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(hsl); - }, - fade: function (color, amount) { - var hsl = color.toHSL(); - - hsl.a = amount.value / 100; - hsl.a = clamp(hsl.a); - return hsla(hsl); - }, - spin: function (color, amount) { - var hsl = color.toHSL(); - var hue = (hsl.h + amount.value) % 360; - - hsl.h = hue < 0 ? 360 + hue : hue; - - return hsla(hsl); - }, - // - // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein - // http://sass-lang.com - // - mix: function (color1, color2, weight) { - if (!color1.toHSL || !color2.toHSL) { - console.log(color2.type); - console.dir(color2); - } - if (!weight) { - weight = new Dimension(50); - } - var p = weight.value / 100.0; - var w = p * 2 - 1; - var a = color1.toHSL().a - color2.toHSL().a; - - var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; - var w2 = 1 - w1; - - var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, - color1.rgb[1] * w1 + color2.rgb[1] * w2, - color1.rgb[2] * w1 + color2.rgb[2] * w2]; - - var alpha = color1.alpha * p + color2.alpha * (1 - p); - - return new Color(rgb, alpha); - }, - greyscale: function (color) { - return colorFunctions.desaturate(color, new Dimension(100)); - }, - contrast: function (color, dark, light, threshold) { - // filter: contrast(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - if (typeof light === 'undefined') { - light = colorFunctions.rgba(255, 255, 255, 1.0); - } - if (typeof dark === 'undefined') { - dark = colorFunctions.rgba(0, 0, 0, 1.0); - } - // Figure out which is actually light and dark: - if (dark.luma() > light.luma()) { - var t = light; - light = dark; - dark = t; - } - if (typeof threshold === 'undefined') { - threshold = 0.43; - } else { - threshold = number(threshold); - } - if (color.luma() < threshold) { - return light; - } else { - return dark; - } - }, - // Changes made in 2.7.0 - Reverted in 3.0.0 - // contrast: function (color, color1, color2, threshold) { - // // Return which of `color1` and `color2` has the greatest contrast with `color` - // // according to the standard WCAG contrast ratio calculation. - // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef - // // The threshold param is no longer used, in line with SASS. - // // filter: contrast(3.2); - // // should be kept as is, so check for color - // if (!color.rgb) { - // return null; - // } - // if (typeof color1 === 'undefined') { - // color1 = colorFunctions.rgba(0, 0, 0, 1.0); - // } - // if (typeof color2 === 'undefined') { - // color2 = colorFunctions.rgba(255, 255, 255, 1.0); - // } - // var contrast1, contrast2; - // var luma = color.luma(); - // var luma1 = color1.luma(); - // var luma2 = color2.luma(); - // // Calculate contrast ratios for each color - // if (luma > luma1) { - // contrast1 = (luma + 0.05) / (luma1 + 0.05); - // } else { - // contrast1 = (luma1 + 0.05) / (luma + 0.05); - // } - // if (luma > luma2) { - // contrast2 = (luma + 0.05) / (luma2 + 0.05); - // } else { - // contrast2 = (luma2 + 0.05) / (luma + 0.05); - // } - // if (contrast1 > contrast2) { - // return color1; - // } else { - // return color2; - // } - // }, - argb: function (color) { - return new Anonymous(color.toARGB()); - }, - color: function(c) { - if ((c instanceof Quoted) && - (/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(c.value))) { - return new Color(c.value.slice(1)); - } - if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) { - c.value = undefined; - return c; - } - throw { - type: 'Argument', - message: 'argument must be a color keyword or 3/6 digit hex e.g. #FFF' - }; - }, - tint: function(color, amount) { - return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount); - }, - shade: function(color, amount) { - return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount); - } -}; -functionRegistry.addMultiple(colorFunctions); - -},{"../tree/anonymous":50,"../tree/color":55,"../tree/dimension":62,"../tree/quoted":80,"./function-registry":26}],23:[function(require,module,exports){ -module.exports = function(environment) { - var Quoted = require('../tree/quoted'), - URL = require('../tree/url'), - utils = require('../utils'), - functionRegistry = require('./function-registry'), - fallback = function(functionThis, node) { - return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); - }, - logger = require('../logger'); - - functionRegistry.add('data-uri', function(mimetypeNode, filePathNode) { - - if (!filePathNode) { - filePathNode = mimetypeNode; - mimetypeNode = null; - } - - var mimetype = mimetypeNode && mimetypeNode.value; - var filePath = filePathNode.value; - var currentFileInfo = this.currentFileInfo; - var currentDirectory = currentFileInfo.relativeUrls ? - currentFileInfo.currentDirectory : currentFileInfo.entryPath; - - var fragmentStart = filePath.indexOf('#'); - var fragment = ''; - if (fragmentStart !== -1) { - fragment = filePath.slice(fragmentStart); - filePath = filePath.slice(0, fragmentStart); - } - var context = utils.clone(this.context); - context.rawBuffer = true; - - var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); - - if (!fileManager) { - return fallback(this, filePathNode); - } - - var useBase64 = false; - - // detect the mimetype if not given - if (!mimetypeNode) { - - mimetype = environment.mimeLookup(filePath); - - if (mimetype === 'image/svg+xml') { - useBase64 = false; - } else { - // use base 64 unless it's an ASCII or UTF-8 format - var charset = environment.charsetLookup(mimetype); - useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0; - } - if (useBase64) { mimetype += ';base64'; } - } - else { - useBase64 = /;base64$/.test(mimetype); - } - - var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); - if (!fileSync.contents) { - logger.warn('Skipped data-uri embedding of ' + filePath + ' because file not found'); - return fallback(this, filePathNode || mimetypeNode); - } - var buf = fileSync.contents; - if (useBase64 && !environment.encodeBase64) { - return fallback(this, filePathNode); - } - - buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); - - var uri = 'data:' + mimetype + ',' + buf + fragment; - - // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded - // and the --ieCompat flag is enabled, return a normal url() instead. - var DATA_URI_MAX = 32768; - if (uri.length >= DATA_URI_MAX) { - - if (this.context.ieCompat !== false) { - logger.warn('Skipped data-uri embedding of ' + filePath + ' because its size (' + uri.length + - ' characters) exceeds IE8-safe ' + DATA_URI_MAX + ' characters!'); - - return fallback(this, filePathNode || mimetypeNode); - } - } - - return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - }); -}; - -},{"../logger":38,"../tree/quoted":80,"../tree/url":85,"../utils":89,"./function-registry":26}],24:[function(require,module,exports){ -var Keyword = require('../tree/keyword'), - functionRegistry = require('./function-registry'); - -var defaultFunc = { - eval: function () { - var v = this.value_, e = this.error_; - if (e) { - throw e; - } - if (v != null) { - return v ? Keyword.True : Keyword.False; - } - }, - value: function (v) { - this.value_ = v; - }, - error: function (e) { - this.error_ = e; - }, - reset: function () { - this.value_ = this.error_ = null; - } -}; - -functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc)); - -module.exports = defaultFunc; - -},{"../tree/keyword":70,"./function-registry":26}],25:[function(require,module,exports){ -var Expression = require('../tree/expression'); - -var functionCaller = function(name, context, index, currentFileInfo) { - this.name = name.toLowerCase(); - this.index = index; - this.context = context; - this.currentFileInfo = currentFileInfo; - - this.func = context.frames[0].functionRegistry.get(this.name); -}; -functionCaller.prototype.isValid = function() { - return Boolean(this.func); -}; - -functionCaller.prototype.call = function(args) { - // This code is terrible and should be replaced as per this issue... - // https://github.com/less/less.js/issues/2477 - if (Array.isArray(args)) { - args = args.filter(function (item) { - if (item.type === 'Comment') { - return false; - } - return true; - }) - .map(function(item) { - if (item.type === 'Expression') { - var subNodes = item.value.filter(function (item) { - if (item.type === 'Comment') { - return false; - } - return true; - }); - if (subNodes.length === 1) { - return subNodes[0]; - } else { - return new Expression(subNodes); - } - } - return item; - }); - } - - return this.func.apply(this, args); -}; - -module.exports = functionCaller; - -},{"../tree/expression":64}],26:[function(require,module,exports){ -function makeRegistry( base ) { - return { - _data: {}, - add: function(name, func) { - // precautionary case conversion, as later querying of - // the registry by function-caller uses lower case as well. - name = name.toLowerCase(); - - if (this._data.hasOwnProperty(name)) { - // TODO warn - } - this._data[name] = func; - }, - addMultiple: function(functions) { - Object.keys(functions).forEach( - function(name) { - this.add(name, functions[name]); - }.bind(this)); - }, - get: function(name) { - return this._data[name] || ( base && base.get( name )); - }, - getLocalFunctions: function() { - return this._data; - }, - inherit: function() { - return makeRegistry( this ); - }, - create: function(base) { - return makeRegistry(base); - } - }; -} - -module.exports = makeRegistry( null ); -},{}],27:[function(require,module,exports){ -module.exports = function(environment) { - var functions = { - functionRegistry: require('./function-registry'), - functionCaller: require('./function-caller') - }; - - // register functions - require('./boolean'); - require('./default'); - require('./color'); - require('./color-blending'); - require('./data-uri')(environment); - require('./list'); - require('./math'); - require('./number'); - require('./string'); - require('./svg')(environment); - require('./types'); - - return functions; -}; - -},{"./boolean":20,"./color":22,"./color-blending":21,"./data-uri":23,"./default":24,"./function-caller":25,"./function-registry":26,"./list":28,"./math":30,"./number":31,"./string":32,"./svg":33,"./types":34}],28:[function(require,module,exports){ -var Dimension = require('../tree/dimension'), - Declaration = require('../tree/declaration'), - Ruleset = require('../tree/ruleset'), - Selector = require('../tree/selector'), - Element = require('../tree/element'), - functionRegistry = require('./function-registry'); - -var getItemsFromNode = function(node) { - // handle non-array values as an array of length 1 - // return 'undefined' if index is invalid - var items = Array.isArray(node.value) ? - node.value : Array(node); - - return items; -}; - -functionRegistry.addMultiple({ - _SELF: function(n) { - return n; - }, - extract: function(values, index) { - index = index.value - 1; // (1-based index) - - return getItemsFromNode(values)[index]; - }, - length: function(values) { - return new Dimension(getItemsFromNode(values).length); - }, - each: function(list, rs) { - var i = 0, rules = [], newRules, iterator; - - if (list.value) { - if (Array.isArray(list.value)) { - iterator = list.value; - } else { - iterator = [list.value]; - } - } else if (list.ruleset) { - iterator = list.ruleset.rules; - } else if (Array.isArray(list)) { - iterator = list; - } else { - iterator = [list]; - } - - var valueName = '@value', - keyName = '@key', - indexName = '@index'; - - if (rs.params) { - valueName = rs.params[0] && rs.params[0].name; - keyName = rs.params[1] && rs.params[1].name; - indexName = rs.params[2] && rs.params[2].name; - rs = rs.rules; - } else { - rs = rs.ruleset; - } - - iterator.forEach(function(item) { - i = i + 1; - var key, value; - if (item instanceof Declaration) { - key = typeof item.name === 'string' ? item.name : item.name[0].value; - value = item.value; - } else { - key = new Dimension(i); - value = item; - } - - newRules = rs.rules.slice(0); - if (valueName) { - newRules.push(new Declaration(valueName, - value, - false, false, this.index, this.currentFileInfo)); - } - if (indexName) { - newRules.push(new Declaration(indexName, - new Dimension(i), - false, false, this.index, this.currentFileInfo)); - } - if (keyName) { - newRules.push(new Declaration(keyName, - key, - false, false, this.index, this.currentFileInfo)); - } - - rules.push(new Ruleset([ new(Selector)([ new Element("", '&') ]) ], - newRules, - rs.strictImports, - rs.visibilityInfo() - )); - }); - - return new Ruleset([ new(Selector)([ new Element("", '&') ]) ], - rules, - rs.strictImports, - rs.visibilityInfo() - ).eval(this.context); - - } -}); - -},{"../tree/declaration":60,"../tree/dimension":62,"../tree/element":63,"../tree/ruleset":81,"../tree/selector":82,"./function-registry":26}],29:[function(require,module,exports){ -var Dimension = require('../tree/dimension'); - -var MathHelper = function() { -}; -MathHelper._math = function (fn, unit, n) { - if (!(n instanceof Dimension)) { - throw { type: 'Argument', message: 'argument must be a number' }; - } - if (unit == null) { - unit = n.unit; - } else { - n = n.unify(); - } - return new Dimension(fn(parseFloat(n.value)), unit); -}; -module.exports = MathHelper; -},{"../tree/dimension":62}],30:[function(require,module,exports){ -var functionRegistry = require('./function-registry'), - mathHelper = require('./math-helper.js'); - -var mathFunctions = { - // name, unit - ceil: null, - floor: null, - sqrt: null, - abs: null, - tan: '', - sin: '', - cos: '', - atan: 'rad', - asin: 'rad', - acos: 'rad' -}; - -for (var f in mathFunctions) { - if (mathFunctions.hasOwnProperty(f)) { - mathFunctions[f] = mathHelper._math.bind(null, Math[f], mathFunctions[f]); - } -} - -mathFunctions.round = function (n, f) { - var fraction = typeof f === 'undefined' ? 0 : f.value; - return mathHelper._math(function(num) { return num.toFixed(fraction); }, null, n); -}; - -functionRegistry.addMultiple(mathFunctions); - -},{"./function-registry":26,"./math-helper.js":29}],31:[function(require,module,exports){ -var Dimension = require('../tree/dimension'), - Anonymous = require('../tree/anonymous'), - functionRegistry = require('./function-registry'), - mathHelper = require('./math-helper.js'); - -var minMax = function (isMin, args) { - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - var i, j, current, currentUnified, referenceUnified, unit, unitStatic, unitClone, - order = [], // elems only contains original argument values. - values = {}; // key is the unit.toString() for unified Dimension values, - // value is the index into the order array. - for (i = 0; i < args.length; i++) { - current = args[i]; - if (!(current instanceof Dimension)) { - if (Array.isArray(args[i].value)) { - Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value)); - } - continue; - } - currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify(); - unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString(); - unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic; - unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone; - j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit]; - if (j === undefined) { - if (unitStatic !== undefined && unit !== unitStatic) { - throw { type: 'Argument', message: 'incompatible types' }; - } - values[unit] = order.length; - order.push(current); - continue; - } - referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify(); - if ( isMin && currentUnified.value < referenceUnified.value || - !isMin && currentUnified.value > referenceUnified.value) { - order[j] = current; - } - } - if (order.length == 1) { - return order[0]; - } - args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); - return new Anonymous((isMin ? 'min' : 'max') + '(' + args + ')'); -}; -functionRegistry.addMultiple({ - min: function () { - return minMax(true, arguments); - }, - max: function () { - return minMax(false, arguments); - }, - convert: function (val, unit) { - return val.convertTo(unit.value); - }, - pi: function () { - return new Dimension(Math.PI); - }, - mod: function(a, b) { - return new Dimension(a.value % b.value, a.unit); - }, - pow: function(x, y) { - if (typeof x === 'number' && typeof y === 'number') { - x = new Dimension(x); - y = new Dimension(y); - } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) { - throw { type: 'Argument', message: 'arguments must be numbers' }; - } - - return new Dimension(Math.pow(x.value, y.value), x.unit); - }, - percentage: function (n) { - var result = mathHelper._math(function(num) { - return num * 100; - }, '%', n); - - return result; - } -}); - -},{"../tree/anonymous":50,"../tree/dimension":62,"./function-registry":26,"./math-helper.js":29}],32:[function(require,module,exports){ -var Quoted = require('../tree/quoted'), - Anonymous = require('../tree/anonymous'), - JavaScript = require('../tree/javascript'), - functionRegistry = require('./function-registry'); - -functionRegistry.addMultiple({ - e: function (str) { - return new Anonymous(str instanceof JavaScript ? str.evaluated : str.value); - }, - escape: function (str) { - return new Anonymous( - encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') - .replace(/\(/g, '%28').replace(/\)/g, '%29')); - }, - replace: function (string, pattern, replacement, flags) { - var result = string.value; - replacement = (replacement.type === 'Quoted') ? - replacement.value : replacement.toCSS(); - result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement); - return new Quoted(string.quote || '', result, string.escaped); - }, - '%': function (string /* arg, arg, ... */) { - var args = Array.prototype.slice.call(arguments, 1), - result = string.value; - - for (var i = 0; i < args.length; i++) { - /* jshint loopfunc:true */ - result = result.replace(/%[sda]/i, function(token) { - var value = ((args[i].type === 'Quoted') && - token.match(/s/i)) ? args[i].value : args[i].toCSS(); - return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; - }); - } - result = result.replace(/%%/g, '%'); - return new Quoted(string.quote || '', result, string.escaped); - } -}); - -},{"../tree/anonymous":50,"../tree/javascript":68,"../tree/quoted":80,"./function-registry":26}],33:[function(require,module,exports){ -module.exports = function(environment) { - var Dimension = require('../tree/dimension'), - Color = require('../tree/color'), - Expression = require('../tree/expression'), - Quoted = require('../tree/quoted'), - URL = require('../tree/url'), - functionRegistry = require('./function-registry'); - - functionRegistry.add('svg-gradient', function(direction) { - - var stops, - gradientDirectionSvg, - gradientType = 'linear', - rectangleDimension = 'x="0" y="0" width="1" height="1"', - renderEnv = {compress: false}, - returner, - directionValue = direction.toCSS(renderEnv), - i, color, position, positionValue, alpha; - - function throwArgumentDescriptor() { - throw { type: 'Argument', - message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' + - ' end_color [end_position] or direction, color list' }; - } - - if (arguments.length == 2) { - if (arguments[1].value.length < 2) { - throwArgumentDescriptor(); - } - stops = arguments[1].value; - } else if (arguments.length < 3) { - throwArgumentDescriptor(); - } else { - stops = Array.prototype.slice.call(arguments, 1); - } - - switch (directionValue) { - case 'to bottom': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"'; - break; - case 'to right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"'; - break; - case 'to bottom right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"'; - break; - case 'to top right': - gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; - break; - case 'ellipse': - case 'ellipse at center': - gradientType = 'radial'; - gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; - rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; - break; - default: - throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' + - ' \'to bottom right\', \'to top right\' or \'ellipse at center\'' }; - } - returner = '' + - '<' + gradientType + 'Gradient id="g" ' + gradientDirectionSvg + '>'; - - for (i = 0; i < stops.length; i += 1) { - if (stops[i] instanceof Expression) { - color = stops[i].value[0]; - position = stops[i].value[1]; - } else { - color = stops[i]; - position = undefined; - } - - if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { - throwArgumentDescriptor(); - } - positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%'; - alpha = color.alpha; - returner += ''; - } - returner += '' + - ''; - - returner = encodeURIComponent(returner); - - returner = 'data:image/svg+xml,' + returner; - return new URL(new Quoted('\'' + returner + '\'', returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - }); -}; - -},{"../tree/color":55,"../tree/dimension":62,"../tree/expression":64,"../tree/quoted":80,"../tree/url":85,"./function-registry":26}],34:[function(require,module,exports){ -var Keyword = require('../tree/keyword'), - DetachedRuleset = require('../tree/detached-ruleset'), - Dimension = require('../tree/dimension'), - Color = require('../tree/color'), - Quoted = require('../tree/quoted'), - Anonymous = require('../tree/anonymous'), - URL = require('../tree/url'), - Operation = require('../tree/operation'), - functionRegistry = require('./function-registry'); - -var isa = function (n, Type) { - return (n instanceof Type) ? Keyword.True : Keyword.False; - }, - isunit = function (n, unit) { - if (unit === undefined) { - throw { type: 'Argument', message: 'missing the required second argument to isunit.' }; - } - unit = typeof unit.value === 'string' ? unit.value : unit; - if (typeof unit !== 'string') { - throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' }; - } - return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; - }; - -functionRegistry.addMultiple({ - isruleset: function (n) { - return isa(n, DetachedRuleset); - }, - iscolor: function (n) { - return isa(n, Color); - }, - isnumber: function (n) { - return isa(n, Dimension); - }, - isstring: function (n) { - return isa(n, Quoted); - }, - iskeyword: function (n) { - return isa(n, Keyword); - }, - isurl: function (n) { - return isa(n, URL); - }, - ispixel: function (n) { - return isunit(n, 'px'); - }, - ispercentage: function (n) { - return isunit(n, '%'); - }, - isem: function (n) { - return isunit(n, 'em'); - }, - isunit: isunit, - unit: function (val, unit) { - if (!(val instanceof Dimension)) { - throw { type: 'Argument', - message: 'the first argument to unit must be a number' + - (val instanceof Operation ? '. Have you forgotten parenthesis?' : '') }; - } - if (unit) { - if (unit instanceof Keyword) { - unit = unit.value; - } else { - unit = unit.toCSS(); - } - } else { - unit = ''; - } - return new Dimension(val.value, unit); - }, - 'get-unit': function (n) { - return new Anonymous(n.unit); - } -}); - -},{"../tree/anonymous":50,"../tree/color":55,"../tree/detached-ruleset":61,"../tree/dimension":62,"../tree/keyword":70,"../tree/operation":77,"../tree/quoted":80,"../tree/url":85,"./function-registry":26}],35:[function(require,module,exports){ -var contexts = require('./contexts'), - Parser = require('./parser/parser'), - LessError = require('./less-error'), - utils = require('./utils'), - PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise, - logger = require('./logger'); - -module.exports = function(environment) { - - // FileInfo = { - // 'relativeUrls' - option - whether to adjust URL's to be relative - // 'filename' - full resolved filename of current file - // 'rootpath' - path to append to normal URLs for this node - // 'currentDirectory' - path to the current file, absolute - // 'rootFilename' - filename of the base file - // 'entryPath' - absolute path to the entry file - // 'reference' - whether the file should not be output and only output parts that are referenced - - var ImportManager = function(less, context, rootFileInfo) { - this.less = less; - this.rootFilename = rootFileInfo.filename; - this.paths = context.paths || []; // Search paths, when importing - this.contents = {}; // map - filename to contents of all the files - this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore - this.mime = context.mime; - this.error = null; - this.context = context; - // Deprecated? Unused outside of here, could be useful. - this.queue = []; // Files which haven't been imported yet - this.files = {}; // Holds the imported parse trees. - }; - - /** - * Add an import to be imported - * @param path - the raw path - * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension) - * @param currentFileInfo - the current file info (used for instance to work out relative paths) - * @param importOptions - import options - * @param callback - callback for when it is imported - */ - ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) { - var importManager = this, - pluginLoader = this.context.pluginManager.Loader; - - this.queue.push(path); - - var fileParsedFunc = function (e, root, fullPath) { - importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue - - var importedEqualsRoot = fullPath === importManager.rootFilename; - if (importOptions.optional && e) { - callback(null, {rules:[]}, false, null); - logger.info('The file ' + fullPath + ' was skipped because it was not found and the import was marked optional.'); - } - else { - // Inline imports aren't cached here. - // If we start to cache them, please make sure they won't conflict with non-inline imports of the - // same name as they used to do before this comment and the condition below have been added. - if (!importManager.files[fullPath] && !importOptions.inline) { - importManager.files[fullPath] = { root: root, options: importOptions }; - } - if (e && !importManager.error) { importManager.error = e; } - callback(e, root, importedEqualsRoot, fullPath); - } - }; - - var newFileInfo = { - relativeUrls: this.context.relativeUrls, - entryPath: currentFileInfo.entryPath, - rootpath: currentFileInfo.rootpath, - rootFilename: currentFileInfo.rootFilename - }; - - var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment); - - if (!fileManager) { - fileParsedFunc({ message: 'Could not find a file-manager for ' + path }); - return; - } - - var loadFileCallback = function(loadedFile) { - var plugin, - resolvedFilename = loadedFile.filename, - contents = loadedFile.contents.replace(/^\uFEFF/, ''); - - // Pass on an updated rootpath if path of imported file is relative and file - // is in a (sub|sup) directory - // - // Examples: - // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/', - // then rootpath should become 'less/module/nav/' - // - If path of imported file is '../mixins.less' and rootpath is 'less/', - // then rootpath should become 'less/../' - newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); - if (newFileInfo.relativeUrls) { - newFileInfo.rootpath = fileManager.join( - (importManager.context.rootpath || ''), - fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); - - if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { - newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); - } - } - newFileInfo.filename = resolvedFilename; - - var newEnv = new contexts.Parse(importManager.context); - - newEnv.processImports = false; - importManager.contents[resolvedFilename] = contents; - - if (currentFileInfo.reference || importOptions.reference) { - newFileInfo.reference = true; - } - - if (importOptions.isPlugin) { - plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo); - if (plugin instanceof LessError) { - fileParsedFunc(plugin, null, resolvedFilename); - } - else { - fileParsedFunc(null, plugin, resolvedFilename); - } - } else if (importOptions.inline) { - fileParsedFunc(null, contents, resolvedFilename); - } else { - - // import (multiple) parse trees apparently get altered and can't be cached. - // TODO: investigate why this is - if (importManager.files[resolvedFilename] - && !importManager.files[resolvedFilename].options.multiple - && !importOptions.multiple) { - - fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename); - } - else { - new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { - fileParsedFunc(e, root, resolvedFilename); - }); - } - } - }; - var promise, context = utils.clone(this.context); - - if (tryAppendExtension) { - context.ext = importOptions.isPlugin ? '.js' : '.less'; - } - - if (importOptions.isPlugin) { - promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); - } - else { - promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, - function(err, loadedFile) { - if (err) { - fileParsedFunc(err); - } else { - loadFileCallback(loadedFile); - } - }); - } - if (promise) { - promise.then(loadFileCallback, fileParsedFunc); - } - - }; - return ImportManager; -}; - -},{"./contexts":12,"./less-error":37,"./logger":38,"./parser/parser":44,"./utils":89,"promise":undefined}],36:[function(require,module,exports){ -module.exports = function(environment, fileManagers) { - var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment; - - var initial = { - version: [3, 7, 1], - data: require('./data'), - tree: require('./tree'), - Environment: (Environment = require('./environment/environment')), - AbstractFileManager: require('./environment/abstract-file-manager'), - AbstractPluginLoader: require('./environment/abstract-plugin-loader'), - environment: (environment = new Environment(environment, fileManagers)), - visitors: require('./visitors'), - Parser: require('./parser/parser'), - functions: require('./functions')(environment), - contexts: require('./contexts'), - SourceMapOutput: (SourceMapOutput = require('./source-map-output')(environment)), - SourceMapBuilder: (SourceMapBuilder = require('./source-map-builder')(SourceMapOutput, environment)), - ParseTree: (ParseTree = require('./parse-tree')(SourceMapBuilder)), - ImportManager: (ImportManager = require('./import-manager')(environment)), - render: require('./render')(environment, ParseTree, ImportManager), - parse: require('./parse')(environment, ParseTree, ImportManager), - LessError: require('./less-error'), - transformTree: require('./transform-tree'), - utils: require('./utils'), - PluginManager: require('./plugin-manager'), - logger: require('./logger') - }; - - // Create a public API - - var ctor = function(t) { - return function() { - var obj = Object.create(t.prototype); - t.apply(obj, Array.prototype.slice.call(arguments, 0)); - return obj; - }; - }; - var t, api = Object.create(initial); - for (var n in initial.tree) { - /* eslint guard-for-in: 0 */ - t = initial.tree[n]; - if (typeof t === 'function') { - api[n.toLowerCase()] = ctor(t); - } - else { - api[n] = Object.create(null); - for (var o in t) { - /* eslint guard-for-in: 0 */ - api[n][o.toLowerCase()] = ctor(t[o]); - } - } - } - - return api; -}; - -},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":17,"./environment/abstract-plugin-loader":18,"./environment/environment":19,"./functions":27,"./import-manager":35,"./less-error":37,"./logger":38,"./parse":41,"./parse-tree":40,"./parser/parser":44,"./plugin-manager":45,"./render":46,"./source-map-builder":47,"./source-map-output":48,"./transform-tree":49,"./tree":67,"./utils":89,"./visitors":93}],37:[function(require,module,exports){ -var utils = require('./utils'); -/** - * This is a centralized class of any error that could be thrown internally (mostly by the parser). - * Besides standard .message it keeps some additional data like a path to the file where the error - * occurred along with line and column numbers. - * - * @class - * @extends Error - * @type {module.LessError} - * - * @prop {string} type - * @prop {string} filename - * @prop {number} index - * @prop {number} line - * @prop {number} column - * @prop {number} callLine - * @prop {number} callExtract - * @prop {string[]} extract - * - * @param {Object} e - An error object to wrap around or just a descriptive object - * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager? - * @param {string} [currentFilename] - */ -var LessError = module.exports = function LessError(e, fileContentMap, currentFilename) { - Error.call(this); - - var filename = e.filename || currentFilename; - - this.message = e.message; - this.stack = e.stack; - - if (fileContentMap && filename) { - var input = fileContentMap.contents[filename], - loc = utils.getLocation(e.index, input), - line = loc.line, - col = loc.column, - callLine = e.call && utils.getLocation(e.call, input).line, - lines = input ? input.split('\n') : ''; - - this.type = e.type || 'Syntax'; - this.filename = filename; - this.index = e.index; - this.line = typeof line === 'number' ? line + 1 : null; - this.column = col; - - if (!this.line && this.stack) { - var found = this.stack.match(/(|Function):(\d+):(\d+)/); - - if (found) { - if (found[2]) { - this.line = parseInt(found[2]) - 2; - } - if (found[3]) { - this.column = parseInt(found[3]); - } - } - } - - this.callLine = callLine + 1; - this.callExtract = lines[callLine]; - - this.extract = [ - lines[this.line - 2], - lines[this.line - 1], - lines[this.line] - ]; - - } - -}; - -if (typeof Object.create === 'undefined') { - var F = function () {}; - F.prototype = Error.prototype; - LessError.prototype = new F(); -} else { - LessError.prototype = Object.create(Error.prototype); -} - -LessError.prototype.constructor = LessError; - -/** - * An overridden version of the default Object.prototype.toString - * which uses additional information to create a helpful message. - * - * @param {Object} options - * @returns {string} - */ -LessError.prototype.toString = function(options) { - options = options || {}; - - var message = ''; - var extract = this.extract || []; - var error = []; - var stylize = function (str) { return str; }; - if (options.stylize) { - var type = typeof options.stylize; - if (type !== 'function') { - throw Error('options.stylize should be a function, got a ' + type + '!'); - } - stylize = options.stylize; - } - - if (this.line !== null) { - if (typeof extract[0] === 'string') { - error.push(stylize((this.line - 1) + ' ' + extract[0], 'grey')); - } - - if (typeof extract[1] === 'string') { - var errorTxt = this.line + ' '; - if (extract[1]) { - errorTxt += extract[1].slice(0, this.column) + - stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') + - extract[1].slice(this.column + 1), 'red'), 'inverse'); - } - error.push(errorTxt); - } - - if (typeof extract[2] === 'string') { - error.push(stylize((this.line + 1) + ' ' + extract[2], 'grey')); - } - error = error.join('\n') + stylize('', 'reset') + '\n'; - } - - message += stylize(this.type + 'Error: ' + this.message, 'red'); - if (this.filename) { - message += stylize(' in ', 'red') + this.filename; - } - if (this.line) { - message += stylize(' on line ' + this.line + ', column ' + (this.column + 1) + ':', 'grey'); - } - - message += '\n' + error; - - if (this.callLine) { - message += stylize('from ', 'red') + (this.filename || '') + '/n'; - message += stylize(this.callLine, 'grey') + ' ' + this.callExtract + '/n'; - } - - return message; -}; - -},{"./utils":89}],38:[function(require,module,exports){ -module.exports = { - error: function(msg) { - this._fireEvent('error', msg); - }, - warn: function(msg) { - this._fireEvent('warn', msg); - }, - info: function(msg) { - this._fireEvent('info', msg); - }, - debug: function(msg) { - this._fireEvent('debug', msg); - }, - addListener: function(listener) { - this._listeners.push(listener); - }, - removeListener: function(listener) { - for (var i = 0; i < this._listeners.length; i++) { - if (this._listeners[i] === listener) { - this._listeners.splice(i, 1); - return; - } - } - }, - _fireEvent: function(type, msg) { - for (var i = 0; i < this._listeners.length; i++) { - var logFunction = this._listeners[i][type]; - if (logFunction) { - logFunction(msg); - } - } - }, - _listeners: [] -}; - -},{}],39:[function(require,module,exports){ -module.exports = { - ALWAYS: 0, - PARENS_DIVISION: 1, - PARENS: 2, - STRICT_LEGACY: 3 -}; -},{}],40:[function(require,module,exports){ -var LessError = require('./less-error'), - transformTree = require('./transform-tree'), - logger = require('./logger'); - -module.exports = function(SourceMapBuilder) { - var ParseTree = function(root, imports) { - this.root = root; - this.imports = imports; - }; - - ParseTree.prototype.toCSS = function(options) { - var evaldRoot, result = {}, sourceMapBuilder; - try { - evaldRoot = transformTree(this.root, options); - } catch (e) { - throw new LessError(e, this.imports); - } - - try { - var compress = Boolean(options.compress); - if (compress) { - logger.warn('The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.'); - } - - var toCSSOptions = { - compress: compress, - dumpLineNumbers: options.dumpLineNumbers, - strictUnits: Boolean(options.strictUnits), - numPrecision: 8}; - - if (options.sourceMap) { - sourceMapBuilder = new SourceMapBuilder(options.sourceMap); - result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports); - } else { - result.css = evaldRoot.toCSS(toCSSOptions); - } - } catch (e) { - throw new LessError(e, this.imports); - } - - if (options.pluginManager) { - var postProcessors = options.pluginManager.getPostProcessors(); - for (var i = 0; i < postProcessors.length; i++) { - result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports }); - } - } - if (options.sourceMap) { - result.map = sourceMapBuilder.getExternalSourceMap(); - } - - result.imports = []; - for (var file in this.imports.files) { - if (this.imports.files.hasOwnProperty(file) && file !== this.imports.rootFilename) { - result.imports.push(file); - } - } - return result; - }; - return ParseTree; -}; - -},{"./less-error":37,"./logger":38,"./transform-tree":49}],41:[function(require,module,exports){ -var PromiseConstructor, - contexts = require('./contexts'), - Parser = require('./parser/parser'), - PluginManager = require('./plugin-manager'), - LessError = require('./less-error'), - utils = require('./utils'); - -module.exports = function(environment, ParseTree, ImportManager) { - var parse = function (input, options, callback) { - - if (typeof options === 'function') { - callback = options; - options = utils.copyOptions(this.options, {}); - } - else { - options = utils.copyOptions(this.options, options || {}); - } - - if (!callback) { - if (!PromiseConstructor) { - PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise; - } - var self = this; - return new PromiseConstructor(function (resolve, reject) { - parse.call(self, input, options, function(err, output) { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } else { - var context, - rootFileInfo, - pluginManager = new PluginManager(this, !options.reUsePluginManager); - - options.pluginManager = pluginManager; - - context = new contexts.Parse(options); - - if (options.rootFileInfo) { - rootFileInfo = options.rootFileInfo; - } else { - var filename = options.filename || 'input'; - var entryPath = filename.replace(/[^\/\\]*$/, ''); - rootFileInfo = { - filename: filename, - relativeUrls: context.relativeUrls, - rootpath: context.rootpath || '', - currentDirectory: entryPath, - entryPath: entryPath, - rootFilename: filename - }; - // add in a missing trailing slash - if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') { - rootFileInfo.rootpath += '/'; - } - } - - var imports = new ImportManager(this, context, rootFileInfo); - this.importManager = imports; - - // TODO: allow the plugins to be just a list of paths or names - // Do an async plugin queue like lessc - - if (options.plugins) { - options.plugins.forEach(function(plugin) { - var evalResult, contents; - if (plugin.fileContent) { - contents = plugin.fileContent.replace(/^\uFEFF/, ''); - evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename); - if (evalResult instanceof LessError) { - return callback(evalResult); - } - } - else { - pluginManager.addPlugin(plugin); - } - }); - } - - new Parser(context, imports, rootFileInfo) - .parse(input, function (e, root) { - if (e) { return callback(e); } - callback(null, root, imports, options); - }, options); - } - }; - return parse; -}; - -},{"./contexts":12,"./less-error":37,"./parser/parser":44,"./plugin-manager":45,"./utils":89,"promise":undefined}],42:[function(require,module,exports){ -// Split the input into chunks. -module.exports = function (input, fail) { - var len = input.length, level = 0, parenLevel = 0, - lastOpening, lastOpeningParen, lastMultiComment, lastMultiCommentEndBrace, - chunks = [], emitFrom = 0, - chunkerCurrentIndex, currentChunkStartIndex, cc, cc2, matched; - - function emitChunk(force) { - var len = chunkerCurrentIndex - emitFrom; - if (((len < 512) && !force) || !len) { - return; - } - chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1)); - emitFrom = chunkerCurrentIndex + 1; - } - - for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc = input.charCodeAt(chunkerCurrentIndex); - if (((cc >= 97) && (cc <= 122)) || (cc < 34)) { - // a-z or whitespace - continue; - } - - switch (cc) { - case 40: // ( - parenLevel++; - lastOpeningParen = chunkerCurrentIndex; - continue; - case 41: // ) - if (--parenLevel < 0) { - return fail('missing opening `(`', chunkerCurrentIndex); - } - continue; - case 59: // ; - if (!parenLevel) { emitChunk(); } - continue; - case 123: // { - level++; - lastOpening = chunkerCurrentIndex; - continue; - case 125: // } - if (--level < 0) { - return fail('missing opening `{`', chunkerCurrentIndex); - } - if (!level && !parenLevel) { emitChunk(); } - continue; - case 92: // \ - if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; } - return fail('unescaped `\\`', chunkerCurrentIndex); - case 34: - case 39: - case 96: // ", ' and ` - matched = 0; - currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 > 96) { continue; } - if (cc2 == cc) { matched = 1; break; } - if (cc2 == 92) { // \ - if (chunkerCurrentIndex == len - 1) { - return fail('unescaped `\\`', chunkerCurrentIndex); - } - chunkerCurrentIndex++; - } - } - if (matched) { continue; } - return fail('unmatched `' + String.fromCharCode(cc) + '`', currentChunkStartIndex); - case 47: // /, check for comment - if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; } - cc2 = input.charCodeAt(chunkerCurrentIndex + 1); - if (cc2 == 47) { - // //, find lnfeed - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; } - } - } else if (cc2 == 42) { - // /*, find */ - lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; } - if (cc2 != 42) { continue; } - if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; } - } - if (chunkerCurrentIndex == len - 1) { - return fail('missing closing `*/`', currentChunkStartIndex); - } - chunkerCurrentIndex++; - } - continue; - case 42: // *, check for unmatched */ - if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) { - return fail('unmatched `/*`', chunkerCurrentIndex); - } - continue; - } - } - - if (level !== 0) { - if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) { - return fail('missing closing `}` or `*/`', lastOpening); - } else { - return fail('missing closing `}`', lastOpening); - } - } else if (parenLevel !== 0) { - return fail('missing closing `)`', lastOpeningParen); - } - - emitChunk(true); - return chunks; -}; - -},{}],43:[function(require,module,exports){ -var chunker = require('./chunker'); - -module.exports = function() { - var input, // Less input string - j, // current chunk - saveStack = [], // holds state for backtracking - furthest, // furthest index the parser has gone to - furthestPossibleErrorMessage, // if this is furthest we got to, this is the probably cause - chunks, // chunkified input - current, // current chunk - currentPos, // index of current chunk, in `input` - parserInput = {}; - - var CHARCODE_SPACE = 32, - CHARCODE_TAB = 9, - CHARCODE_LF = 10, - CHARCODE_CR = 13, - CHARCODE_PLUS = 43, - CHARCODE_COMMA = 44, - CHARCODE_FORWARD_SLASH = 47, - CHARCODE_9 = 57; - - function skipWhitespace(length) { - var oldi = parserInput.i, oldj = j, - curr = parserInput.i - currentPos, - endIndex = parserInput.i + current.length - curr, - mem = (parserInput.i += length), - inp = input, - c, nextChar, comment; - - for (; parserInput.i < endIndex; parserInput.i++) { - c = inp.charCodeAt(parserInput.i); - - if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) { - nextChar = inp.charAt(parserInput.i + 1); - if (nextChar === '/') { - comment = {index: parserInput.i, isLineComment: true}; - var nextNewLine = inp.indexOf('\n', parserInput.i + 2); - if (nextNewLine < 0) { - nextNewLine = endIndex; - } - parserInput.i = nextNewLine; - comment.text = inp.substr(comment.index, parserInput.i - comment.index); - parserInput.commentStore.push(comment); - continue; - } else if (nextChar === '*') { - var nextStarSlash = inp.indexOf('*/', parserInput.i + 2); - if (nextStarSlash >= 0) { - comment = { - index: parserInput.i, - text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), - isLineComment: false - }; - parserInput.i += comment.text.length - 1; - parserInput.commentStore.push(comment); - continue; - } - } - break; - } - - if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) { - break; - } - } - - current = current.slice(length + parserInput.i - mem + curr); - currentPos = parserInput.i; - - if (!current.length) { - if (j < chunks.length - 1) { - current = chunks[++j]; - skipWhitespace(0); // skip space at the beginning of a chunk - return true; // things changed - } - parserInput.finished = true; - } - - return oldi !== parserInput.i || oldj !== j; - } - - parserInput.save = function() { - currentPos = parserInput.i; - saveStack.push( { current: current, i: parserInput.i, j: j }); - }; - parserInput.restore = function(possibleErrorMessage) { - - if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) { - furthest = parserInput.i; - furthestPossibleErrorMessage = possibleErrorMessage; - } - var state = saveStack.pop(); - current = state.current; - currentPos = parserInput.i = state.i; - j = state.j; - }; - parserInput.forget = function() { - saveStack.pop(); - }; - parserInput.isWhitespace = function (offset) { - var pos = parserInput.i + (offset || 0), - code = input.charCodeAt(pos); - return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF); - }; - - // Specialization of $(tok) - parserInput.$re = function(tok) { - if (parserInput.i > currentPos) { - current = current.slice(parserInput.i - currentPos); - currentPos = parserInput.i; - } - - var m = tok.exec(current); - if (!m) { - return null; - } - - skipWhitespace(m[0].length); - if (typeof m === 'string') { - return m; - } - - return m.length === 1 ? m[0] : m; - }; - - parserInput.$char = function(tok) { - if (input.charAt(parserInput.i) !== tok) { - return null; - } - skipWhitespace(1); - return tok; - }; - - parserInput.$str = function(tok) { - var tokLength = tok.length; - - // https://jsperf.com/string-startswith/21 - for (var i = 0; i < tokLength; i++) { - if (input.charAt(parserInput.i + i) !== tok.charAt(i)) { - return null; - } - } - - skipWhitespace(tokLength); - return tok; - }; - - parserInput.$quoted = function(loc) { - var pos = loc || parserInput.i, - startChar = input.charAt(pos); - - if (startChar !== '\'' && startChar !== '"') { - return; - } - var length = input.length, - currentPosition = pos; - - for (var i = 1; i + currentPosition < length; i++) { - var nextChar = input.charAt(i + currentPosition); - switch (nextChar) { - case '\\': - i++; - continue; - case '\r': - case '\n': - break; - case startChar: - var str = input.substr(currentPosition, i + 1); - if (!loc && loc !== 0) { - skipWhitespace(i + 1); - return str - } - return [startChar, str]; - default: - } - } - return null; - }; - - /** - * Permissive parsing. Ignores everything except matching {} [] () and quotes - * until matching token (outside of blocks) - */ - parserInput.$parseUntil = function(tok) { - var quote = '', - returnVal = null, - inComment = false, - blockDepth = 0, - blockStack = [], - parseGroups = [], - length = input.length, - startPos = parserInput.i, - lastPos = parserInput.i, - i = parserInput.i, - loop = true, - testChar; - - if (typeof tok === 'string') { - testChar = function(char) { - return char === tok; - } - } else { - testChar = function(char) { - return tok.test(char); - } - } - - do { - var prevChar, nextChar = input.charAt(i); - if (blockDepth === 0 && testChar(nextChar)) { - returnVal = input.substr(lastPos, i - lastPos); - if (returnVal) { - parseGroups.push(returnVal); - } - else { - parseGroups.push(' '); - } - returnVal = parseGroups; - skipWhitespace(i - startPos); - loop = false - } else { - if (inComment) { - if (nextChar === '*' && - input.charAt(i + 1) === '/') { - i++; - blockDepth--; - inComment = false; - } - i++; - continue; - } - switch (nextChar) { - case '\\': - i++; - nextChar = input.charAt(i); - parseGroups.push(input.substr(lastPos, i - lastPos + 1)); - lastPos = i + 1; - break; - case '/': - if (input.charAt(i + 1) === '*') { - i++; - inComment = true; - blockDepth++; - } - break; - case '\'': - case '"': - quote = parserInput.$quoted(i); - if (quote) { - parseGroups.push(input.substr(lastPos, i - lastPos), quote); - i += quote[1].length - 1; - lastPos = i + 1; - } - else { - skipWhitespace(i - startPos); - returnVal = nextChar; - loop = false; - } - break; - case '{': - blockStack.push('}'); - blockDepth++; - break; - case '(': - blockStack.push(')'); - blockDepth++; - break; - case '[': - blockStack.push(']'); - blockDepth++; - break; - case '}': - case ')': - case ']': - var expected = blockStack.pop(); - if (nextChar === expected) { - blockDepth--; - } else { - // move the parser to the error and return expected - skipWhitespace(i - startPos); - returnVal = expected; - loop = false; - } - } - i++; - if (i > length) { - loop = false; - } - } - prevChar = nextChar; - } while (loop); - - return returnVal ? returnVal : null; - } - - parserInput.autoCommentAbsorb = true; - parserInput.commentStore = []; - parserInput.finished = false; - - // Same as $(), but don't change the state of the parser, - // just return the match. - parserInput.peek = function(tok) { - if (typeof tok === 'string') { - // https://jsperf.com/string-startswith/21 - for (var i = 0; i < tok.length; i++) { - if (input.charAt(parserInput.i + i) !== tok.charAt(i)) { - return false; - } - } - return true; - } else { - return tok.test(current); - } - }; - - // Specialization of peek() - // TODO remove or change some currentChar calls to peekChar - parserInput.peekChar = function(tok) { - return input.charAt(parserInput.i) === tok; - }; - - parserInput.currentChar = function() { - return input.charAt(parserInput.i); - }; - - parserInput.prevChar = function() { - return input.charAt(parserInput.i - 1); - }; - - parserInput.getInput = function() { - return input; - }; - - parserInput.peekNotNumeric = function() { - var c = input.charCodeAt(parserInput.i); - // Is the first char of the dimension 0-9, '.', '+' or '-' - return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA; - }; - - parserInput.start = function(str, chunkInput, failFunction) { - input = str; - parserInput.i = j = currentPos = furthest = 0; - - // chunking apparently makes things quicker (but my tests indicate - // it might actually make things slower in node at least) - // and it is a non-perfect parse - it can't recognise - // unquoted urls, meaning it can't distinguish comments - // meaning comments with quotes or {}() in them get 'counted' - // and then lead to parse errors. - // In addition if the chunking chunks in the wrong place we might - // not be able to parse a parser statement in one go - // this is officially deprecated but can be switched on via an option - // in the case it causes too much performance issues. - if (chunkInput) { - chunks = chunker(str, failFunction); - } else { - chunks = [str]; - } - - current = chunks[0]; - - skipWhitespace(0); - }; - - parserInput.end = function() { - var message, - isFinished = parserInput.i >= input.length; - - if (parserInput.i < furthest) { - message = furthestPossibleErrorMessage; - parserInput.i = furthest; - } - return { - isFinished: isFinished, - furthest: parserInput.i, - furthestPossibleErrorMessage: message, - furthestReachedEnd: parserInput.i >= input.length - 1, - furthestChar: input[parserInput.i] - }; - }; - - return parserInput; -}; - -},{"./chunker":42}],44:[function(require,module,exports){ -var LessError = require('../less-error'), - tree = require('../tree'), - visitors = require('../visitors'), - getParserInput = require('./parser-input'), - utils = require('../utils'), - functionRegistry = require('../functions/function-registry'); - -// -// less.js - parser -// -// A relatively straight-forward predictive parser. -// There is no tokenization/lexing stage, the input is parsed -// in one sweep. -// -// To make the parser fast enough to run in the browser, several -// optimization had to be made: -// -// - Matching and slicing on a huge input is often cause of slowdowns. -// The solution is to chunkify the input into smaller strings. -// The chunks are stored in the `chunks` var, -// `j` holds the current chunk index, and `currentPos` holds -// the index of the current chunk in relation to `input`. -// This gives us an almost 4x speed-up. -// -// - In many cases, we don't need to match individual tokens; -// for example, if a value doesn't hold any variables, operations -// or dynamic references, the parser can effectively 'skip' it, -// treating it as a literal. -// An example would be '1px solid #000' - which evaluates to itself, -// we don't need to know what the individual components are. -// The drawback, of course is that you don't get the benefits of -// syntax-checking on the CSS. This gives us a 50% speed-up in the parser, -// and a smaller speed-up in the code-gen. -// -// -// Token matching is done with the `$` function, which either takes -// a terminal string or regexp, or a non-terminal function to call. -// It also takes care of moving all the indices forwards. -// - -var Parser = function Parser(context, imports, fileInfo) { - var parsers, - parserInput = getParserInput(); - - function error(msg, type) { - throw new LessError( - { - index: parserInput.i, - filename: fileInfo.filename, - type: type || 'Syntax', - message: msg - }, - imports - ); - } - - function expect(arg, msg) { - // some older browsers return typeof 'function' for RegExp - var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); - if (result) { - return result; - } - - error(msg || (typeof arg === 'string' - ? 'expected \'' + arg + '\' got \'' + parserInput.currentChar() + '\'' - : 'unexpected token')); - } - - // Specialization of expect() - function expectChar(arg, msg) { - if (parserInput.$char(arg)) { - return arg; - } - error(msg || 'expected \'' + arg + '\' got \'' + parserInput.currentChar() + '\''); - } - - function getDebugInfo(index) { - var filename = fileInfo.filename; - - return { - lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1, - fileName: filename - }; - } - - /** - * Used after initial parsing to create nodes on the fly - * - * @param {String} str - string to parse - * @param {Array} parseList - array of parsers to run input through e.g. ["value", "important"] - * @param {Number} currentIndex - start number to begin indexing - * @param {Object} fileInfo - fileInfo to attach to created nodes - */ - function parseNode(str, parseList, currentIndex, fileInfo, callback) { - var result, returnNodes = []; - var parser = parserInput; - - try { - parser.start(str, false, function fail(msg, index) { - callback({ - message: msg, - index: index + currentIndex - }); - }); - for (var x = 0, p, i; (p = parseList[x]); x++) { - i = parser.i; - result = parsers[p](); - if (result) { - result._index = i + currentIndex; - result._fileInfo = fileInfo; - returnNodes.push(result); - } - else { - returnNodes.push(null); - } - } - - var endInfo = parser.end(); - if (endInfo.isFinished) { - callback(null, returnNodes); - } - else { - callback(true, null); - } - } catch (e) { - throw new LessError({ - index: e.index + currentIndex, - message: e.message - }, imports, fileInfo.filename); - } - } - - // - // The Parser - // - return { - parserInput: parserInput, - imports: imports, - fileInfo: fileInfo, - parseNode: parseNode, - // - // Parse an input string into an abstract syntax tree, - // @param str A string containing 'less' markup - // @param callback call `callback` when done. - // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply - // - parse: function (str, callback, additionalData) { - var root, error = null, globalVars, modifyVars, ignored, preText = ''; - - globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars) + '\n' : ''; - modifyVars = (additionalData && additionalData.modifyVars) ? '\n' + Parser.serializeVars(additionalData.modifyVars) : ''; - - if (context.pluginManager) { - var preProcessors = context.pluginManager.getPreProcessors(); - for (var i = 0; i < preProcessors.length; i++) { - str = preProcessors[i].process(str, { context: context, imports: imports, fileInfo: fileInfo }); - } - } - - if (globalVars || (additionalData && additionalData.banner)) { - preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars; - ignored = imports.contentsIgnoredChars; - ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0; - ignored[fileInfo.filename] += preText.length; - } - - str = str.replace(/\r\n?/g, '\n'); - // Remove potential UTF Byte Order Mark - str = preText + str.replace(/^\uFEFF/, '') + modifyVars; - imports.contents[fileInfo.filename] = str; - - // Start with the primary rule. - // The whole syntax tree is held under a Ruleset node, - // with the `root` property set to true, so no `{}` are - // output. The callback is called when the input is parsed. - try { - parserInput.start(str, context.chunkInput, function fail(msg, index) { - throw new LessError({ - index: index, - type: 'Parse', - message: msg, - filename: fileInfo.filename - }, imports); - }); - - tree.Node.prototype.parse = this; - root = new tree.Ruleset(null, this.parsers.primary()); - tree.Node.prototype.rootNode = root; - root.root = true; - root.firstRoot = true; - root.functionRegistry = functionRegistry.inherit(); - - } catch (e) { - return callback(new LessError(e, imports, fileInfo.filename)); - } - - // If `i` is smaller than the `input.length - 1`, - // it means the parser wasn't able to parse the whole - // string, so we've got a parsing error. - // - // We try to extract a \n delimited string, - // showing the line where the parse error occurred. - // We split it up into two parts (the part which parsed, - // and the part which didn't), so we can color them differently. - var endInfo = parserInput.end(); - if (!endInfo.isFinished) { - - var message = endInfo.furthestPossibleErrorMessage; - - if (!message) { - message = 'Unrecognised input'; - if (endInfo.furthestChar === '}') { - message += '. Possibly missing opening \'{\''; - } else if (endInfo.furthestChar === ')') { - message += '. Possibly missing opening \'(\''; - } else if (endInfo.furthestReachedEnd) { - message += '. Possibly missing something'; - } - } - - error = new LessError({ - type: 'Parse', - message: message, - index: endInfo.furthest, - filename: fileInfo.filename - }, imports); - } - - var finish = function (e) { - e = error || e || imports.error; - - if (e) { - if (!(e instanceof LessError)) { - e = new LessError(e, imports, fileInfo.filename); - } - - return callback(e); - } - else { - return callback(null, root); - } - }; - - if (context.processImports !== false) { - new visitors.ImportVisitor(imports, finish) - .run(root); - } else { - return finish(); - } - }, - - // - // Here in, the parsing rules/functions - // - // The basic structure of the syntax tree generated is as follows: - // - // Ruleset -> Declaration -> Value -> Expression -> Entity - // - // Here's some Less code: - // - // .class { - // color: #fff; - // border: 1px solid #000; - // width: @w + 4px; - // > .child {...} - // } - // - // And here's what the parse tree might look like: - // - // Ruleset (Selector '.class', [ - // Declaration ("color", Value ([Expression [Color #fff]])) - // Declaration ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Declaration ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) - // Ruleset (Selector [Element '>', '.child'], [...]) - // ]) - // - // In general, most rules will try to parse a token with the `$re()` function, and if the return - // value is truly, will return a new node, of the relevant type. Sometimes, we need to check - // first, before parsing, that's when we use `peek()`. - // - parsers: parsers = { - // - // The `primary` rule is the *entry* and *exit* point of the parser. - // The rules here can appear at any level of the parse tree. - // - // The recursive nature of the grammar is an interplay between the `block` - // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, - // as represented by this simplified grammar: - // - // primary → (ruleset | declaration)+ - // ruleset → selector+ block - // block → '{' primary '}' - // - // Only at one point is the primary rule not called from the - // block rule: at the root level. - // - primary: function () { - var mixin = this.mixin, root = [], node; - - while (true) { - while (true) { - node = this.comment(); - if (!node) { break; } - root.push(node); - } - // always process comments before deciding if finished - if (parserInput.finished) { - break; - } - if (parserInput.peek('}')) { - break; - } - - node = this.extendRule(); - if (node) { - root = root.concat(node); - continue; - } - - node = mixin.definition() || this.declaration() || this.ruleset() || - mixin.call(false, false) || this.variableCall() || this.entities.call() || this.atrule(); - if (node) { - root.push(node); - } else { - var foundSemiColon = false; - while (parserInput.$char(';')) { - foundSemiColon = true; - } - if (!foundSemiColon) { - break; - } - } - } - - return root; - }, - - // comments are collected by the main parsing mechanism and then assigned to nodes - // where the current structure allows it - comment: function () { - if (parserInput.commentStore.length) { - var comment = parserInput.commentStore.shift(); - return new(tree.Comment)(comment.text, comment.isLineComment, comment.index, fileInfo); - } - }, - - // - // Entities are tokens which can be found inside an Expression - // - entities: { - mixinLookup: function() { - return parsers.mixin.call(true, true); - }, - // - // A string, which supports escaping " and ' - // - // "milky way" 'he\'s the one!' - // - quoted: function (forceEscaped) { - var str, index = parserInput.i, isEscaped = false; - - parserInput.save(); - if (parserInput.$char('~')) { - isEscaped = true; - } else if (forceEscaped) { - parserInput.restore(); - return; - } - - str = parserInput.$quoted(); - if (!str) { - parserInput.restore(); - return; - } - parserInput.forget(); - - return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index, fileInfo); - }, - - // - // A catch-all word, such as: - // - // black border-collapse - // - keyword: function () { - var k = parserInput.$char('%') || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/); - if (k) { - return tree.Color.fromKeyword(k) || new(tree.Keyword)(k); - } - }, - - // - // A function call - // - // rgb(255, 0, 255) - // - // The arguments are parsed with the `entities.arguments` parser. - // - call: function () { - var name, args, func, index = parserInput.i; - - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (parserInput.peek(/^url\(/i)) { - return; - } - - parserInput.save(); - - name = parserInput.$re(/^([\w-]+|%|progid:[\w\.]+)\(/); - if (!name) { - parserInput.forget(); - return; - } - - name = name[1]; - func = this.customFuncCall(name); - if (func) { - args = func.parse(); - if (args && func.stop) { - parserInput.forget(); - return args; - } - } - - args = this.arguments(args); - - if (!parserInput.$char(')')) { - parserInput.restore('Could not parse call arguments or missing \')\''); - return; - } - - parserInput.forget(); - - return new(tree.Call)(name, args, index, fileInfo); - }, - - // - // Parsing rules for functions with non-standard args, e.g.: - // - // boolean(not(2 > 1)) - // - // This is a quick prototype, to be modified/improved when - // more custom-parsed funcs come (e.g. `selector(...)`) - // - - customFuncCall: function (name) { - /* Ideally the table is to be moved out of here for faster perf., - but it's quite tricky since it relies on all these `parsers` - and `expect` available only here */ - return { - alpha: f(parsers.ieAlpha, true), - boolean: f(condition), - 'if': f(condition) - }[name.toLowerCase()]; - - function f(parse, stop) { - return { - parse: parse, // parsing function - stop: stop // when true - stop after parse() and return its result, - // otherwise continue for plain args - }; - } - - function condition() { - return [expect(parsers.condition, 'expected condition')]; - } - }, - - arguments: function (prevArgs) { - var argsComma = prevArgs || [], - argsSemiColon = [], - isSemiColonSeparated, value; - - parserInput.save(); - - while (true) { - if (prevArgs) { - prevArgs = false; - } else { - value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); - if (!value) { - break; - } - - if (value.value && value.value.length == 1) { - value = value.value[0]; - } - - argsComma.push(value); - } - - if (parserInput.$char(',')) { - continue; - } - - if (parserInput.$char(';') || isSemiColonSeparated) { - isSemiColonSeparated = true; - value = (argsComma.length < 1) ? argsComma[0] - : new tree.Value(argsComma); - argsSemiColon.push(value); - argsComma = []; - } - } - - parserInput.forget(); - return isSemiColonSeparated ? argsSemiColon : argsComma; - }, - literal: function () { - return this.dimension() || - this.color() || - this.quoted() || - this.unicodeDescriptor(); - }, - - // Assignments are argument entities for calls. - // They are present in ie filter properties as shown below. - // - // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* ) - // - - assignment: function () { - var key, value; - parserInput.save(); - key = parserInput.$re(/^\w+(?=\s?=)/i); - if (!key) { - parserInput.restore(); - return; - } - if (!parserInput.$char('=')) { - parserInput.restore(); - return; - } - value = parsers.entity(); - if (value) { - parserInput.forget(); - return new(tree.Assignment)(key, value); - } else { - parserInput.restore(); - } - }, - - // - // Parse url() tokens - // - // We use a specific rule for urls, because they don't really behave like - // standard function calls. The difference is that the argument doesn't have - // to be enclosed within a string, so it can't be parsed as an Expression. - // - url: function () { - var value, index = parserInput.i; - - parserInput.autoCommentAbsorb = false; - - if (!parserInput.$str('url(')) { - parserInput.autoCommentAbsorb = true; - return; - } - - value = this.quoted() || this.variable() || this.property() || - parserInput.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || ''; - - parserInput.autoCommentAbsorb = true; - - expectChar(')'); - - return new(tree.URL)((value.value != null || - value instanceof tree.Variable || - value instanceof tree.Property) ? - value : new(tree.Anonymous)(value, index), index, fileInfo); - }, - - // - // A Variable entity, such as `@fink`, in - // - // width: @fink + 2px - // - // We use a different parser for variable definitions, - // see `parsers.variable`. - // - variable: function () { - var ch, name, index = parserInput.i; - - parserInput.save(); - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { - ch = parserInput.currentChar(); - if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) { - // this may be a VariableCall lookup - var result = parsers.variableCall(name); - if (result) { - parserInput.forget(); - return result; - } - } - parserInput.forget(); - return new(tree.Variable)(name, index, fileInfo); - } - parserInput.restore(); - }, - - // A variable entity using the protective {} e.g. @{var} - variableCurly: function () { - var curly, index = parserInput.i; - - if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { - return new(tree.Variable)('@' + curly[1], index, fileInfo); - } - }, - // - // A Property accessor, such as `$color`, in - // - // background-color: $color - // - property: function () { - var name, index = parserInput.i; - - if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\$[\w-]+/))) { - return new(tree.Property)(name, index, fileInfo); - } - }, - - // A property entity useing the protective {} e.g. ${prop} - propertyCurly: function () { - var curly, index = parserInput.i; - - if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { - return new(tree.Property)('$' + curly[1], index, fileInfo); - } - }, - // - // A Hexadecimal color - // - // #4F3C2F - // - // `rgb` and `hsl` colors are parsed through the `entities.call` parser. - // - color: function () { - var rgb; - - if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) { - // strip colons, brackets, whitespaces and other characters that should not - // definitely be part of color string - var colorCandidateString = rgb.input.match(/^#([\w]+).*/); - colorCandidateString = colorCandidateString[1]; - if (!colorCandidateString.match(/^[A-Fa-f0-9]+$/)) { // verify if candidate consists only of allowed HEX characters - error('Invalid HEX color code'); - } - return new(tree.Color)(rgb[1], undefined, '#' + colorCandidateString); - } - }, - - colorKeyword: function () { - parserInput.save(); - var autoCommentAbsorb = parserInput.autoCommentAbsorb; - parserInput.autoCommentAbsorb = false; - var k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/); - parserInput.autoCommentAbsorb = autoCommentAbsorb; - if (!k) { - parserInput.forget(); - return; - } - parserInput.restore(); - var color = tree.Color.fromKeyword(k); - if (color) { - parserInput.$str(k); - return color; - } - }, - - // - // A Dimension, that is, a number and a unit - // - // 0.5em 95% - // - dimension: function () { - if (parserInput.peekNotNumeric()) { - return; - } - - var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i); - if (value) { - return new(tree.Dimension)(value[1], value[2]); - } - }, - - // - // A unicode descriptor, as is used in unicode-range - // - // U+0?? or U+00A1-00A9 - // - unicodeDescriptor: function () { - var ud; - - ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/); - if (ud) { - return new(tree.UnicodeDescriptor)(ud[0]); - } - }, - - // - // JavaScript code to be evaluated - // - // `window.location.href` - // - javascript: function () { - var js, index = parserInput.i; - - parserInput.save(); - - var escape = parserInput.$char('~'); - var jsQuote = parserInput.$char('`'); - - if (!jsQuote) { - parserInput.restore(); - return; - } - - js = parserInput.$re(/^[^`]*`/); - if (js) { - parserInput.forget(); - return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index, fileInfo); - } - parserInput.restore('invalid javascript definition'); - } - }, - - // - // The variable part of a variable definition. Used in the `rule` parser - // - // @fink: - // - variable: function () { - var name; - - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { return name[1]; } - }, - - // - // Call a variable value to retrieve a detached ruleset - // or a value from a detached ruleset's rules. - // - // @fink(); - // @fink; - // color: @fink[@color]; - // - variableCall: function (parsedName) { - var lookups, important, i = parserInput.i, - inValue = !!parsedName, name = parsedName; - - parserInput.save(); - - if (name || (parserInput.currentChar() === '@' - && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/)))) { - - lookups = this.mixin.ruleLookups(); - - if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) { - parserInput.restore('Missing \'[...]\' lookup in variable call'); - return; - } - - if (!inValue) { - name = name[1]; - } - - if (lookups && parsers.important()) { - important = true; - } - - var call = new tree.VariableCall(name, i, fileInfo); - if (!inValue && parsers.end()) { - parserInput.forget(); - return call; - } - else { - parserInput.forget(); - return new tree.NamespaceValue(call, lookups, important, i, fileInfo); - } - } - - parserInput.restore(); - }, - - // - // extend syntax - used to extend selectors - // - extend: function(isRule) { - var elements, e, index = parserInput.i, option, extendList, extend; - - if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) { - return; - } - - do { - option = null; - elements = null; - while (!(option = parserInput.$re(/^(all)(?=\s*(\)|,))/))) { - e = this.element(); - if (!e) { - break; - } - if (elements) { - elements.push(e); - } else { - elements = [ e ]; - } - } - - option = option && option[1]; - if (!elements) { - error('Missing target selector for :extend().'); - } - extend = new(tree.Extend)(new(tree.Selector)(elements), option, index, fileInfo); - if (extendList) { - extendList.push(extend); - } else { - extendList = [ extend ]; - } - } while (parserInput.$char(',')); - - expect(/^\)/); - - if (isRule) { - expect(/^;/); - } - - return extendList; - }, - - // - // extendRule - used in a rule to extend all the parent selectors - // - extendRule: function() { - return this.extend(true); - }, - - // - // Mixins - // - mixin: { - // - // A Mixin call, with an optional argument list - // - // #mixins > .square(#fff); - // #mixins.square(#fff); - // .rounded(4px, black); - // .button; - // - // We can lookup / return a value using the lookup syntax: - // - // color: #mixin.square(#fff)[@color]; - // - // The `while` loop is there because mixins can be - // namespaced, but we only support the child and descendant - // selector for now. - // - call: function (inValue, getLookup) { - var s = parserInput.currentChar(), important = false, lookups, - index = parserInput.i, elements, args, hasParens; - - if (s !== '.' && s !== '#') { return; } - - parserInput.save(); // stop us absorbing part of an invalid selector - - elements = this.elements(); - - if (elements) { - if (parserInput.$char('(')) { - args = this.args(true).args; - expectChar(')'); - hasParens = true; - } - - if (getLookup !== false) { - lookups = this.ruleLookups(); - } - if (getLookup === true && !lookups) { - parserInput.restore(); - return; - } - - if (inValue && !lookups && !hasParens) { - // This isn't a valid in-value mixin call - parserInput.restore(); - return; - } - - if (!inValue && parsers.important()) { - important = true; - } - - if (inValue || parsers.end()) { - parserInput.forget(); - var mixin = new(tree.mixin.Call)(elements, args, index, fileInfo, !lookups && important); - if (lookups) { - return new tree.NamespaceValue(mixin, lookups, important); - } - else { - return mixin; - } - } - } - - parserInput.restore(); - }, - /** - * Matching elements for mixins - * (Start with . or # and can have > ) - */ - elements: function() { - var elements, e, c, elem, elemIndex, - re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/; - while (true) { - elemIndex = parserInput.i; - e = parserInput.$re(re); - - if (!e) { - break; - } - elem = new(tree.Element)(c, e, false, elemIndex, fileInfo); - if (elements) { - elements.push(elem); - } else { - elements = [ elem ]; - } - c = parserInput.$char('>'); - } - return elements; - }, - args: function (isCall) { - var entities = parsers.entities, - returner = { args:null, variadic: false }, - expressions = [], argsSemiColon = [], argsComma = [], - isSemiColonSeparated, expressionContainsNamed, name, nameLoop, - value, arg, expand, hasSep = true; - - parserInput.save(); - - while (true) { - if (isCall) { - arg = parsers.detachedRuleset() || parsers.expression(); - } else { - parserInput.commentStore.length = 0; - if (parserInput.$str('...')) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ variadic: true }); - break; - } - arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true); - } - - if (!arg || !hasSep) { - break; - } - - nameLoop = null; - if (arg.throwAwayComments) { - arg.throwAwayComments(); - } - value = arg; - var val = null; - - if (isCall) { - // Variable - if (arg.value && arg.value.length == 1) { - val = arg.value[0]; - } - } else { - val = arg; - } - - if (val && (val instanceof tree.Variable || val instanceof tree.Property)) { - if (parserInput.$char(':')) { - if (expressions.length > 0) { - if (isSemiColonSeparated) { - error('Cannot mix ; and , as delimiter types'); - } - expressionContainsNamed = true; - } - - value = parsers.detachedRuleset() || parsers.expression(); - - if (!value) { - if (isCall) { - error('could not understand value for named argument'); - } else { - parserInput.restore(); - returner.args = []; - return returner; - } - } - nameLoop = (name = val.name); - } else if (parserInput.$str('...')) { - if (!isCall) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ name: arg.name, variadic: true }); - break; - } else { - expand = true; - } - } else if (!isCall) { - name = nameLoop = val.name; - value = null; - } - } - - if (value) { - expressions.push(value); - } - - argsComma.push({ name:nameLoop, value:value, expand:expand }); - - if (parserInput.$char(',')) { - hasSep = true; - continue; - } - hasSep = parserInput.$char(';') === ';'; - - if (hasSep || isSemiColonSeparated) { - - if (expressionContainsNamed) { - error('Cannot mix ; and , as delimiter types'); - } - - isSemiColonSeparated = true; - - if (expressions.length > 1) { - value = new(tree.Value)(expressions); - } - argsSemiColon.push({ name:name, value:value, expand:expand }); - - name = null; - expressions = []; - expressionContainsNamed = false; - } - } - - parserInput.forget(); - returner.args = isSemiColonSeparated ? argsSemiColon : argsComma; - return returner; - }, - // - // A Mixin definition, with a list of parameters - // - // .rounded (@radius: 2px, @color) { - // ... - // } - // - // Until we have a finer grained state-machine, we have to - // do a look-ahead, to make sure we don't have a mixin call. - // See the `rule` function for more information. - // - // We start by matching `.rounded (`, and then proceed on to - // the argument list, which has optional default values. - // We store the parameters in `params`, with a `value` key, - // if there is a value, such as in the case of `@radius`. - // - // Once we've got our params list, and a closing `)`, we parse - // the `{...}` block. - // - definition: function () { - var name, params = [], match, ruleset, cond, variadic = false; - if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') || - parserInput.peek(/^[^{]*\}/)) { - return; - } - - parserInput.save(); - - match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/); - if (match) { - name = match[1]; - - var argInfo = this.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - - // .mixincall("@{a}"); - // looks a bit like a mixin definition.. - // also - // .mixincall(@a: {rule: set;}); - // so we have to be nice and restore - if (!parserInput.$char(')')) { - parserInput.restore('Missing closing \')\''); - return; - } - - parserInput.commentStore.length = 0; - - if (parserInput.$str('when')) { // Guard - cond = expect(parsers.conditions, 'expected condition'); - } - - ruleset = parsers.block(); - - if (ruleset) { - parserInput.forget(); - return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic); - } else { - parserInput.restore(); - } - } else { - parserInput.forget(); - } - }, - - ruleLookups: function() { - var rule, args, lookups = []; - - if (parserInput.currentChar() !== '[') { - return; - } - - while (true) { - parserInput.save(); - args = null; - rule = this.lookupValue(); - if (!rule && rule !== '') { - parserInput.restore(); - break; - } - lookups.push(rule); - parserInput.forget(); - } - if (lookups.length > 0) { - return lookups; - } - }, - - lookupValue: function() { - parserInput.save(); - - if (!parserInput.$char('[')) { - parserInput.restore(); - return; - } - - var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/); - - if (!parserInput.$char(']')) { - parserInput.restore(); - return; - } - - if (name || name === '') { - parserInput.forget(); - return name; - } - - parserInput.restore(); - } - }, - // - // Entities are the smallest recognized token, - // and can be found inside a rule's value. - // - entity: function () { - var entities = this.entities; - - return this.comment() || entities.literal() || entities.variable() || entities.url() || - entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) || - entities.javascript(); - }, - - // - // A Declaration terminator. Note that we use `peek()` to check for '}', - // because the `block` rule will be expecting it, but we still need to make sure - // it's there, if ';' was omitted. - // - end: function () { - return parserInput.$char(';') || parserInput.peek('}'); - }, - - // - // IE's alpha function - // - // alpha(opacity=88) - // - ieAlpha: function () { - var value; - - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (!parserInput.$re(/^opacity=/i)) { return; } - value = parserInput.$re(/^\d+/); - if (!value) { - value = expect(parsers.entities.variable, 'Could not parse alpha'); - value = '@{' + value.name.slice(1) + '}'; - } - expectChar(')'); - return new tree.Quoted('', 'alpha(opacity=' + value + ')'); - }, - - // - // A Selector Element - // - // div - // + h1 - // #socks - // input[type="text"] - // - // Elements are the building blocks for Selectors, - // they are made out of a `Combinator` (see combinator rule), - // and an element name, such as a tag a class, or `*`. - // - element: function () { - var e, c, v, index = parserInput.i; - - c = this.combinator(); - - e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || - parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || - parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || - this.entities.variableCurly(); - - if (!e) { - parserInput.save(); - if (parserInput.$char('(')) { - if ((v = this.selector(false)) && parserInput.$char(')')) { - e = new(tree.Paren)(v); - parserInput.forget(); - } else { - parserInput.restore('Missing closing \')\''); - } - } else { - parserInput.forget(); - } - } - - if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index, fileInfo); } - }, - - // - // Combinators combine elements together, in a Selector. - // - // Because our parser isn't white-space sensitive, special care - // has to be taken, when parsing the descendant combinator, ` `, - // as it's an empty space. We have to check the previous character - // in the input, to see if it's a ` ` character. More info on how - // we deal with this in *combinator.js*. - // - combinator: function () { - var c = parserInput.currentChar(); - - if (c === '/') { - parserInput.save(); - var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i); - if (slashedCombinator) { - parserInput.forget(); - return new(tree.Combinator)(slashedCombinator); - } - parserInput.restore(); - } - - if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') { - parserInput.i++; - if (c === '^' && parserInput.currentChar() === '^') { - c = '^^'; - parserInput.i++; - } - while (parserInput.isWhitespace()) { parserInput.i++; } - return new(tree.Combinator)(c); - } else if (parserInput.isWhitespace(-1)) { - return new(tree.Combinator)(' '); - } else { - return new(tree.Combinator)(null); - } - }, - // - // A CSS Selector - // with less extensions e.g. the ability to extend and guard - // - // .class > div + h1 - // li a:hover - // - // Selectors are made out of one or more Elements, see above. - // - selector: function (isLess) { - var index = parserInput.i, elements, extendList, c, e, allExtends, when, condition; - isLess = isLess !== false; - while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) { - if (when) { - condition = expect(this.conditions, 'expected condition'); - } else if (condition) { - error('CSS guard can only be used at the end of selector'); - } else if (extendList) { - if (allExtends) { - allExtends = allExtends.concat(extendList); - } else { - allExtends = extendList; - } - } else { - if (allExtends) { error('Extend can only be used at the end of selector'); } - c = parserInput.currentChar(); - if (elements) { - elements.push(e); - } else { - elements = [ e ]; - } - e = null; - } - if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { - break; - } - } - - if (elements) { return new(tree.Selector)(elements, allExtends, condition, index, fileInfo); } - if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); } - }, - selectors: function () { - var s, selectors; - while (true) { - s = this.selector(); - if (!s) { - break; - } - if (selectors) { - selectors.push(s); - } else { - selectors = [ s ]; - } - parserInput.commentStore.length = 0; - if (s.condition && selectors.length > 1) { - error("Guards are only currently allowed on a single selector."); - } - if (!parserInput.$char(',')) { break; } - if (s.condition) { - error("Guards are only currently allowed on a single selector."); - } - parserInput.commentStore.length = 0; - } - return selectors; - }, - attribute: function () { - if (!parserInput.$char('[')) { return; } - - var entities = this.entities, - key, val, op; - - if (!(key = entities.variableCurly())) { - key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/); - } - - op = parserInput.$re(/^[|~*$^]?=/); - if (op) { - val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly(); - } - - expectChar(']'); - - return new(tree.Attribute)(key, op, val); - }, - - // - // The `block` rule is used by `ruleset` and `mixin.definition`. - // It's a wrapper around the `primary` rule, with added `{}`. - // - block: function () { - var content; - if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) { - return content; - } - }, - - blockRuleset: function() { - var block = this.block(); - - if (block) { - block = new tree.Ruleset(null, block); - } - return block; - }, - - detachedRuleset: function() { - var argInfo, params, variadic; - - parserInput.save(); - if (parserInput.$re(/^[.#]\(/)) { - /** - * DR args currently only implemented for each() function, and not - * yet settable as `@dr: #(@arg) {}` - * This should be done when DRs are merged with mixins. - * See: https://github.com/less/less-meta/issues/16 - */ - argInfo = this.mixin.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - if (!parserInput.$char(')')) { - parserInput.restore(); - return; - } - } - var blockRuleset = this.blockRuleset(); - if (blockRuleset) { - parserInput.forget(); - if (params) { - return new tree.mixin.Definition(null, params, blockRuleset, null, variadic); - } - return new tree.DetachedRuleset(blockRuleset); - } - parserInput.restore(); - }, - - // - // div, .class, body > p {...} - // - ruleset: function () { - var selectors, rules, debugInfo; - - parserInput.save(); - - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(parserInput.i); - } - - selectors = this.selectors(); - - if (selectors && (rules = this.block())) { - parserInput.forget(); - var ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports); - if (context.dumpLineNumbers) { - ruleset.debugInfo = debugInfo; - } - return ruleset; - } else { - parserInput.restore(); - } - }, - declaration: function () { - var name, value, index = parserInput.i, hasDR, - c = parserInput.currentChar(), important, merge, isVariable; - - if (c === '.' || c === '#' || c === '&' || c === ':') { return; } - - parserInput.save(); - - name = this.variable() || this.ruleProperty(); - if (name) { - isVariable = typeof name === 'string'; - - if (isVariable) { - value = this.detachedRuleset(); - if (value) { - hasDR = true; - } - } - - parserInput.commentStore.length = 0; - if (!value) { - // a name returned by this.ruleProperty() is always an array of the form: - // [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"] - // where each item is a tree.Keyword or tree.Variable - merge = !isVariable && name.length > 1 && name.pop().value; - - // Custom property values get permissive parsing - if (name[0].value && name[0].value.slice(0, 2) === '--') { - value = this.permissiveValue(); - } - // Try to store values as anonymous - // If we need the value later we'll re-parse it in ruleset.parseValue - else { - value = this.anonymousValue(); - } - if (value) { - parserInput.forget(); - // anonymous values absorb the end ';' which is required for them to work - return new (tree.Declaration)(name, value, false, merge, index, fileInfo); - } - - if (!value) { - value = this.value(); - } - - if (value) { - important = this.important(); - } else if (isVariable) { - // As a last resort, try permissiveValue - value = this.permissiveValue(); - } - } - - if (value && (this.end() || hasDR)) { - parserInput.forget(); - return new (tree.Declaration)(name, value, important, merge, index, fileInfo); - } - else { - parserInput.restore(); - } - } else { - parserInput.restore(); - } - }, - anonymousValue: function () { - var index = parserInput.i; - var match = parserInput.$re(/^([^.#@\$+\/'"*`(;{}-]*);/); - if (match) { - return new(tree.Anonymous)(match[1], index); - } - }, - /** - * Used for custom properties, at-rules, and variables (as fallback) - * Parses almost anything inside of {} [] () "" blocks - * until it reaches outer-most tokens. - * - * First, it will try to parse comments and entities to reach - * the end. This is mostly like the Expression parser except no - * math is allowed. - */ - permissiveValue: function (untilTokens) { - var i, e, done, value, - tok = untilTokens || ';', - index = parserInput.i, result = []; - - function testCurrentChar() { - var char = parserInput.currentChar(); - if (typeof tok === 'string') { - return char === tok; - } else { - return tok.test(char); - } - } - if (testCurrentChar()) { - return; - } - value = []; - do { - e = this.comment(); - if (e) { - value.push(e); - continue; - } - e = this.entity(); - if (e) { - value.push(e); - } - } while (e); - - done = testCurrentChar(); - - if (value.length > 0) { - value = new(tree.Expression)(value); - if (done) { - return value; - } - else { - result.push(value); - } - // Preserve space before $parseUntil as it will not - if (parserInput.prevChar() === ' ') { - result.push(new tree.Anonymous(' ', index)); - } - } - parserInput.save(); - - value = parserInput.$parseUntil(tok); - - if (value) { - if (typeof value === 'string') { - error('Expected \'' + value + '\'', 'Parse'); - } - if (value.length === 1 && value[0] === ' ') { - parserInput.forget(); - return new tree.Anonymous('', index); - } - var item; - for (i = 0; i < value.length; i++) { - item = value[i]; - if (Array.isArray(item)) { - // Treat actual quotes as normal quoted values - result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo)); - } - else { - if (i === value.length - 1) { - item = item.trim(); - } - // Treat like quoted values, but replace vars like unquoted expressions - var quote = new tree.Quoted('\'', item, true, index, fileInfo); - quote.variableRegex = /@([\w-]+)/g; - quote.propRegex = /\$([\w-]+)/g; - result.push(quote); - } - } - parserInput.forget(); - return new tree.Expression(result, true); - } - parserInput.restore(); - }, - - // - // An @import atrule - // - // @import "lib"; - // - // Depending on our environment, importing is done differently: - // In the browser, it's an XHR request, in Node, it would be a - // file-system operation. The function used for importing is - // stored in `import`, which we pass to the Import constructor. - // - 'import': function () { - var path, features, index = parserInput.i; - - var dir = parserInput.$re(/^@import?\s+/); - - if (dir) { - var options = (dir ? this.importOptions() : null) || {}; - - if ((path = this.entities.quoted() || this.entities.url())) { - features = this.mediaFeatures(); - - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon or unrecognised media features on import'); - } - features = features && new(tree.Value)(features); - return new(tree.Import)(path, features, options, index, fileInfo); - } - else { - parserInput.i = index; - error('malformed import statement'); - } - } - }, - - importOptions: function() { - var o, options = {}, optionName, value; - - // list of options, surrounded by parens - if (!parserInput.$char('(')) { return null; } - do { - o = this.importOption(); - if (o) { - optionName = o; - value = true; - switch (optionName) { - case 'css': - optionName = 'less'; - value = false; - break; - case 'once': - optionName = 'multiple'; - value = false; - break; - } - options[optionName] = value; - if (!parserInput.$char(',')) { break; } - } - } while (o); - expectChar(')'); - return options; - }, - - importOption: function() { - var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); - if (opt) { - return opt[1]; - } - }, - - mediaFeature: function () { - var entities = this.entities, nodes = [], e, p; - parserInput.save(); - do { - e = entities.keyword() || entities.variable() || entities.mixinLookup(); - if (e) { - nodes.push(e); - } else if (parserInput.$char('(')) { - p = this.property(); - e = this.value(); - if (parserInput.$char(')')) { - if (p && e) { - nodes.push(new(tree.Paren)(new(tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true))); - } else if (e) { - nodes.push(new(tree.Paren)(e)); - } else { - error('badly formed media feature definition'); - } - } else { - error('Missing closing \')\'', 'Parse'); - } - } - } while (e); - - parserInput.forget(); - if (nodes.length > 0) { - return new(tree.Expression)(nodes); - } - }, - - mediaFeatures: function () { - var entities = this.entities, features = [], e; - do { - e = this.mediaFeature(); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { break; } - } else { - e = entities.variable() || entities.mixinLookup(); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { break; } - } - } - } while (e); - - return features.length > 0 ? features : null; - }, - - media: function () { - var features, rules, media, debugInfo, index = parserInput.i; - - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(index); - } - - parserInput.save(); - - if (parserInput.$str('@media')) { - features = this.mediaFeatures(); - - rules = this.block(); - - if (!rules) { - error('media definitions require block statements after any features'); - } - - parserInput.forget(); - - media = new(tree.Media)(rules, features, index, fileInfo); - if (context.dumpLineNumbers) { - media.debugInfo = debugInfo; - } - - return media; - } - - parserInput.restore(); - }, - - // - - // A @plugin directive, used to import plugins dynamically. - // - // @plugin (args) "lib"; - // - plugin: function () { - var path, args, options, - index = parserInput.i, - dir = parserInput.$re(/^@plugin?\s+/); - - if (dir) { - args = this.pluginArgs(); - - if (args) { - options = { - pluginArgs: args, - isPlugin: true - }; - } - else { - options = { isPlugin: true }; - } - - if ((path = this.entities.quoted() || this.entities.url())) { - - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon on @plugin'); - } - return new(tree.Import)(path, null, options, index, fileInfo); - } - else { - parserInput.i = index; - error('malformed @plugin statement'); - } - } - }, - - pluginArgs: function() { - // list of options, surrounded by parens - parserInput.save(); - if (!parserInput.$char('(')) { - parserInput.restore(); - return null; - } - var args = parserInput.$re(/^\s*([^\);]+)\)\s*/); - if (args[1]) { - parserInput.forget(); - return args[1].trim(); - } - else { - parserInput.restore(); - return null; - } - }, - - // - // A CSS AtRule - // - // @charset "utf-8"; - // - atrule: function () { - var index = parserInput.i, name, value, rules, nonVendorSpecificName, - hasIdentifier, hasExpression, hasUnknown, hasBlock = true, isRooted = true; - - if (parserInput.currentChar() !== '@') { return; } - - value = this['import']() || this.plugin() || this.media(); - if (value) { - return value; - } - - parserInput.save(); - - name = parserInput.$re(/^@[a-z-]+/); - - if (!name) { return; } - - nonVendorSpecificName = name; - if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) { - nonVendorSpecificName = '@' + name.slice(name.indexOf('-', 2) + 1); - } - - switch (nonVendorSpecificName) { - case '@charset': - hasIdentifier = true; - hasBlock = false; - break; - case '@namespace': - hasExpression = true; - hasBlock = false; - break; - case '@keyframes': - case '@counter-style': - hasIdentifier = true; - break; - case '@document': - case '@supports': - hasUnknown = true; - isRooted = false; - break; - default: - hasUnknown = true; - break; - } - - parserInput.commentStore.length = 0; - - if (hasIdentifier) { - value = this.entity(); - if (!value) { - error('expected ' + name + ' identifier'); - } - } else if (hasExpression) { - value = this.expression(); - if (!value) { - error('expected ' + name + ' expression'); - } - } else if (hasUnknown) { - value = this.permissiveValue(/^[{;]/); - hasBlock = (parserInput.currentChar() === '{'); - if (!value) { - if (!hasBlock && parserInput.currentChar() !== ';') { - error(name + ' rule is missing block or ending semi-colon'); - } - } - else if (!value.value) { - value = null; - } - } - - if (hasBlock) { - rules = this.blockRuleset(); - } - - if (rules || (!hasBlock && value && parserInput.$char(';'))) { - parserInput.forget(); - return new (tree.AtRule)(name, value, rules, index, fileInfo, - context.dumpLineNumbers ? getDebugInfo(index) : null, - isRooted - ); - } - - parserInput.restore('at-rule options not recognised'); - }, - - // - // A Value is a comma-delimited list of Expressions - // - // font-family: Baskerville, Georgia, serif; - // - // In a Rule, a Value represents everything after the `:`, - // and before the `;`. - // - value: function () { - var e, expressions = [], index = parserInput.i; - - do { - e = this.expression(); - if (e) { - expressions.push(e); - if (!parserInput.$char(',')) { break; } - } - } while (e); - - if (expressions.length > 0) { - return new(tree.Value)(expressions, index); - } - }, - important: function () { - if (parserInput.currentChar() === '!') { - return parserInput.$re(/^! *important/); - } - }, - sub: function () { - var a, e; - - parserInput.save(); - if (parserInput.$char('(')) { - a = this.addition(); - if (a && parserInput.$char(')')) { - parserInput.forget(); - e = new(tree.Expression)([a]); - e.parens = true; - return e; - } - parserInput.restore('Expected \')\''); - return; - } - parserInput.restore(); - }, - multiplication: function () { - var m, a, op, operation, isSpaced; - m = this.operand(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - if (parserInput.peek(/^\/[*\/]/)) { - break; - } - - parserInput.save(); - - op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./'); - - if (!op) { parserInput.forget(); break; } - - a = this.operand(); - - if (!a) { parserInput.restore(); break; } - parserInput.forget(); - - m.parensInOp = true; - a.parensInOp = true; - operation = new(tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - addition: function () { - var m, a, op, operation, isSpaced; - m = this.multiplication(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - op = parserInput.$re(/^[-+]\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-'))); - if (!op) { - break; - } - a = this.multiplication(); - if (!a) { - break; - } - - m.parensInOp = true; - a.parensInOp = true; - operation = new(tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - conditions: function () { - var a, b, index = parserInput.i, condition; - - a = this.condition(true); - if (a) { - while (true) { - if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) { - break; - } - b = this.condition(true); - if (!b) { - break; - } - condition = new(tree.Condition)('or', condition || a, b, index); - } - return condition || a; - } - }, - condition: function (needsParens) { - var result, logical, next; - function or() { - return parserInput.$str('or'); - } - - result = this.conditionAnd(needsParens); - if (!result) { - return ; - } - logical = or(); - if (logical) { - next = this.condition(needsParens); - if (next) { - result = new(tree.Condition)(logical, result, next); - } else { - return ; - } - } - return result; - }, - conditionAnd: function (needsParens) { - var result, logical, next, self = this; - function insideCondition() { - var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens); - if (!cond && !needsParens) { - return self.atomicCondition(needsParens); - } - return cond; - } - function and() { - return parserInput.$str('and'); - } - - result = insideCondition(); - if (!result) { - return ; - } - logical = and(); - if (logical) { - next = this.conditionAnd(needsParens); - if (next) { - result = new(tree.Condition)(logical, result, next); - } else { - return ; - } - } - return result; - }, - negatedCondition: function (needsParens) { - if (parserInput.$str('not')) { - var result = this.parenthesisCondition(needsParens); - if (result) { - result.negate = !result.negate; - } - return result; - } - }, - parenthesisCondition: function (needsParens) { - function tryConditionFollowedByParenthesis(me) { - var body; - parserInput.save(); - body = me.condition(needsParens); - if (!body) { - parserInput.restore(); - return ; - } - if (!parserInput.$char(')')) { - parserInput.restore(); - return ; - } - parserInput.forget(); - return body; - } - - var body; - parserInput.save(); - if (!parserInput.$str('(')) { - parserInput.restore(); - return ; - } - body = tryConditionFollowedByParenthesis(this); - if (body) { - parserInput.forget(); - return body; - } - - body = this.atomicCondition(needsParens); - if (!body) { - parserInput.restore(); - return ; - } - if (!parserInput.$char(')')) { - parserInput.restore('expected \')\' got \'' + parserInput.currentChar() + '\''); - return ; - } - parserInput.forget(); - return body; - }, - atomicCondition: function (needsParens) { - var entities = this.entities, index = parserInput.i, a, b, c, op; - - function cond() { - return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); - } - cond = cond.bind(this); - - a = cond(); - if (a) { - if (parserInput.$char('>')) { - if (parserInput.$char('=')) { - op = '>='; - } else { - op = '>'; - } - } else - if (parserInput.$char('<')) { - if (parserInput.$char('=')) { - op = '<='; - } else { - op = '<'; - } - } else - if (parserInput.$char('=')) { - if (parserInput.$char('>')) { - op = '=>'; - } else if (parserInput.$char('<')) { - op = '=<'; - } else { - op = '='; - } - } - if (op) { - b = cond(); - if (b) { - c = new(tree.Condition)(op, a, b, index, false); - } else { - error('expected expression'); - } - } else { - c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, false); - } - return c; - } - }, - - // - // An operand is anything that can be part of an operation, - // such as a Color, or a Variable - // - operand: function () { - var entities = this.entities, negate; - - if (parserInput.peek(/^-[@\$\(]/)) { - negate = parserInput.$char('-'); - } - - var o = this.sub() || entities.dimension() || - entities.color() || entities.variable() || - entities.property() || entities.call() || - entities.quoted(true) || entities.colorKeyword() || - entities.mixinLookup(); - - if (negate) { - o.parensInOp = true; - o = new(tree.Negative)(o); - } - - return o; - }, - - // - // Expressions either represent mathematical operations, - // or white-space delimited Entities. - // - // 1px solid black - // @var * 2 - // - expression: function () { - var entities = [], e, delim, index = parserInput.i; - - do { - e = this.comment(); - if (e) { - entities.push(e); - continue; - } - e = this.addition() || this.entity(); - if (e) { - entities.push(e); - // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here - if (!parserInput.peek(/^\/[\/*]/)) { - delim = parserInput.$char('/'); - if (delim) { - entities.push(new(tree.Anonymous)(delim, index)); - } - } - } - } while (e); - if (entities.length > 0) { - return new(tree.Expression)(entities); - } - }, - property: function () { - var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); - if (name) { - return name[1]; - } - }, - ruleProperty: function () { - var name = [], index = [], s, k; - - parserInput.save(); - - var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/); - if (simpleProperty) { - name = [new(tree.Keyword)(simpleProperty[1])]; - parserInput.forget(); - return name; - } - - function match(re) { - var i = parserInput.i, - chunk = parserInput.$re(re); - if (chunk) { - index.push(i); - return name.push(chunk[1]); - } - } - - match(/^(\*?)/); - while (true) { - if (!match(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/)) { - break; - } - } - - if ((name.length > 1) && match(/^((?:\+_|\+)?)\s*:/)) { - parserInput.forget(); - - // at last, we have the complete match now. move forward, - // convert name particles to tree objects and return: - if (name[0] === '') { - name.shift(); - index.shift(); - } - for (k = 0; k < name.length; k++) { - s = name[k]; - name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? - new(tree.Keyword)(s) : - (s.charAt(0) === '@' ? - new(tree.Variable)('@' + s.slice(2, -1), index[k], fileInfo) : - new(tree.Property)('$' + s.slice(2, -1), index[k], fileInfo)); - } - return name; - } - parserInput.restore(); - } - } - }; -}; -Parser.serializeVars = function(vars) { - var s = ''; - - for (var name in vars) { - if (Object.hasOwnProperty.call(vars, name)) { - var value = vars[name]; - s += ((name[0] === '@') ? '' : '@') + name + ': ' + value + - ((String(value).slice(-1) === ';') ? '' : ';'); - } - } - - return s; -}; - -module.exports = Parser; - -},{"../functions/function-registry":26,"../less-error":37,"../tree":67,"../utils":89,"../visitors":93,"./parser-input":43}],45:[function(require,module,exports){ -/** - * Plugin Manager - */ -var PluginManager = function(less) { - this.less = less; - this.visitors = []; - this.preProcessors = []; - this.postProcessors = []; - this.installedPlugins = []; - this.fileManagers = []; - this.iterator = -1; - this.pluginCache = {}; - this.Loader = new less.PluginLoader(less); -}; - -var pm, PluginManagerFactory = function(less, newFactory) { - if (newFactory || !pm) { - pm = new PluginManager(less); - } - return pm; - }; - -/** - * Adds all the plugins in the array - * @param {Array} plugins - */ -PluginManager.prototype.addPlugins = function(plugins) { - if (plugins) { - for (var i = 0; i < plugins.length; i++) { - this.addPlugin(plugins[i]); - } - } -}; -/** - * - * @param plugin - * @param {String} filename - */ -PluginManager.prototype.addPlugin = function(plugin, filename, functionRegistry) { - this.installedPlugins.push(plugin); - if (filename) { - this.pluginCache[filename] = plugin; - } - if (plugin.install) { - plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry); - } -}; -/** - * - * @param filename - */ -PluginManager.prototype.get = function(filename) { - return this.pluginCache[filename]; -}; - -/** - * Adds a visitor. The visitor object has options on itself to determine - * when it should run. - * @param visitor - */ -PluginManager.prototype.addVisitor = function(visitor) { - this.visitors.push(visitor); -}; -/** - * Adds a pre processor object - * @param {object} preProcessor - * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import - */ -PluginManager.prototype.addPreProcessor = function(preProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) { - if (this.preProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.preProcessors.splice(indexToInsertAt, 0, {preProcessor: preProcessor, priority: priority}); -}; -/** - * Adds a post processor object - * @param {object} postProcessor - * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression - */ -PluginManager.prototype.addPostProcessor = function(postProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) { - if (this.postProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.postProcessors.splice(indexToInsertAt, 0, {postProcessor: postProcessor, priority: priority}); -}; -/** - * - * @param manager - */ -PluginManager.prototype.addFileManager = function(manager) { - this.fileManagers.push(manager); -}; -/** - * - * @returns {Array} - * @private - */ -PluginManager.prototype.getPreProcessors = function() { - var preProcessors = []; - for (var i = 0; i < this.preProcessors.length; i++) { - preProcessors.push(this.preProcessors[i].preProcessor); - } - return preProcessors; -}; -/** - * - * @returns {Array} - * @private - */ -PluginManager.prototype.getPostProcessors = function() { - var postProcessors = []; - for (var i = 0; i < this.postProcessors.length; i++) { - postProcessors.push(this.postProcessors[i].postProcessor); - } - return postProcessors; -}; -/** - * - * @returns {Array} - * @private - */ -PluginManager.prototype.getVisitors = function() { - return this.visitors; -}; - -PluginManager.prototype.visitor = function() { - var self = this; - return { - first: function() { - self.iterator = -1; - return self.visitors[self.iterator]; - }, - get: function() { - self.iterator += 1; - return self.visitors[self.iterator]; - } - }; -}; -/** - * - * @returns {Array} - * @private - */ -PluginManager.prototype.getFileManagers = function() { - return this.fileManagers; -}; - -// -module.exports = PluginManagerFactory; - -},{}],46:[function(require,module,exports){ -var PromiseConstructor, - utils = require('./utils'); - -module.exports = function(environment, ParseTree, ImportManager) { - var render = function (input, options, callback) { - if (typeof options === 'function') { - callback = options; - options = utils.copyOptions(this.options, {}); - } - else { - options = utils.copyOptions(this.options, options || {}); - } - - if (!callback) { - if (!PromiseConstructor) { - PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise; - } - var self = this; - return new PromiseConstructor(function (resolve, reject) { - render.call(self, input, options, function(err, output) { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } else { - this.parse(input, options, function(err, root, imports, options) { - if (err) { return callback(err); } - - var result; - try { - var parseTree = new ParseTree(root, imports); - result = parseTree.toCSS(options); - } - catch (err) { return callback(err); } - - callback(null, result); - }); - } - }; - - return render; -}; - -},{"./utils":89,"promise":undefined}],47:[function(require,module,exports){ -module.exports = function (SourceMapOutput, environment) { - - var SourceMapBuilder = function (options) { - this.options = options; - }; - - SourceMapBuilder.prototype.toCSS = function(rootNode, options, imports) { - var sourceMapOutput = new SourceMapOutput( - { - contentsIgnoredCharsMap: imports.contentsIgnoredChars, - rootNode: rootNode, - contentsMap: imports.contents, - sourceMapFilename: this.options.sourceMapFilename, - sourceMapURL: this.options.sourceMapURL, - outputFilename: this.options.sourceMapOutputFilename, - sourceMapBasepath: this.options.sourceMapBasepath, - sourceMapRootpath: this.options.sourceMapRootpath, - outputSourceFiles: this.options.outputSourceFiles, - sourceMapGenerator: this.options.sourceMapGenerator, - sourceMapFileInline: this.options.sourceMapFileInline - }); - - var css = sourceMapOutput.toCSS(options); - this.sourceMap = sourceMapOutput.sourceMap; - this.sourceMapURL = sourceMapOutput.sourceMapURL; - if (this.options.sourceMapInputFilename) { - this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename); - } - if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) { - this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL); - } - return css + this.getCSSAppendage(); - }; - - SourceMapBuilder.prototype.getCSSAppendage = function() { - - var sourceMapURL = this.sourceMapURL; - if (this.options.sourceMapFileInline) { - if (this.sourceMap === undefined) { - return ''; - } - sourceMapURL = 'data:application/json;base64,' + environment.encodeBase64(this.sourceMap); - } - - if (sourceMapURL) { - return '/*# sourceMappingURL=' + sourceMapURL + ' */'; - } - return ''; - }; - - SourceMapBuilder.prototype.getExternalSourceMap = function() { - return this.sourceMap; - }; - SourceMapBuilder.prototype.setExternalSourceMap = function(sourceMap) { - this.sourceMap = sourceMap; - }; - - SourceMapBuilder.prototype.isInline = function() { - return this.options.sourceMapFileInline; - }; - SourceMapBuilder.prototype.getSourceMapURL = function() { - return this.sourceMapURL; - }; - SourceMapBuilder.prototype.getOutputFilename = function() { - return this.options.sourceMapOutputFilename; - }; - SourceMapBuilder.prototype.getInputFilename = function() { - return this.sourceMapInputFilename; - }; - - return SourceMapBuilder; -}; - -},{}],48:[function(require,module,exports){ -module.exports = function (environment) { - - var SourceMapOutput = function (options) { - this._css = []; - this._rootNode = options.rootNode; - this._contentsMap = options.contentsMap; - this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap; - if (options.sourceMapFilename) { - this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/'); - } - this._outputFilename = options.outputFilename; - this.sourceMapURL = options.sourceMapURL; - if (options.sourceMapBasepath) { - this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/'); - } - if (options.sourceMapRootpath) { - this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/'); - if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') { - this._sourceMapRootpath += '/'; - } - } else { - this._sourceMapRootpath = ''; - } - this._outputSourceFiles = options.outputSourceFiles; - this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator(); - - this._lineNumber = 0; - this._column = 0; - }; - - SourceMapOutput.prototype.removeBasepath = function(path) { - if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) { - path = path.substring(this._sourceMapBasepath.length); - if (path.charAt(0) === '\\' || path.charAt(0) === '/') { - path = path.substring(1); - } - } - - return path; - }; - - SourceMapOutput.prototype.normalizeFilename = function(filename) { - filename = filename.replace(/\\/g, '/'); - filename = this.removeBasepath(filename); - return (this._sourceMapRootpath || '') + filename; - }; - - SourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) { - - // ignore adding empty strings - if (!chunk) { - return; - } - - var lines, - sourceLines, - columns, - sourceColumns, - i; - - if (fileInfo) { - var inputSource = this._contentsMap[fileInfo.filename]; - - // remove vars/banner added to the top of the file - if (this._contentsIgnoredCharsMap[fileInfo.filename]) { - // adjust the index - index -= this._contentsIgnoredCharsMap[fileInfo.filename]; - if (index < 0) { index = 0; } - // adjust the source - inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]); - } - inputSource = inputSource.substring(0, index); - sourceLines = inputSource.split('\n'); - sourceColumns = sourceLines[sourceLines.length - 1]; - } - - lines = chunk.split('\n'); - columns = lines[lines.length - 1]; - - if (fileInfo) { - if (!mapLines) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column}, - original: { line: sourceLines.length, column: sourceColumns.length}, - source: this.normalizeFilename(fileInfo.filename)}); - } else { - for (i = 0; i < lines.length; i++) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0}, - original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0}, - source: this.normalizeFilename(fileInfo.filename)}); - } - } - } - - if (lines.length === 1) { - this._column += columns.length; - } else { - this._lineNumber += lines.length - 1; - this._column = columns.length; - } - - this._css.push(chunk); - }; - - SourceMapOutput.prototype.isEmpty = function() { - return this._css.length === 0; - }; - - SourceMapOutput.prototype.toCSS = function(context) { - this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null }); - - if (this._outputSourceFiles) { - for (var filename in this._contentsMap) { - if (this._contentsMap.hasOwnProperty(filename)) { - var source = this._contentsMap[filename]; - if (this._contentsIgnoredCharsMap[filename]) { - source = source.slice(this._contentsIgnoredCharsMap[filename]); - } - this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source); - } - } - } - - this._rootNode.genCSS(context, this); - - if (this._css.length > 0) { - var sourceMapURL, - sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON()); - - if (this.sourceMapURL) { - sourceMapURL = this.sourceMapURL; - } else if (this._sourceMapFilename) { - sourceMapURL = this._sourceMapFilename; - } - this.sourceMapURL = sourceMapURL; - - this.sourceMap = sourceMapContent; - } - - return this._css.join(''); - }; - - return SourceMapOutput; -}; - -},{}],49:[function(require,module,exports){ -var contexts = require('./contexts'), - visitor = require('./visitors'), - tree = require('./tree'); - -module.exports = function(root, options) { - options = options || {}; - var evaldRoot, - variables = options.variables, - evalEnv = new contexts.Eval(options); - - // - // Allows setting variables with a hash, so: - // - // `{ color: new tree.Color('#f01') }` will become: - // - // new tree.Declaration('@color', - // new tree.Value([ - // new tree.Expression([ - // new tree.Color('#f01') - // ]) - // ]) - // ) - // - if (typeof variables === 'object' && !Array.isArray(variables)) { - variables = Object.keys(variables).map(function (k) { - var value = variables[k]; - - if (!(value instanceof tree.Value)) { - if (!(value instanceof tree.Expression)) { - value = new tree.Expression([value]); - } - value = new tree.Value([value]); - } - return new tree.Declaration('@' + k, value, false, null, 0); - }); - evalEnv.frames = [new tree.Ruleset(null, variables)]; - } - - var visitors = [ - new visitor.JoinSelectorVisitor(), - new visitor.MarkVisibleSelectorsVisitor(true), - new visitor.ExtendVisitor(), - new visitor.ToCSSVisitor({compress: Boolean(options.compress)}) - ], preEvalVisitors = [], v, visitorIterator; - - /** - * first() / get() allows visitors to be added while visiting - * - * @todo Add scoping for visitors just like functions for @plugin; right now they're global - */ - if (options.pluginManager) { - visitorIterator = options.pluginManager.visitor(); - for (var i = 0; i < 2; i++) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (v.isPreEvalVisitor) { - if (i === 0 || preEvalVisitors.indexOf(v) === -1) { - preEvalVisitors.push(v); - v.run(root); - } - } - else { - if (i === 0 || visitors.indexOf(v) === -1) { - if (v.isPreVisitor) { - visitors.unshift(v); - } - else { - visitors.push(v); - } - } - } - } - } - } - - evaldRoot = root.eval(evalEnv); - - for (var i = 0; i < visitors.length; i++) { - visitors[i].run(evaldRoot); - } - - // Run any remaining visitors added after eval pass - if (options.pluginManager) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) { - v.run(evaldRoot); - } - } - } - - return evaldRoot; -}; - -},{"./contexts":12,"./tree":67,"./visitors":93}],50:[function(require,module,exports){ -var Node = require('./node'); - -var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { - this.value = value; - this._index = index; - this._fileInfo = currentFileInfo; - this.mapLines = mapLines; - this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; - this.allowRoot = true; - this.copyVisibilityInfo(visibilityInfo); -}; -Anonymous.prototype = new Node(); -Anonymous.prototype.type = 'Anonymous'; -Anonymous.prototype.eval = function () { - return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); -}; -Anonymous.prototype.compare = function (other) { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; -}; -Anonymous.prototype.isRulesetLike = function() { - return this.rulesetLike; -}; -Anonymous.prototype.genCSS = function (context, output) { - this.nodeVisible = Boolean(this.value); - if (this.nodeVisible) { - output.add(this.value, this._fileInfo, this._index, this.mapLines); - } -}; -module.exports = Anonymous; - -},{"./node":76}],51:[function(require,module,exports){ -var Node = require('./node'); - -var Assignment = function (key, val) { - this.key = key; - this.value = val; -}; - -Assignment.prototype = new Node(); -Assignment.prototype.type = 'Assignment'; -Assignment.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); -}; -Assignment.prototype.eval = function (context) { - if (this.value.eval) { - return new Assignment(this.key, this.value.eval(context)); - } - return this; -}; -Assignment.prototype.genCSS = function (context, output) { - output.add(this.key + '='); - if (this.value.genCSS) { - this.value.genCSS(context, output); - } else { - output.add(this.value); - } -}; -module.exports = Assignment; - -},{"./node":76}],52:[function(require,module,exports){ -var Node = require('./node'), - Selector = require('./selector'), - Ruleset = require('./ruleset'), - Anonymous = require('./anonymous'); - -var AtRule = function (name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) { - var i; - - this.name = name; - this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); - if (rules) { - if (Array.isArray(rules)) { - this.rules = rules; - } else { - this.rules = [rules]; - this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); - } - for (i = 0; i < this.rules.length; i++) { - this.rules[i].allowImports = true; - } - this.setParent(this.rules, this); - } - this._index = index; - this._fileInfo = currentFileInfo; - this.debugInfo = debugInfo; - this.isRooted = isRooted || false; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; -}; - -AtRule.prototype = new Node(); -AtRule.prototype.type = 'AtRule'; -AtRule.prototype.accept = function (visitor) { - var value = this.value, rules = this.rules; - if (rules) { - this.rules = visitor.visitArray(rules); - } - if (value) { - this.value = visitor.visit(value); - } -}; -AtRule.prototype.isRulesetLike = function() { - return this.rules || !this.isCharset(); -}; -AtRule.prototype.isCharset = function() { - return '@charset' === this.name; -}; -AtRule.prototype.genCSS = function (context, output) { - var value = this.value, rules = this.rules; - output.add(this.name, this.fileInfo(), this.getIndex()); - if (value) { - output.add(' '); - value.genCSS(context, output); - } - if (rules) { - this.outputRuleset(context, output, rules); - } else { - output.add(';'); - } -}; -AtRule.prototype.eval = function (context) { - var mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules; - - // media stored inside other atrule should not bubble over it - // backpup media bubbling information - mediaPathBackup = context.mediaPath; - mediaBlocksBackup = context.mediaBlocks; - // deleted media bubbling information - context.mediaPath = []; - context.mediaBlocks = []; - - if (value) { - value = value.eval(context); - } - if (rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - rules = [rules[0].eval(context)]; - rules[0].root = true; - } - // restore media bubbling information - context.mediaPath = mediaPathBackup; - context.mediaBlocks = mediaBlocksBackup; - - return new AtRule(this.name, value, rules, - this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); -}; -AtRule.prototype.variable = function (name) { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.variable.call(this.rules[0], name); - } -}; -AtRule.prototype.find = function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.find.apply(this.rules[0], arguments); - } -}; -AtRule.prototype.rulesets = function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.rulesets.apply(this.rules[0]); - } -}; -AtRule.prototype.outputRuleset = function (context, output, rules) { - var ruleCnt = rules.length, i; - context.tabLevel = (context.tabLevel | 0) + 1; - - // Compressed - if (context.compress) { - output.add('{'); - for (i = 0; i < ruleCnt; i++) { - rules[i].genCSS(context, output); - } - output.add('}'); - context.tabLevel--; - return; - } - - // Non-compressed - var tabSetStr = '\n' + Array(context.tabLevel).join(' '), tabRuleStr = tabSetStr + ' '; - if (!ruleCnt) { - output.add(' {' + tabSetStr + '}'); - } else { - output.add(' {' + tabRuleStr); - rules[0].genCSS(context, output); - for (i = 1; i < ruleCnt; i++) { - output.add(tabRuleStr); - rules[i].genCSS(context, output); - } - output.add(tabSetStr + '}'); - } - - context.tabLevel--; -}; -module.exports = AtRule; - -},{"./anonymous":50,"./node":76,"./ruleset":81,"./selector":82}],53:[function(require,module,exports){ -var Node = require('./node'); - -var Attribute = function (key, op, value) { - this.key = key; - this.op = op; - this.value = value; -}; -Attribute.prototype = new Node(); -Attribute.prototype.type = 'Attribute'; -Attribute.prototype.eval = function (context) { - return new Attribute(this.key.eval ? this.key.eval(context) : this.key, - this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value); -}; -Attribute.prototype.genCSS = function (context, output) { - output.add(this.toCSS(context)); -}; -Attribute.prototype.toCSS = function (context) { - var value = this.key.toCSS ? this.key.toCSS(context) : this.key; - - if (this.op) { - value += this.op; - value += (this.value.toCSS ? this.value.toCSS(context) : this.value); - } - - return '[' + value + ']'; -}; -module.exports = Attribute; - -},{"./node":76}],54:[function(require,module,exports){ -var Node = require('./node'), - Anonymous = require('./anonymous'), - FunctionCaller = require('../functions/function-caller'); -// -// A function call node. -// -var Call = function (name, args, index, currentFileInfo) { - this.name = name; - this.args = args; - this.calc = name === 'calc'; - this._index = index; - this._fileInfo = currentFileInfo; -}; -Call.prototype = new Node(); -Call.prototype.type = 'Call'; -Call.prototype.accept = function (visitor) { - if (this.args) { - this.args = visitor.visitArray(this.args); - } -}; -// -// When evaluating a function call, -// we either find the function in the functionRegistry, -// in which case we call it, passing the evaluated arguments, -// if this returns null or we cannot find the function, we -// simply print it out as it appeared originally [2]. -// -// The reason why we evaluate the arguments, is in the case where -// we try to pass a variable to a function, like: `saturate(@color)`. -// The function should receive the value, not the variable. -// -Call.prototype.eval = function (context) { - /** - * Turn off math for calc(), and switch back on for evaluating nested functions - */ - var currentMathContext = context.mathOn; - context.mathOn = !this.calc; - if (this.calc || context.inCalc) { - context.enterCalc(); - } - var args = this.args.map(function (a) { return a.eval(context); }); - if (this.calc || context.inCalc) { - context.exitCalc(); - } - context.mathOn = currentMathContext; - - var result, funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo()); - - if (funcCaller.isValid()) { - try { - result = funcCaller.call(args); - } catch (e) { - throw { - type: e.type || 'Runtime', - message: 'error evaluating function `' + this.name + '`' + - (e.message ? ': ' + e.message : ''), - index: this.getIndex(), - filename: this.fileInfo().filename, - line: e.lineNumber, - column: e.columnNumber - }; - } - - if (result !== null && result !== undefined) { - // Results that that are not nodes are cast as Anonymous nodes - // Falsy values or booleans are returned as empty nodes - if (!(result instanceof Node)) { - if (!result || result === true) { - result = new Anonymous(null); - } - else { - result = new Anonymous(result.toString()); - } - - } - result._index = this._index; - result._fileInfo = this._fileInfo; - return result; - } - - } - - return new Call(this.name, args, this.getIndex(), this.fileInfo()); -}; -Call.prototype.genCSS = function (context, output) { - output.add(this.name + '(', this.fileInfo(), this.getIndex()); - - for (var i = 0; i < this.args.length; i++) { - this.args[i].genCSS(context, output); - if (i + 1 < this.args.length) { - output.add(', '); - } - } - - output.add(')'); -}; -module.exports = Call; - -},{"../functions/function-caller":25,"./anonymous":50,"./node":76}],55:[function(require,module,exports){ -var Node = require('./node'), - colors = require('../data/colors'); - -// -// RGB Colors - #ff0014, #eee -// -var Color = function (rgb, a, originalForm) { - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } else if (rgb.length == 6) { - this.rgb = rgb.match(/.{2}/g).map(function (c) { - return parseInt(c, 16); - }); - } else { - this.rgb = rgb.split('').map(function (c) { - return parseInt(c + c, 16); - }); - } - this.alpha = typeof a === 'number' ? a : 1; - if (typeof originalForm !== 'undefined') { - this.value = originalForm; - } -}; - -Color.prototype = new Node(); -Color.prototype.type = 'Color'; - -function clamp(v, max) { - return Math.min(Math.max(v, 0), max); -} - -function toHex(v) { - return '#' + v.map(function (c) { - c = clamp(Math.round(c), 255); - return (c < 16 ? '0' : '') + c.toString(16); - }).join(''); -} - -Color.prototype.luma = function () { - var r = this.rgb[0] / 255, - g = this.rgb[1] / 255, - b = this.rgb[2] / 255; - - r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4); - g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4); - b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4); - - return 0.2126 * r + 0.7152 * g + 0.0722 * b; -}; -Color.prototype.genCSS = function (context, output) { - output.add(this.toCSS(context)); -}; -Color.prototype.toCSS = function (context, doNotCompress) { - var compress = context && context.compress && !doNotCompress, color, alpha; - - // `value` is set if this color was originally - // converted from a named color string so we need - // to respect this and try to output named color too. - if (this.value) { - return this.value; - } - - // If we have some transparency, the only way to represent it - // is via `rgba`. Otherwise, we use the hex representation, - // which has better compatibility with older browsers. - // Values are capped between `0` and `255`, rounded and zero-padded. - alpha = this.fround(context, this.alpha); - if (alpha < 1) { - return 'rgba(' + this.rgb.map(function (c) { - return clamp(Math.round(c), 255); - }).concat(clamp(alpha, 1)) - .join(',' + (compress ? '' : ' ')) + ')'; - } - - color = this.toRGB(); - - if (compress) { - var splitcolor = color.split(''); - - // Convert color to short format - if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) { - color = '#' + splitcolor[1] + splitcolor[3] + splitcolor[5]; - } - } - - return color; -}; - -// -// Operations have to be done per-channel, if not, -// channels will spill onto each other. Once we have -// our result, in the form of an integer triplet, -// we create a new Color node to hold the result. -// -Color.prototype.operate = function (context, op, other) { - var rgb = new Array(3); - var alpha = this.alpha * (1 - other.alpha) + other.alpha; - for (var c = 0; c < 3; c++) { - rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]); - } - return new Color(rgb, alpha); -}; -Color.prototype.toRGB = function () { - return toHex(this.rgb); -}; -Color.prototype.toHSL = function () { - var r = this.rgb[0] / 255, - g = this.rgb[1] / 255, - b = this.rgb[2] / 255, - a = this.alpha; - - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h, s, l = (max + min) / 2, d = max - min; - - if (max === min) { - h = s = 0; - } else { - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - - switch (max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h * 360, s: s, l: l, a: a }; -}; -// Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript -Color.prototype.toHSV = function () { - var r = this.rgb[0] / 255, - g = this.rgb[1] / 255, - b = this.rgb[2] / 255, - a = this.alpha; - - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h, s, v = max; - - var d = max - min; - if (max === 0) { - s = 0; - } else { - s = d / max; - } - - if (max === min) { - h = 0; - } else { - switch (max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h * 360, s: s, v: v, a: a }; -}; -Color.prototype.toARGB = function () { - return toHex([this.alpha * 255].concat(this.rgb)); -}; -Color.prototype.compare = function (x) { - return (x.rgb && - x.rgb[0] === this.rgb[0] && - x.rgb[1] === this.rgb[1] && - x.rgb[2] === this.rgb[2] && - x.alpha === this.alpha) ? 0 : undefined; -}; - -Color.fromKeyword = function(keyword) { - var c, key = keyword.toLowerCase(); - if (colors.hasOwnProperty(key)) { - c = new Color(colors[key].slice(1)); - } - else if (key === 'transparent') { - c = new Color([0, 0, 0], 0); - } - - if (c) { - c.value = keyword; - return c; - } -}; -module.exports = Color; - -},{"../data/colors":13,"./node":76}],56:[function(require,module,exports){ -var Node = require('./node'); - -var Combinator = function (value) { - if (value === ' ') { - this.value = ' '; - this.emptyOrWhitespace = true; - } else { - this.value = value ? value.trim() : ''; - this.emptyOrWhitespace = this.value === ''; - } -}; -Combinator.prototype = new Node(); -Combinator.prototype.type = 'Combinator'; -var _noSpaceCombinators = { - '': true, - ' ': true, - '|': true -}; -Combinator.prototype.genCSS = function (context, output) { - var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; - output.add(spaceOrEmpty + this.value + spaceOrEmpty); -}; -module.exports = Combinator; - -},{"./node":76}],57:[function(require,module,exports){ -var Node = require('./node'), - getDebugInfo = require('./debug-info'); - -var Comment = function (value, isLineComment, index, currentFileInfo) { - this.value = value; - this.isLineComment = isLineComment; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; -}; -Comment.prototype = new Node(); -Comment.prototype.type = 'Comment'; -Comment.prototype.genCSS = function (context, output) { - if (this.debugInfo) { - output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex()); - } - output.add(this.value); -}; -Comment.prototype.isSilent = function(context) { - var isCompressed = context.compress && this.value[2] !== '!'; - return this.isLineComment || isCompressed; -}; -module.exports = Comment; - -},{"./debug-info":59,"./node":76}],58:[function(require,module,exports){ -var Node = require('./node'); - -var Condition = function (op, l, r, i, negate) { - this.op = op.trim(); - this.lvalue = l; - this.rvalue = r; - this._index = i; - this.negate = negate; -}; -Condition.prototype = new Node(); -Condition.prototype.type = 'Condition'; -Condition.prototype.accept = function (visitor) { - this.lvalue = visitor.visit(this.lvalue); - this.rvalue = visitor.visit(this.rvalue); -}; -Condition.prototype.eval = function (context) { - var result = (function (op, a, b) { - switch (op) { - case 'and': return a && b; - case 'or': return a || b; - default: - switch (Node.compare(a, b)) { - case -1: - return op === '<' || op === '=<' || op === '<='; - case 0: - return op === '=' || op === '>=' || op === '=<' || op === '<='; - case 1: - return op === '>' || op === '>='; - default: - return false; - } - } - })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); - - return this.negate ? !result : result; -}; -module.exports = Condition; - -},{"./node":76}],59:[function(require,module,exports){ -var debugInfo = function(context, ctx, lineSeparator) { - var result = ''; - if (context.dumpLineNumbers && !context.compress) { - switch (context.dumpLineNumbers) { - case 'comments': - result = debugInfo.asComment(ctx); - break; - case 'mediaquery': - result = debugInfo.asMediaQuery(ctx); - break; - case 'all': - result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx); - break; - } - } - return result; -}; - -debugInfo.asComment = function(ctx) { - return '/* line ' + ctx.debugInfo.lineNumber + ', ' + ctx.debugInfo.fileName + ' */\n'; -}; - -debugInfo.asMediaQuery = function(ctx) { - var filenameWithProtocol = ctx.debugInfo.fileName; - if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { - filenameWithProtocol = 'file://' + filenameWithProtocol; - } - return '@media -sass-debug-info{filename{font-family:' + - filenameWithProtocol.replace(/([.:\/\\])/g, function (a) { - if (a == '\\') { - a = '\/'; - } - return '\\' + a; - }) + - '}line{font-family:\\00003' + ctx.debugInfo.lineNumber + '}}\n'; -}; - -module.exports = debugInfo; - -},{}],60:[function(require,module,exports){ -var Node = require('./node'), - Value = require('./value'), - Keyword = require('./keyword'), - Anonymous = require('./anonymous'), - MATH = require('../math-constants'); - -var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) { - this.name = name; - this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); - this.important = important ? ' ' + important.trim() : ''; - this.merge = merge; - this._index = index; - this._fileInfo = currentFileInfo; - this.inline = inline || false; - this.variable = (variable !== undefined) ? variable - : (name.charAt && (name.charAt(0) === '@')); - this.allowRoot = true; - this.setParent(this.value, this); -}; - -function evalName(context, name) { - var value = '', i, n = name.length, - output = {add: function (s) {value += s;}}; - for (i = 0; i < n; i++) { - name[i].eval(context).genCSS(context, output); - } - return value; -} - -Declaration.prototype = new Node(); -Declaration.prototype.type = 'Declaration'; -Declaration.prototype.genCSS = function (context, output) { - output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); - try { - this.value.genCSS(context, output); - } - catch (e) { - e.index = this._index; - e.filename = this._fileInfo.filename; - throw e; - } - output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); -}; -Declaration.prototype.eval = function (context) { - var mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; - if (typeof name !== 'string') { - // expand 'primitive' name directly to get - // things faster (~10% for benchmark.less): - name = (name.length === 1) && (name[0] instanceof Keyword) ? - name[0].value : evalName(context, name); - variable = false; // never treat expanded interpolation as new variable name - } - - // @todo remove when parens-division is default - if (name === 'font' && context.math === MATH.ALWAYS) { - mathBypass = true; - prevMath = context.math; - context.math = MATH.PARENS_DIVISION; - } - try { - context.importantScope.push({}); - evaldValue = this.value.eval(context); - - if (!this.variable && evaldValue.type === 'DetachedRuleset') { - throw { message: 'Rulesets cannot be evaluated on a property.', - index: this.getIndex(), filename: this.fileInfo().filename }; - } - var important = this.important, - importantResult = context.importantScope.pop(); - if (!important && importantResult.important) { - important = importantResult.important; - } - - return new Declaration(name, - evaldValue, - important, - this.merge, - this.getIndex(), this.fileInfo(), this.inline, - variable); - } - catch (e) { - if (typeof e.index !== 'number') { - e.index = this.getIndex(); - e.filename = this.fileInfo().filename; - } - throw e; - } - finally { - if (mathBypass) { - context.math = prevMath; - } - } -}; -Declaration.prototype.makeImportant = function () { - return new Declaration(this.name, - this.value, - '!important', - this.merge, - this.getIndex(), this.fileInfo(), this.inline); -}; - -module.exports = Declaration; -},{"../math-constants":39,"./anonymous":50,"./keyword":70,"./node":76,"./value":86}],61:[function(require,module,exports){ -var Node = require('./node'), - contexts = require('../contexts'), - utils = require('../utils'); - -var DetachedRuleset = function (ruleset, frames) { - this.ruleset = ruleset; - this.frames = frames; - this.setParent(this.ruleset, this); -}; -DetachedRuleset.prototype = new Node(); -DetachedRuleset.prototype.type = 'DetachedRuleset'; -DetachedRuleset.prototype.evalFirst = true; -DetachedRuleset.prototype.accept = function (visitor) { - this.ruleset = visitor.visit(this.ruleset); -}; -DetachedRuleset.prototype.eval = function (context) { - var frames = this.frames || utils.copyArray(context.frames); - return new DetachedRuleset(this.ruleset, frames); -}; -DetachedRuleset.prototype.callEval = function (context) { - return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); -}; -module.exports = DetachedRuleset; - -},{"../contexts":12,"../utils":89,"./node":76}],62:[function(require,module,exports){ -var Node = require('./node'), - unitConversions = require('../data/unit-conversions'), - Unit = require('./unit'), - Color = require('./color'); - -// -// A number with a unit -// -var Dimension = function (value, unit) { - this.value = parseFloat(value); - if (isNaN(this.value)) { - throw new Error('Dimension is not a number.'); - } - this.unit = (unit && unit instanceof Unit) ? unit : - new Unit(unit ? [unit] : undefined); - this.setParent(this.unit, this); -}; - -Dimension.prototype = new Node(); -Dimension.prototype.type = 'Dimension'; -Dimension.prototype.accept = function (visitor) { - this.unit = visitor.visit(this.unit); -}; -Dimension.prototype.eval = function (context) { - return this; -}; -Dimension.prototype.toColor = function () { - return new Color([this.value, this.value, this.value]); -}; -Dimension.prototype.genCSS = function (context, output) { - if ((context && context.strictUnits) && !this.unit.isSingular()) { - throw new Error('Multiple units in dimension. Correct the units or use the unit function. Bad unit: ' + this.unit.toString()); - } - - var value = this.fround(context, this.value), - strValue = String(value); - - if (value !== 0 && value < 0.000001 && value > -0.000001) { - // would be output 1e-6 etc. - strValue = value.toFixed(20).replace(/0+$/, ''); - } - - if (context && context.compress) { - // Zero values doesn't need a unit - if (value === 0 && this.unit.isLength()) { - output.add(strValue); - return; - } - - // Float values doesn't need a leading zero - if (value > 0 && value < 1) { - strValue = (strValue).substr(1); - } - } - - output.add(strValue); - this.unit.genCSS(context, output); -}; - -// In an operation between two Dimensions, -// we default to the first Dimension's unit, -// so `1px + 2` will yield `3px`. -Dimension.prototype.operate = function (context, op, other) { - /* jshint noempty:false */ - var value = this._operate(context, op, this.value, other.value), - unit = this.unit.clone(); - - if (op === '+' || op === '-') { - if (unit.numerator.length === 0 && unit.denominator.length === 0) { - unit = other.unit.clone(); - if (this.unit.backupUnit) { - unit.backupUnit = this.unit.backupUnit; - } - } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) { - // do nothing - } else { - other = other.convertTo(this.unit.usedUnits()); - - if (context.strictUnits && other.unit.toString() !== unit.toString()) { - throw new Error('Incompatible units. Change the units or use the unit function. Bad units: \'' + unit.toString() + - '\' and \'' + other.unit.toString() + '\'.'); - } - - value = this._operate(context, op, this.value, other.value); - } - } else if (op === '*') { - unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); - unit.denominator = unit.denominator.concat(other.unit.denominator).sort(); - unit.cancel(); - } else if (op === '/') { - unit.numerator = unit.numerator.concat(other.unit.denominator).sort(); - unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); - unit.cancel(); - } - return new Dimension(value, unit); -}; -Dimension.prototype.compare = function (other) { - var a, b; - - if (!(other instanceof Dimension)) { - return undefined; - } - - if (this.unit.isEmpty() || other.unit.isEmpty()) { - a = this; - b = other; - } else { - a = this.unify(); - b = other.unify(); - if (a.unit.compare(b.unit) !== 0) { - return undefined; - } - } - - return Node.numericCompare(a.value, b.value); -}; -Dimension.prototype.unify = function () { - return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); -}; -Dimension.prototype.convertTo = function (conversions) { - var value = this.value, unit = this.unit.clone(), - i, groupName, group, targetUnit, derivedConversions = {}, applyUnit; - - if (typeof conversions === 'string') { - for (i in unitConversions) { - if (unitConversions[i].hasOwnProperty(conversions)) { - derivedConversions = {}; - derivedConversions[i] = conversions; - } - } - conversions = derivedConversions; - } - applyUnit = function (atomicUnit, denominator) { - /* jshint loopfunc:true */ - if (group.hasOwnProperty(atomicUnit)) { - if (denominator) { - value = value / (group[atomicUnit] / group[targetUnit]); - } else { - value = value * (group[atomicUnit] / group[targetUnit]); - } - - return targetUnit; - } - - return atomicUnit; - }; - - for (groupName in conversions) { - if (conversions.hasOwnProperty(groupName)) { - targetUnit = conversions[groupName]; - group = unitConversions[groupName]; - - unit.map(applyUnit); - } - } - - unit.cancel(); - - return new Dimension(value, unit); -}; -module.exports = Dimension; - -},{"../data/unit-conversions":15,"./color":55,"./node":76,"./unit":84}],63:[function(require,module,exports){ -var Node = require('./node'), - Paren = require('./paren'), - Combinator = require('./combinator'); - -var Element = function (combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { - this.combinator = combinator instanceof Combinator ? - combinator : new Combinator(combinator); - - if (typeof value === 'string') { - this.value = value.trim(); - } else if (value) { - this.value = value; - } else { - this.value = ''; - } - this.isVariable = isVariable; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.combinator, this); -}; -Element.prototype = new Node(); -Element.prototype.type = 'Element'; -Element.prototype.accept = function (visitor) { - var value = this.value; - this.combinator = visitor.visit(this.combinator); - if (typeof value === 'object') { - this.value = visitor.visit(value); - } -}; -Element.prototype.eval = function (context) { - return new Element(this.combinator, - this.value.eval ? this.value.eval(context) : this.value, - this.isVariable, - this.getIndex(), - this.fileInfo(), this.visibilityInfo()); -}; -Element.prototype.clone = function () { - return new Element(this.combinator, - this.value, - this.isVariable, - this.getIndex(), - this.fileInfo(), this.visibilityInfo()); -}; -Element.prototype.genCSS = function (context, output) { - output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); -}; -Element.prototype.toCSS = function (context) { - context = context || {}; - var value = this.value, firstSelector = context.firstSelector; - if (value instanceof Paren) { - // selector in parens should not be affected by outer selector - // flags (breaks only interpolated selectors - see #1973) - context.firstSelector = true; - } - value = value.toCSS ? value.toCSS(context) : value; - context.firstSelector = firstSelector; - if (value === '' && this.combinator.value.charAt(0) === '&') { - return ''; - } else { - return this.combinator.toCSS(context) + value; - } -}; -module.exports = Element; - -},{"./combinator":56,"./node":76,"./paren":78}],64:[function(require,module,exports){ -var Node = require('./node'), - Paren = require('./paren'), - Comment = require('./comment'), - Dimension = require('./dimension'), - MATH = require('../math-constants'); - -var Expression = function (value, noSpacing) { - this.value = value; - this.noSpacing = noSpacing; - if (!value) { - throw new Error('Expression requires an array parameter'); - } -}; -Expression.prototype = new Node(); -Expression.prototype.type = 'Expression'; -Expression.prototype.accept = function (visitor) { - this.value = visitor.visitArray(this.value); -}; -Expression.prototype.eval = function (context) { - var returnValue, - mathOn = context.isMathOn(), - inParenthesis = this.parens && - (context.math !== MATH.STRICT_LEGACY || !this.parensInOp), - doubleParen = false; - if (inParenthesis) { - context.inParenthesis(); - } - if (this.value.length > 1) { - returnValue = new Expression(this.value.map(function (e) { - if (!e.eval) { - return e; - } - return e.eval(context); - }), this.noSpacing); - } else if (this.value.length === 1) { - if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { - doubleParen = true; - } - returnValue = this.value[0].eval(context); - } else { - returnValue = this; - } - if (inParenthesis) { - context.outOfParenthesis(); - } - if (this.parens && this.parensInOp && !mathOn && !doubleParen - && (!(returnValue instanceof Dimension))) { - returnValue = new Paren(returnValue); - } - return returnValue; -}; -Expression.prototype.genCSS = function (context, output) { - for (var i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (!this.noSpacing && i + 1 < this.value.length) { - output.add(' '); - } - } -}; -Expression.prototype.throwAwayComments = function () { - this.value = this.value.filter(function(v) { - return !(v instanceof Comment); - }); -}; -module.exports = Expression; - -},{"../math-constants":39,"./comment":57,"./dimension":62,"./node":76,"./paren":78}],65:[function(require,module,exports){ -var Node = require('./node'), - Selector = require('./selector'); - -var Extend = function Extend(selector, option, index, currentFileInfo, visibilityInfo) { - this.selector = selector; - this.option = option; - this.object_id = Extend.next_id++; - this.parent_ids = [this.object_id]; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - - switch (option) { - case 'all': - this.allowBefore = true; - this.allowAfter = true; - break; - default: - this.allowBefore = false; - this.allowAfter = false; - break; - } - this.setParent(this.selector, this); -}; -Extend.next_id = 0; - -Extend.prototype = new Node(); -Extend.prototype.type = 'Extend'; -Extend.prototype.accept = function (visitor) { - this.selector = visitor.visit(this.selector); -}; -Extend.prototype.eval = function (context) { - return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); -}; -Extend.prototype.clone = function (context) { - return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); -}; -// it concatenates (joins) all selectors in selector array -Extend.prototype.findSelfSelectors = function (selectors) { - var selfElements = [], - i, - selectorElements; - - for (i = 0; i < selectors.length; i++) { - selectorElements = selectors[i].elements; - // duplicate the logic in genCSS function inside the selector node. - // future TODO - move both logics into the selector joiner visitor - if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') { - selectorElements[0].combinator.value = ' '; - } - selfElements = selfElements.concat(selectors[i].elements); - } - - this.selfSelectors = [new Selector(selfElements)]; - this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); -}; -module.exports = Extend; - -},{"./node":76,"./selector":82}],66:[function(require,module,exports){ -var Node = require('./node'), - Media = require('./media'), - URL = require('./url'), - Quoted = require('./quoted'), - Ruleset = require('./ruleset'), - Anonymous = require('./anonymous'), - utils = require('../utils'), - LessError = require('../less-error'); - -// -// CSS @import node -// -// The general strategy here is that we don't want to wait -// for the parsing to be completed, before we start importing -// the file. That's because in the context of a browser, -// most of the time will be spent waiting for the server to respond. -// -// On creation, we push the import path to our import queue, though -// `import,push`, we also pass it a callback, which it'll call once -// the file has been fetched, and parsed. -// -var Import = function (path, features, options, index, currentFileInfo, visibilityInfo) { - this.options = options; - this._index = index; - this._fileInfo = currentFileInfo; - this.path = path; - this.features = features; - this.allowRoot = true; - - if (this.options.less !== undefined || this.options.inline) { - this.css = !this.options.less || this.options.inline; - } else { - var pathValue = this.getPath(); - if (pathValue && /[#\.\&\?]css([\?;].*)?$/.test(pathValue)) { - this.css = true; - } - } - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.features, this); - this.setParent(this.path, this); -}; - -// -// The actual import node doesn't return anything, when converted to CSS. -// The reason is that it's used at the evaluation stage, so that the rules -// it imports can be treated like any other rules. -// -// In `eval`, we make sure all Import nodes get evaluated, recursively, so -// we end up with a flat structure, which can easily be imported in the parent -// ruleset. -// -Import.prototype = new Node(); -Import.prototype.type = 'Import'; -Import.prototype.accept = function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - this.path = visitor.visit(this.path); - if (!this.options.isPlugin && !this.options.inline && this.root) { - this.root = visitor.visit(this.root); - } -}; -Import.prototype.genCSS = function (context, output) { - if (this.css && this.path._fileInfo.reference === undefined) { - output.add('@import ', this._fileInfo, this._index); - this.path.genCSS(context, output); - if (this.features) { - output.add(' '); - this.features.genCSS(context, output); - } - output.add(';'); - } -}; -Import.prototype.getPath = function () { - return (this.path instanceof URL) ? - this.path.value.value : this.path.value; -}; -Import.prototype.isVariableImport = function () { - var path = this.path; - if (path instanceof URL) { - path = path.value; - } - if (path instanceof Quoted) { - return path.containsVariables(); - } - - return true; -}; -Import.prototype.evalForImport = function (context) { - var path = this.path; - - if (path instanceof URL) { - path = path.value; - } - - return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); -}; -Import.prototype.evalPath = function (context) { - var path = this.path.eval(context); - var rootpath = this._fileInfo && this._fileInfo.rootpath; - - if (!(path instanceof URL)) { - if (rootpath) { - var pathValue = path.value; - // Add the base path if the import is relative - if (pathValue && context.isPathRelative(pathValue)) { - path.value = rootpath + pathValue; - } - } - path.value = context.normalizePath(path.value); - } - - return path; -}; -Import.prototype.eval = function (context) { - var result = this.doEval(context); - if (this.options.reference || this.blocksVisibility()) { - if (result.length || result.length === 0) { - result.forEach(function (node) { - node.addVisibilityBlock(); - } - ); - } else { - result.addVisibilityBlock(); - } - } - return result; -}; -Import.prototype.doEval = function (context) { - var ruleset, registry, - features = this.features && this.features.eval(context); - - if (this.options.isPlugin) { - if (this.root && this.root.eval) { - try { - this.root.eval(context); - } - catch (e) { - e.message = 'Plugin error during evaluation'; - throw new LessError(e, this.root.imports, this.root.filename); - } - } - registry = context.frames[0] && context.frames[0].functionRegistry; - if ( registry && this.root && this.root.functions ) { - registry.addMultiple( this.root.functions ); - } - - return []; - } - - if (this.skip) { - if (typeof this.skip === 'function') { - this.skip = this.skip(); - } - if (this.skip) { - return []; - } - } - if (this.options.inline) { - var contents = new Anonymous(this.root, 0, - { - filename: this.importedFilename, - reference: this.path._fileInfo && this.path._fileInfo.reference - }, true, true); - - return this.features ? new Media([contents], this.features.value) : [contents]; - } else if (this.css) { - var newImport = new Import(this.evalPath(context), features, this.options, this._index); - if (!newImport.css && this.error) { - throw this.error; - } - return newImport; - } else { - ruleset = new Ruleset(null, utils.copyArray(this.root.rules)); - ruleset.evalImports(context); - - return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; - } -}; -module.exports = Import; - -},{"../less-error":37,"../utils":89,"./anonymous":50,"./media":71,"./node":76,"./quoted":80,"./ruleset":81,"./url":85}],67:[function(require,module,exports){ -var tree = Object.create(null); - -tree.Node = require('./node'); -tree.Color = require('./color'); -tree.AtRule = require('./atrule'); -tree.DetachedRuleset = require('./detached-ruleset'); -tree.Operation = require('./operation'); -tree.Dimension = require('./dimension'); -tree.Unit = require('./unit'); -tree.Keyword = require('./keyword'); -tree.Variable = require('./variable'); -tree.Property = require('./property'); -tree.Ruleset = require('./ruleset'); -tree.Element = require('./element'); -tree.Attribute = require('./attribute'); -tree.Combinator = require('./combinator'); -tree.Selector = require('./selector'); -tree.Quoted = require('./quoted'); -tree.Expression = require('./expression'); -tree.Declaration = require('./declaration'); -tree.Call = require('./call'); -tree.URL = require('./url'); -tree.Import = require('./import'); -tree.mixin = { - Call: require('./mixin-call'), - Definition: require('./mixin-definition') -}; -tree.Comment = require('./comment'); -tree.Anonymous = require('./anonymous'); -tree.Value = require('./value'); -tree.JavaScript = require('./javascript'); -tree.Assignment = require('./assignment'); -tree.Condition = require('./condition'); -tree.Paren = require('./paren'); -tree.Media = require('./media'); -tree.UnicodeDescriptor = require('./unicode-descriptor'); -tree.Negative = require('./negative'); -tree.Extend = require('./extend'); -tree.VariableCall = require('./variable-call'); -tree.NamespaceValue = require('./namespace-value'); - -module.exports = tree; - -},{"./anonymous":50,"./assignment":51,"./atrule":52,"./attribute":53,"./call":54,"./color":55,"./combinator":56,"./comment":57,"./condition":58,"./declaration":60,"./detached-ruleset":61,"./dimension":62,"./element":63,"./expression":64,"./extend":65,"./import":66,"./javascript":68,"./keyword":70,"./media":71,"./mixin-call":72,"./mixin-definition":73,"./namespace-value":74,"./negative":75,"./node":76,"./operation":77,"./paren":78,"./property":79,"./quoted":80,"./ruleset":81,"./selector":82,"./unicode-descriptor":83,"./unit":84,"./url":85,"./value":86,"./variable":88,"./variable-call":87}],68:[function(require,module,exports){ -var JsEvalNode = require('./js-eval-node'), - Dimension = require('./dimension'), - Quoted = require('./quoted'), - Anonymous = require('./anonymous'); - -var JavaScript = function (string, escaped, index, currentFileInfo) { - this.escaped = escaped; - this.expression = string; - this._index = index; - this._fileInfo = currentFileInfo; -}; -JavaScript.prototype = new JsEvalNode(); -JavaScript.prototype.type = 'JavaScript'; -JavaScript.prototype.eval = function(context) { - var result = this.evaluateJavaScript(this.expression, context); - var type = typeof result; - - if (type === 'number' && !isNaN(result)) { - return new Dimension(result); - } else if (type === 'string') { - return new Quoted('"' + result + '"', result, this.escaped, this._index); - } else if (Array.isArray(result)) { - return new Anonymous(result.join(', ')); - } else { - return new Anonymous(result); - } -}; - -module.exports = JavaScript; - -},{"./anonymous":50,"./dimension":62,"./js-eval-node":69,"./quoted":80}],69:[function(require,module,exports){ -var Node = require('./node'), - Variable = require('./variable'); - -var JsEvalNode = function() { -}; -JsEvalNode.prototype = new Node(); - -JsEvalNode.prototype.evaluateJavaScript = function (expression, context) { - var result, - that = this, - evalContext = {}; - - if (!context.javascriptEnabled) { - throw { message: 'Inline JavaScript is not enabled. Is it set in your options?', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - - expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { - return that.jsify(new Variable('@' + name, that.getIndex(), that.fileInfo()).eval(context)); - }); - - try { - expression = new Function('return (' + expression + ')'); - } catch (e) { - throw { message: 'JavaScript evaluation error: ' + e.message + ' from `' + expression + '`' , - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - - var variables = context.frames[0].variables(); - for (var k in variables) { - if (variables.hasOwnProperty(k)) { - /* jshint loopfunc:true */ - evalContext[k.slice(1)] = { - value: variables[k].value, - toJS: function () { - return this.value.eval(context).toCSS(); - } - }; - } - } - - try { - result = expression.call(evalContext); - } catch (e) { - throw { message: 'JavaScript evaluation error: \'' + e.name + ': ' + e.message.replace(/["]/g, '\'') + '\'' , - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - return result; -}; -JsEvalNode.prototype.jsify = function (obj) { - if (Array.isArray(obj.value) && (obj.value.length > 1)) { - return '[' + obj.value.map(function (v) { return v.toCSS(); }).join(', ') + ']'; - } else { - return obj.toCSS(); - } -}; - -module.exports = JsEvalNode; - -},{"./node":76,"./variable":88}],70:[function(require,module,exports){ -var Node = require('./node'); - -var Keyword = function (value) { this.value = value; }; -Keyword.prototype = new Node(); -Keyword.prototype.type = 'Keyword'; -Keyword.prototype.genCSS = function (context, output) { - if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; } - output.add(this.value); -}; - -Keyword.True = new Keyword('true'); -Keyword.False = new Keyword('false'); - -module.exports = Keyword; - -},{"./node":76}],71:[function(require,module,exports){ -var Ruleset = require('./ruleset'), - Value = require('./value'), - Selector = require('./selector'), - Anonymous = require('./anonymous'), - Expression = require('./expression'), - AtRule = require('./atrule'), - utils = require('../utils'); - -var Media = function (value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; - - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); -}; -Media.prototype = new AtRule(); -Media.prototype.type = 'Media'; -Media.prototype.isRulesetLike = function() { return true; }; -Media.prototype.accept = function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - if (this.rules) { - this.rules = visitor.visitArray(this.rules); - } -}; -Media.prototype.genCSS = function (context, output) { - output.add('@media ', this._fileInfo, this._index); - this.features.genCSS(context, output); - this.outputRuleset(context, output, this.rules); -}; -Media.prototype.eval = function (context) { - if (!context.mediaBlocks) { - context.mediaBlocks = []; - context.mediaPath = []; - } - - var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); - if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; - media.debugInfo = this.debugInfo; - } - - media.features = this.features.eval(context); - - context.mediaPath.push(media); - context.mediaBlocks.push(media); - - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; - context.frames.shift(); - - context.mediaPath.pop(); - - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); -}; -Media.prototype.evalTop = function (context) { - var result = this; - - // Render all dependent Media blocks. - if (context.mediaBlocks.length > 1) { - var selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors(); - result = new Ruleset(selectors, context.mediaBlocks); - result.multiMedia = true; - result.copyVisibilityInfo(this.visibilityInfo()); - this.setParent(result, this); - } - - delete context.mediaBlocks; - delete context.mediaPath; - - return result; -}; -Media.prototype.evalNested = function (context) { - var i, value, - path = context.mediaPath.concat([this]); - - // Extract the media-query conditions separated with `,` (OR). - for (i = 0; i < path.length; i++) { - value = path[i].features instanceof Value ? - path[i].features.value : path[i].features; - path[i] = Array.isArray(value) ? value : [value]; - } - - // Trace all permutations to generate the resulting media-query. - // - // (a, b and c) with nested (d, e) -> - // a and d - // a and e - // b and c and d - // b and c and e - this.features = new Value(this.permute(path).map(function (path) { - path = path.map(function (fragment) { - return fragment.toCSS ? fragment : new Anonymous(fragment); - }); - - for (i = path.length - 1; i > 0; i--) { - path.splice(i, 0, new Anonymous('and')); - } - - return new Expression(path); - })); - this.setParent(this.features, this); - - // Fake a tree-node that doesn't output anything. - return new Ruleset([], []); -}; -Media.prototype.permute = function (arr) { - if (arr.length === 0) { - return []; - } else if (arr.length === 1) { - return arr[0]; - } else { - var result = []; - var rest = this.permute(arr.slice(1)); - for (var i = 0; i < rest.length; i++) { - for (var j = 0; j < arr[0].length; j++) { - result.push([arr[0][j]].concat(rest[i])); - } - } - return result; - } -}; -Media.prototype.bubbleSelectors = function (selectors) { - if (!selectors) { - return; - } - this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])]; - this.setParent(this.rules, this); -}; -module.exports = Media; - -},{"../utils":89,"./anonymous":50,"./atrule":52,"./expression":64,"./ruleset":81,"./selector":82,"./value":86}],72:[function(require,module,exports){ -var Node = require('./node'), - Selector = require('./selector'), - MixinDefinition = require('./mixin-definition'), - defaultFunc = require('../functions/default'); - -var MixinCall = function (elements, args, index, currentFileInfo, important) { - this.selector = new Selector(elements); - this.arguments = args || []; - this._index = index; - this._fileInfo = currentFileInfo; - this.important = important; - this.allowRoot = true; - this.setParent(this.selector, this); -}; -MixinCall.prototype = new Node(); -MixinCall.prototype.type = 'MixinCall'; -MixinCall.prototype.accept = function (visitor) { - if (this.selector) { - this.selector = visitor.visit(this.selector); - } - if (this.arguments.length) { - this.arguments = visitor.visitArray(this.arguments); - } -}; -MixinCall.prototype.eval = function (context) { - var mixins, mixin, mixinPath, args = [], arg, argValue, - rules = [], match = false, i, m, f, isRecursive, isOneFound, - candidates = [], candidate, conditionResult = [], defaultResult, defFalseEitherCase = -1, - defNone = 0, defTrue = 1, defFalse = 2, count, originalRuleset, noArgumentsFilter; - - this.selector = this.selector.eval(context); - - function calcDefGroup(mixin, mixinPath) { - var f, p, namespace; - - for (f = 0; f < 2; f++) { - conditionResult[f] = true; - defaultFunc.value(f); - for (p = 0; p < mixinPath.length && conditionResult[f]; p++) { - namespace = mixinPath[p]; - if (namespace.matchCondition) { - conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context); - } - } - if (mixin.matchCondition) { - conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context); - } - } - if (conditionResult[0] || conditionResult[1]) { - if (conditionResult[0] != conditionResult[1]) { - return conditionResult[1] ? - defTrue : defFalse; - } - - return defNone; - } - return defFalseEitherCase; - } - - for (i = 0; i < this.arguments.length; i++) { - arg = this.arguments[i]; - argValue = arg.value.eval(context); - if (arg.expand && Array.isArray(argValue.value)) { - argValue = argValue.value; - for (m = 0; m < argValue.length; m++) { - args.push({value: argValue[m]}); - } - } else { - args.push({name: arg.name, value: argValue}); - } - } - - noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);}; - - for (i = 0; i < context.frames.length; i++) { - if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { - isOneFound = true; - - // To make `default()` function independent of definition order we have two "subpasses" here. - // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`), - // and build candidate list with corresponding flags. Then, when we know all possible matches, - // we make a final decision. - - for (m = 0; m < mixins.length; m++) { - mixin = mixins[m].rule; - mixinPath = mixins[m].path; - isRecursive = false; - for (f = 0; f < context.frames.length; f++) { - if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) { - isRecursive = true; - break; - } - } - if (isRecursive) { - continue; - } - - if (mixin.matchArgs(args, context)) { - candidate = {mixin: mixin, group: calcDefGroup(mixin, mixinPath)}; - - if (candidate.group !== defFalseEitherCase) { - candidates.push(candidate); - } - - match = true; - } - } - - defaultFunc.reset(); - - count = [0, 0, 0]; - for (m = 0; m < candidates.length; m++) { - count[candidates[m].group]++; - } - - if (count[defNone] > 0) { - defaultResult = defFalse; - } else { - defaultResult = defTrue; - if ((count[defTrue] + count[defFalse]) > 1) { - throw { type: 'Runtime', - message: 'Ambiguous use of `default()` found when matching for `' + this.format(args) + '`', - index: this.getIndex(), filename: this.fileInfo().filename }; - } - } - - for (m = 0; m < candidates.length; m++) { - candidate = candidates[m].group; - if ((candidate === defNone) || (candidate === defaultResult)) { - try { - mixin = candidates[m].mixin; - if (!(mixin instanceof MixinDefinition)) { - originalRuleset = mixin.originalRuleset || mixin; - mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); - mixin.originalRuleset = originalRuleset; - } - var newRules = mixin.evalCall(context, args, this.important).rules; - this._setVisibilityToReplacement(newRules); - Array.prototype.push.apply(rules, newRules); - } catch (e) { - throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack }; - } - } - } - - if (match) { - return rules; - } - } - } - if (isOneFound) { - throw { type: 'Runtime', - message: 'No matching definition was found for `' + this.format(args) + '`', - index: this.getIndex(), filename: this.fileInfo().filename }; - } else { - throw { type: 'Name', - message: this.selector.toCSS().trim() + ' is undefined', - index: this.getIndex(), filename: this.fileInfo().filename }; - } -}; - -MixinCall.prototype._setVisibilityToReplacement = function (replacement) { - var i, rule; - if (this.blocksVisibility()) { - for (i = 0; i < replacement.length; i++) { - rule = replacement[i]; - rule.addVisibilityBlock(); - } - } -}; -MixinCall.prototype.format = function (args) { - return this.selector.toCSS().trim() + '(' + - (args ? args.map(function (a) { - var argValue = ''; - if (a.name) { - argValue += a.name + ':'; - } - if (a.value.toCSS) { - argValue += a.value.toCSS(); - } else { - argValue += '???'; - } - return argValue; - }).join(', ') : '') + ')'; -}; -module.exports = MixinCall; - -},{"../functions/default":24,"./mixin-definition":73,"./node":76,"./selector":82}],73:[function(require,module,exports){ -var Selector = require('./selector'), - Element = require('./element'), - Ruleset = require('./ruleset'), - Declaration = require('./declaration'), - DetachedRuleset = require('./detached-ruleset'), - Expression = require('./expression'), - contexts = require('../contexts'), - utils = require('../utils'); - -var Definition = function (name, params, rules, condition, variadic, frames, visibilityInfo) { - this.name = name || 'anonymous mixin'; - this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; - this.params = params; - this.condition = condition; - this.variadic = variadic; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - var optionalParameters = []; - this.required = params.reduce(function (count, p) { - if (!p.name || (p.name && !p.value)) { - return count + 1; - } - else { - optionalParameters.push(p.name); - return count; - } - }, 0); - this.optionalParameters = optionalParameters; - this.frames = frames; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; -}; -Definition.prototype = new Ruleset(); -Definition.prototype.type = 'MixinDefinition'; -Definition.prototype.evalFirst = true; -Definition.prototype.accept = function (visitor) { - if (this.params && this.params.length) { - this.params = visitor.visitArray(this.params); - } - this.rules = visitor.visitArray(this.rules); - if (this.condition) { - this.condition = visitor.visit(this.condition); - } -}; -Definition.prototype.evalParams = function (context, mixinEnv, args, evaldArguments) { - /* jshint boss:true */ - var frame = new Ruleset(null, null), - varargs, arg, - params = utils.copyArray(this.params), - i, j, val, name, isNamedFound, argIndex, argsLength = 0; - - if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { - frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); - } - mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); - - if (args) { - args = utils.copyArray(args); - argsLength = args.length; - - for (i = 0; i < argsLength; i++) { - arg = args[i]; - if (name = (arg && arg.name)) { - isNamedFound = false; - for (j = 0; j < params.length; j++) { - if (!evaldArguments[j] && name === params[j].name) { - evaldArguments[j] = arg.value.eval(context); - frame.prependRule(new Declaration(name, arg.value.eval(context))); - isNamedFound = true; - break; - } - } - if (isNamedFound) { - args.splice(i, 1); - i--; - continue; - } else { - throw { type: 'Runtime', message: 'Named argument for ' + this.name + - ' ' + args[i].name + ' not found' }; - } - } - } - } - argIndex = 0; - for (i = 0; i < params.length; i++) { - if (evaldArguments[i]) { continue; } - - arg = args && args[argIndex]; - - if (name = params[i].name) { - if (params[i].variadic) { - varargs = []; - for (j = argIndex; j < argsLength; j++) { - varargs.push(args[j].value.eval(context)); - } - frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); - } else { - val = arg && arg.value; - if (val) { - // This was a mixin call, pass in a detached ruleset of it's eval'd rules - if (Array.isArray(val)) { - val = new DetachedRuleset(new Ruleset('', val)); - } - else { - val = val.eval(context); - } - } else if (params[i].value) { - val = params[i].value.eval(mixinEnv); - frame.resetCache(); - } else { - throw { type: 'Runtime', message: 'wrong number of arguments for ' + this.name + - ' (' + argsLength + ' for ' + this.arity + ')' }; - } - - frame.prependRule(new Declaration(name, val)); - evaldArguments[i] = val; - } - } - - if (params[i].variadic && args) { - for (j = argIndex; j < argsLength; j++) { - evaldArguments[j] = args[j].value.eval(context); - } - } - argIndex++; - } - - return frame; -}; -Definition.prototype.makeImportant = function() { - var rules = !this.rules ? this.rules : this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(true); - } else { - return r; - } - }); - var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); - return result; -}; -Definition.prototype.eval = function (context) { - return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames)); -}; -Definition.prototype.evalCall = function (context, args, important) { - var _arguments = [], - mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames, - frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments), - rules, ruleset; - - frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context))); - - rules = utils.copyArray(this.rules); - - ruleset = new Ruleset(null, rules); - ruleset.originalRuleset = this; - ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); - if (important) { - ruleset = ruleset.makeImportant(); - } - return ruleset; -}; -Definition.prototype.matchCondition = function (args, context) { - if (this.condition && !this.condition.eval( - new contexts.Eval(context, - [this.evalParams(context, /* the parameter variables */ - new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] - .concat(this.frames || []) // the parent namespace/mixin frames - .concat(context.frames)))) { // the current environment frames - return false; - } - return true; -}; -Definition.prototype.matchArgs = function (args, context) { - var allArgsCnt = (args && args.length) || 0, len, optionalParameters = this.optionalParameters; - var requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) { - if (optionalParameters.indexOf(p.name) < 0) { - return count + 1; - } else { - return count; - } - }, 0); - - if (!this.variadic) { - if (requiredArgsCnt < this.required) { - return false; - } - if (allArgsCnt > this.params.length) { - return false; - } - } else { - if (requiredArgsCnt < (this.required - 1)) { - return false; - } - } - - // check patterns - len = Math.min(requiredArgsCnt, this.arity); - - for (var i = 0; i < len; i++) { - if (!this.params[i].name && !this.params[i].variadic) { - if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) { - return false; - } - } - } - return true; -}; -module.exports = Definition; - -},{"../contexts":12,"../utils":89,"./declaration":60,"./detached-ruleset":61,"./element":63,"./expression":64,"./ruleset":81,"./selector":82}],74:[function(require,module,exports){ -var Node = require('./node'), - Variable = require('./variable'), - Ruleset = require('./ruleset'), - Selector = require('./selector'); - -var NamespaceValue = function (ruleCall, lookups, important, index, fileInfo) { - this.value = ruleCall; - this.lookups = lookups; - this.important = important; - this._index = index; - this._fileInfo = fileInfo; -}; -NamespaceValue.prototype = new Node(); -NamespaceValue.prototype.type = 'NamespaceValue'; -NamespaceValue.prototype.eval = function (context) { - var i, j, name, rules = this.value.eval(context); - - for (i = 0; i < this.lookups.length; i++) { - name = this.lookups[i]; - - /** - * Eval'd DRs return rulesets. - * Eval'd mixins return rules, so let's make a ruleset if we need it. - * We need to do this because of late parsing of values - */ - if (Array.isArray(rules)) { - rules = new Ruleset([new Selector()], rules); - } - - if (name === '') { - rules = rules.lastDeclaration(); - } - else if (name.charAt(0) === '@') { - if (name.charAt(1) === '@') { - name = '@' + new Variable(name.substr(1)).eval(context).value; - } - if (rules.variables) { - rules = rules.variable(name); - } - - if (!rules) { - throw { type: 'Name', - message: 'variable ' + name + ' not found', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - } - else { - if (name.substring(0, 2) === '$@') { - name = '$' + new Variable(name.substr(1)).eval(context).value; - } - else { - name = name.charAt(0) === '$' ? name : '$' + name; - } - if (rules.properties) { - rules = rules.property(name); - } - - if (!rules) { - throw { type: 'Name', - message: 'property "' + name.substr(1) + '" not found', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - // Properties are an array of values, since a ruleset can have multiple props. - // We pick the last one (the "cascaded" value) - rules = rules[rules.length - 1]; - } - - if (rules.value) { - rules = rules.eval(context).value; - } - if (rules.ruleset) { - rules = rules.ruleset.eval(context); - } - } - return rules; -}; -module.exports = NamespaceValue; - -},{"./node":76,"./ruleset":81,"./selector":82,"./variable":88}],75:[function(require,module,exports){ -var Node = require('./node'), - Operation = require('./operation'), - Dimension = require('./dimension'); - -var Negative = function (node) { - this.value = node; -}; -Negative.prototype = new Node(); -Negative.prototype.type = 'Negative'; -Negative.prototype.genCSS = function (context, output) { - output.add('-'); - this.value.genCSS(context, output); -}; -Negative.prototype.eval = function (context) { - if (context.isMathOn()) { - return (new Operation('*', [new Dimension(-1), this.value])).eval(context); - } - return new Negative(this.value.eval(context)); -}; -module.exports = Negative; - -},{"./dimension":62,"./node":76,"./operation":77}],76:[function(require,module,exports){ -var Node = function() { - this.parent = null; - this.visibilityBlocks = undefined; - this.nodeVisible = undefined; - this.rootNode = null; - this.parsed = null; - - var self = this; - Object.defineProperty(this, 'currentFileInfo', { - get: function() { return self.fileInfo(); } - }); - Object.defineProperty(this, 'index', { - get: function() { return self.getIndex(); } - }); - -}; -Node.prototype.setParent = function(nodes, parent) { - function set(node) { - if (node && node instanceof Node) { - node.parent = parent; - } - } - if (Array.isArray(nodes)) { - nodes.forEach(set); - } - else { - set(nodes); - } -}; -Node.prototype.getIndex = function() { - return this._index || (this.parent && this.parent.getIndex()) || 0; -}; -Node.prototype.fileInfo = function() { - return this._fileInfo || (this.parent && this.parent.fileInfo()) || {}; -}; -Node.prototype.isRulesetLike = function() { return false; }; -Node.prototype.toCSS = function (context) { - var strs = []; - this.genCSS(context, { - add: function(chunk, fileInfo, index) { - strs.push(chunk); - }, - isEmpty: function () { - return strs.length === 0; - } - }); - return strs.join(''); -}; -Node.prototype.genCSS = function (context, output) { - output.add(this.value); -}; -Node.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); -}; -Node.prototype.eval = function () { return this; }; -Node.prototype._operate = function (context, op, a, b) { - switch (op) { - case '+': return a + b; - case '-': return a - b; - case '*': return a * b; - case '/': return a / b; - } -}; -Node.prototype.fround = function(context, value) { - var precision = context && context.numPrecision; - // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: - return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; -}; -Node.compare = function (a, b) { - /* returns: - -1: a < b - 0: a = b - 1: a > b - and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */ - - if ((a.compare) && - // for "symmetric results" force toCSS-based comparison - // of Quoted or Anonymous if either value is one of those - !(b.type === 'Quoted' || b.type === 'Anonymous')) { - return a.compare(b); - } else if (b.compare) { - return -b.compare(a); - } else if (a.type !== b.type) { - return undefined; - } - - a = a.value; - b = b.value; - if (!Array.isArray(a)) { - return a === b ? 0 : undefined; - } - if (a.length !== b.length) { - return undefined; - } - for (var i = 0; i < a.length; i++) { - if (Node.compare(a[i], b[i]) !== 0) { - return undefined; - } - } - return 0; -}; - -Node.numericCompare = function (a, b) { - return a < b ? -1 - : a === b ? 0 - : a > b ? 1 : undefined; -}; -// Returns true if this node represents root of ast imported by reference -Node.prototype.blocksVisibility = function () { - if (this.visibilityBlocks == null) { - this.visibilityBlocks = 0; - } - return this.visibilityBlocks !== 0; -}; -Node.prototype.addVisibilityBlock = function () { - if (this.visibilityBlocks == null) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks + 1; -}; -Node.prototype.removeVisibilityBlock = function () { - if (this.visibilityBlocks == null) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks - 1; -}; -// Turns on node visibility - if called node will be shown in output regardless -// of whether it comes from import by reference or not -Node.prototype.ensureVisibility = function () { - this.nodeVisible = true; -}; -// Turns off node visibility - if called node will NOT be shown in output regardless -// of whether it comes from import by reference or not -Node.prototype.ensureInvisibility = function () { - this.nodeVisible = false; -}; -// return values: -// false - the node must not be visible -// true - the node must be visible -// undefined or null - the node has the same visibility as its parent -Node.prototype.isVisible = function () { - return this.nodeVisible; -}; -Node.prototype.visibilityInfo = function() { - return { - visibilityBlocks: this.visibilityBlocks, - nodeVisible: this.nodeVisible - }; -}; -Node.prototype.copyVisibilityInfo = function(info) { - if (!info) { - return; - } - this.visibilityBlocks = info.visibilityBlocks; - this.nodeVisible = info.nodeVisible; -}; -module.exports = Node; - -},{}],77:[function(require,module,exports){ -var Node = require('./node'), - Color = require('./color'), - Dimension = require('./dimension'), - MATH = require('../math-constants'); - -var Operation = function (op, operands, isSpaced) { - this.op = op.trim(); - this.operands = operands; - this.isSpaced = isSpaced; -}; -Operation.prototype = new Node(); -Operation.prototype.type = 'Operation'; -Operation.prototype.accept = function (visitor) { - this.operands = visitor.visit(this.operands); -}; -Operation.prototype.eval = function (context) { - var a = this.operands[0].eval(context), - b = this.operands[1].eval(context), - op; - - if (context.isMathOn(this.op)) { - op = this.op === './' ? '/' : this.op; - if (a instanceof Dimension && b instanceof Color) { - a = a.toColor(); - } - if (b instanceof Dimension && a instanceof Color) { - b = b.toColor(); - } - if (!a.operate) { - if (a instanceof Operation && a.op === '/' && context.math === MATH.PARENS_DIVISION) { - return new Operation(this.op, [a, b], this.isSpaced); - } - throw { type: 'Operation', - message: 'Operation on an invalid type' }; - } - - return a.operate(context, op, b); - } else { - return new Operation(this.op, [a, b], this.isSpaced); - } -}; -Operation.prototype.genCSS = function (context, output) { - this.operands[0].genCSS(context, output); - if (this.isSpaced) { - output.add(' '); - } - output.add(this.op); - if (this.isSpaced) { - output.add(' '); - } - this.operands[1].genCSS(context, output); -}; - -module.exports = Operation; - -},{"../math-constants":39,"./color":55,"./dimension":62,"./node":76}],78:[function(require,module,exports){ -var Node = require('./node'); - -var Paren = function (node) { - this.value = node; -}; -Paren.prototype = new Node(); -Paren.prototype.type = 'Paren'; -Paren.prototype.genCSS = function (context, output) { - output.add('('); - this.value.genCSS(context, output); - output.add(')'); -}; -Paren.prototype.eval = function (context) { - return new Paren(this.value.eval(context)); -}; -module.exports = Paren; - -},{"./node":76}],79:[function(require,module,exports){ -var Node = require('./node'), - Declaration = require('./declaration'); - -var Property = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; -}; -Property.prototype = new Node(); -Property.prototype.type = 'Property'; -Property.prototype.eval = function (context) { - var property, name = this.name; - // TODO: shorten this reference - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; - - if (this.evaluating) { - throw { type: 'Name', - message: 'Recursive property reference for ' + name, - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - - this.evaluating = true; - - property = this.find(context.frames, function (frame) { - - var v, vArr = frame.property(name); - if (vArr) { - for (var i = 0; i < vArr.length; i++) { - v = vArr[i]; - - vArr[i] = new Declaration(v.name, - v.value, - v.important, - v.merge, - v.index, - v.currentFileInfo, - v.inline, - v.variable - ); - } - mergeRules(vArr); - - v = vArr[vArr.length - 1]; - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - v = v.value.eval(context); - return v; - } - }); - if (property) { - this.evaluating = false; - return property; - } else { - throw { type: 'Name', - message: 'Property \'' + name + '\' is undefined', - filename: this.currentFileInfo.filename, - index: this.index }; - } -}; -Property.prototype.find = function (obj, fun) { - for (var i = 0, r; i < obj.length; i++) { - r = fun.call(obj, obj[i]); - if (r) { return r; } - } - return null; -}; -module.exports = Property; - -},{"./declaration":60,"./node":76}],80:[function(require,module,exports){ -var Node = require('./node'), - Variable = require('./variable'), - Property = require('./property'); - -var Quoted = function (str, content, escaped, index, currentFileInfo) { - this.escaped = (escaped == null) ? true : escaped; - this.value = content || ''; - this.quote = str.charAt(0); - this._index = index; - this._fileInfo = currentFileInfo; - this.variableRegex = /@\{([\w-]+)\}/g; - this.propRegex = /\$\{([\w-]+)\}/g; -}; -Quoted.prototype = new Node(); -Quoted.prototype.type = 'Quoted'; -Quoted.prototype.genCSS = function (context, output) { - if (!this.escaped) { - output.add(this.quote, this.fileInfo(), this.getIndex()); - } - output.add(this.value); - if (!this.escaped) { - output.add(this.quote); - } -}; -Quoted.prototype.containsVariables = function() { - return this.value.match(this.variableRegex); -}; -Quoted.prototype.eval = function (context) { - var that = this, value = this.value; - var variableReplacement = function (_, name) { - var v = new Variable('@' + name, that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - var propertyReplacement = function (_, name) { - var v = new Property('$' + name, that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - function iterativeReplace(value, regexp, replacementFnc) { - var evaluatedValue = value; - do { - value = evaluatedValue; - evaluatedValue = value.replace(regexp, replacementFnc); - } while (value !== evaluatedValue); - return evaluatedValue; - } - value = iterativeReplace(value, this.variableRegex, variableReplacement); - value = iterativeReplace(value, this.propRegex, propertyReplacement); - return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); -}; -Quoted.prototype.compare = function (other) { - // when comparing quoted strings allow the quote to differ - if (other.type === 'Quoted' && !this.escaped && !other.escaped) { - return Node.numericCompare(this.value, other.value); - } else { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - } -}; -module.exports = Quoted; - -},{"./node":76,"./property":79,"./variable":88}],81:[function(require,module,exports){ -var Node = require('./node'), - Declaration = require('./declaration'), - Keyword = require('./keyword'), - Comment = require('./comment'), - Paren = require('./paren'), - Selector = require('./selector'), - Element = require('./element'), - Anonymous = require('./anonymous'), - contexts = require('../contexts'), - globalFunctionRegistry = require('../functions/function-registry'), - defaultFunc = require('../functions/default'), - getDebugInfo = require('./debug-info'), - utils = require('../utils'); - -var Ruleset = function (selectors, rules, strictImports, visibilityInfo) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; - this._variables = null; - this._properties = null; - this.strictImports = strictImports; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - - this.setParent(this.selectors, this); - this.setParent(this.rules, this); - -}; -Ruleset.prototype = new Node(); -Ruleset.prototype.type = 'Ruleset'; -Ruleset.prototype.isRuleset = true; -Ruleset.prototype.isRulesetLike = function() { return true; }; -Ruleset.prototype.accept = function (visitor) { - if (this.paths) { - this.paths = visitor.visitArray(this.paths, true); - } else if (this.selectors) { - this.selectors = visitor.visitArray(this.selectors); - } - if (this.rules && this.rules.length) { - this.rules = visitor.visitArray(this.rules); - } -}; -Ruleset.prototype.eval = function (context) { - var that = this, selectors, selCnt, selector, i, hasVariable, hasOnePassingSelector = false; - - if (this.selectors && (selCnt = this.selectors.length)) { - selectors = new Array(selCnt); - defaultFunc.error({ - type: 'Syntax', - message: 'it is currently only allowed in parametric mixin guards,' - }); - - for (i = 0; i < selCnt; i++) { - selector = this.selectors[i].eval(context); - for (var j = 0; j < selector.elements.length; j++) { - if (selector.elements[j].isVariable) { - hasVariable = true; - break; - } - } - selectors[i] = selector; - if (selector.evaldCondition) { - hasOnePassingSelector = true; - } - } - - if (hasVariable) { - var toParseSelectors = new Array(selCnt); - for (i = 0; i < selCnt; i++) { - selector = selectors[i]; - toParseSelectors[i] = selector.toCSS(context); - } - this.parse.parseNode( - toParseSelectors.join(','), - ["selectors"], - selectors[0].getIndex(), - selectors[0].fileInfo(), - function(err, result) { - if (result) { - selectors = utils.flattenArray(result); - } - }); - } - - defaultFunc.reset(); - } else { - hasOnePassingSelector = true; - } - - var rules = this.rules ? utils.copyArray(this.rules) : null, - ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()), - rule, subRule; - - ruleset.originalRuleset = this; - ruleset.root = this.root; - ruleset.firstRoot = this.firstRoot; - ruleset.allowImports = this.allowImports; - - if (this.debugInfo) { - ruleset.debugInfo = this.debugInfo; - } - - if (!hasOnePassingSelector) { - rules.length = 0; - } - - // inherit a function registry from the frames stack when possible; - // otherwise from the global registry - ruleset.functionRegistry = (function (frames) { - var i = 0, - n = frames.length, - found; - for ( ; i !== n ; ++i ) { - found = frames[ i ].functionRegistry; - if ( found ) { return found; } - } - return globalFunctionRegistry; - }(context.frames)).inherit(); - - // push the current ruleset to the frames stack - var ctxFrames = context.frames; - ctxFrames.unshift(ruleset); - - // currrent selectors - var ctxSelectors = context.selectors; - if (!ctxSelectors) { - context.selectors = ctxSelectors = []; - } - ctxSelectors.unshift(this.selectors); - - // Evaluate imports - if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) { - ruleset.evalImports(context); - } - - // Store the frames around mixin definitions, - // so they can be evaluated like closures when the time comes. - var rsRules = ruleset.rules; - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.evalFirst) { - rsRules[i] = rule.eval(context); - } - } - - var mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0; - - // Evaluate mixin calls. - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.type === 'MixinCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).filter(function(r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope if the variable is - // already there. consider returning false here - // but we need a way to "return" variable from mixins - return !(ruleset.variable(r.name)); - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } else if (rule.type === 'VariableCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).rules.filter(function(r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope at all - return false; - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } - } - - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - if (!rule.evalFirst) { - rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; - } - } - - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - // for rulesets, check if it is a css guard and can be removed - if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) { - // check if it can be folded in (e.g. & where) - if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) { - rsRules.splice(i--, 1); - - for (var j = 0; (subRule = rule.rules[j]); j++) { - if (subRule instanceof Node) { - subRule.copyVisibilityInfo(rule.visibilityInfo()); - if (!(subRule instanceof Declaration) || !subRule.variable) { - rsRules.splice(++i, 0, subRule); - } - } - } - } - } - } - - // Pop the stack - ctxFrames.shift(); - ctxSelectors.shift(); - - if (context.mediaBlocks) { - for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { - context.mediaBlocks[i].bubbleSelectors(selectors); - } - } - - return ruleset; -}; -Ruleset.prototype.evalImports = function(context) { - var rules = this.rules, i, importRules; - if (!rules) { return; } - - for (i = 0; i < rules.length; i++) { - if (rules[i].type === 'Import') { - importRules = rules[i].eval(context); - if (importRules && (importRules.length || importRules.length === 0)) { - rules.splice.apply(rules, [i, 1].concat(importRules)); - i += importRules.length - 1; - } else { - rules.splice(i, 1, importRules); - } - this.resetCache(); - } - } -}; -Ruleset.prototype.makeImportant = function() { - var result = new Ruleset(this.selectors, this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(); - } else { - return r; - } - }), this.strictImports, this.visibilityInfo()); - - return result; -}; -Ruleset.prototype.matchArgs = function (args) { - return !args || args.length === 0; -}; -// lets you call a css selector with a guard -Ruleset.prototype.matchCondition = function (args, context) { - var lastSelector = this.selectors[this.selectors.length - 1]; - if (!lastSelector.evaldCondition) { - return false; - } - if (lastSelector.condition && - !lastSelector.condition.eval( - new contexts.Eval(context, - context.frames))) { - return false; - } - return true; -}; -Ruleset.prototype.resetCache = function () { - this._rulesets = null; - this._variables = null; - this._properties = null; - this._lookups = {}; -}; -Ruleset.prototype.variables = function () { - if (!this._variables) { - this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable === true) { - hash[r.name] = r; - } - // when evaluating variables in an import statement, imports have not been eval'd - // so we need to go inside import statements. - // guard against root being a string (in the case of inlined less) - if (r.type === 'Import' && r.root && r.root.variables) { - var vars = r.root.variables(); - for (var name in vars) { - if (vars.hasOwnProperty(name)) { - hash[name] = r.root.variable(name); - } - } - } - return hash; - }, {}); - } - return this._variables; -}; -Ruleset.prototype.properties = function () { - if (!this._properties) { - this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable !== true) { - var name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ? - r.name[0].value : r.name; - // Properties don't overwrite as they can merge - if (!hash['$' + name]) { - hash['$' + name] = [ r ]; - } - else { - hash['$' + name].push(r); - } - } - return hash; - }, {}); - } - return this._properties; -}; -Ruleset.prototype.variable = function (name) { - var decl = this.variables()[name]; - if (decl) { - return this.parseValue(decl); - } -}; -Ruleset.prototype.property = function (name) { - var decl = this.properties()[name]; - if (decl) { - return this.parseValue(decl); - } -}; -Ruleset.prototype.lastDeclaration = function () { - for (var i = this.rules.length; i > 0; i--) { - var decl = this.rules[i - 1]; - if (decl instanceof Declaration) { - return this.parseValue(decl); - } - } -}; -Ruleset.prototype.parseValue = function(toParse) { - var self = this; - function transformDeclaration(decl) { - if (decl.value instanceof Anonymous && !decl.parsed) { - if (typeof decl.value.value === 'string') { - this.parse.parseNode( - decl.value.value, - ['value', 'important'], - decl.value.getIndex(), - decl.fileInfo(), - function(err, result) { - if (err) { - decl.parsed = true; - } - if (result) { - decl.value = result[0]; - decl.important = result[1] || ''; - decl.parsed = true; - } - }); - } else { - decl.parsed = true; - } - - return decl; - } - else { - return decl; - } - } - if (!Array.isArray(toParse)) { - return transformDeclaration.call(self, toParse); - } - else { - var nodes = []; - toParse.forEach(function(n) { - nodes.push(transformDeclaration.call(self, n)); - }); - return nodes; - } -}; -Ruleset.prototype.rulesets = function () { - if (!this.rules) { return []; } - - var filtRules = [], rules = this.rules, - i, rule; - - for (i = 0; (rule = rules[i]); i++) { - if (rule.isRuleset) { - filtRules.push(rule); - } - } - - return filtRules; -}; -Ruleset.prototype.prependRule = function (rule) { - var rules = this.rules; - if (rules) { - rules.unshift(rule); - } else { - this.rules = [ rule ]; - } - this.setParent(rule, this); -}; -Ruleset.prototype.find = function (selector, self, filter) { - self = self || this; - var rules = [], match, foundMixins, - key = selector.toCSS(); - - if (key in this._lookups) { return this._lookups[key]; } - - this.rulesets().forEach(function (rule) { - if (rule !== self) { - for (var j = 0; j < rule.selectors.length; j++) { - match = selector.match(rule.selectors[j]); - if (match) { - if (selector.elements.length > match) { - if (!filter || filter(rule)) { - foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter); - for (var i = 0; i < foundMixins.length; ++i) { - foundMixins[i].path.push(rule); - } - Array.prototype.push.apply(rules, foundMixins); - } - } else { - rules.push({ rule: rule, path: []}); - } - break; - } - } - } - }); - this._lookups[key] = rules; - return rules; -}; -Ruleset.prototype.genCSS = function (context, output) { - var i, j, - charsetRuleNodes = [], - ruleNodes = [], - debugInfo, // Line number debugging - rule, - path; - - context.tabLevel = (context.tabLevel || 0); - - if (!this.root) { - context.tabLevel++; - } - - var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '), - tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '), - sep; - - var charsetNodeIndex = 0; - var importNodeIndex = 0; - for (i = 0; (rule = this.rules[i]); i++) { - if (rule instanceof Comment) { - if (importNodeIndex === i) { - importNodeIndex++; - } - ruleNodes.push(rule); - } else if (rule.isCharset && rule.isCharset()) { - ruleNodes.splice(charsetNodeIndex, 0, rule); - charsetNodeIndex++; - importNodeIndex++; - } else if (rule.type === 'Import') { - ruleNodes.splice(importNodeIndex, 0, rule); - importNodeIndex++; - } else { - ruleNodes.push(rule); - } - } - ruleNodes = charsetRuleNodes.concat(ruleNodes); - - // If this is the root node, we don't render - // a selector, or {}. - if (!this.root) { - debugInfo = getDebugInfo(context, this, tabSetStr); - - if (debugInfo) { - output.add(debugInfo); - output.add(tabSetStr); - } - - var paths = this.paths, pathCnt = paths.length, - pathSubCnt; - - sep = context.compress ? ',' : (',\n' + tabSetStr); - - for (i = 0; i < pathCnt; i++) { - path = paths[i]; - if (!(pathSubCnt = path.length)) { continue; } - if (i > 0) { output.add(sep); } - - context.firstSelector = true; - path[0].genCSS(context, output); - - context.firstSelector = false; - for (j = 1; j < pathSubCnt; j++) { - path[j].genCSS(context, output); - } - } - - output.add((context.compress ? '{' : ' {\n') + tabRuleStr); - } - - // Compile rules and rulesets - for (i = 0; (rule = ruleNodes[i]); i++) { - - if (i + 1 === ruleNodes.length) { - context.lastRule = true; - } - - var currentLastRule = context.lastRule; - if (rule.isRulesetLike(rule)) { - context.lastRule = false; - } - - if (rule.genCSS) { - rule.genCSS(context, output); - } else if (rule.value) { - output.add(rule.value.toString()); - } - - context.lastRule = currentLastRule; - - if (!context.lastRule && rule.isVisible()) { - output.add(context.compress ? '' : ('\n' + tabRuleStr)); - } else { - context.lastRule = false; - } - } - - if (!this.root) { - output.add((context.compress ? '}' : '\n' + tabSetStr + '}')); - context.tabLevel--; - } - - if (!output.isEmpty() && !context.compress && this.firstRoot) { - output.add('\n'); - } -}; - -Ruleset.prototype.joinSelectors = function (paths, context, selectors) { - for (var s = 0; s < selectors.length; s++) { - this.joinSelector(paths, context, selectors[s]); - } -}; - -Ruleset.prototype.joinSelector = function (paths, context, selector) { - - function createParenthesis(elementsToPak, originalElement) { - var replacementParen, j; - if (elementsToPak.length === 0) { - replacementParen = new Paren(elementsToPak[0]); - } else { - var insideParent = new Array(elementsToPak.length); - for (j = 0; j < elementsToPak.length; j++) { - insideParent[j] = new Element( - null, - elementsToPak[j], - originalElement.isVariable, - originalElement._index, - originalElement._fileInfo - ); - } - replacementParen = new Paren(new Selector(insideParent)); - } - return replacementParen; - } - - function createSelector(containedElement, originalElement) { - var element, selector; - element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); - selector = new Selector([element]); - return selector; - } - - // joins selector path from `beginningPath` with selector path in `addPath` - // `replacedElement` contains element that is being replaced by `addPath` - // returns concatenated path - function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { - var newSelectorPath, lastSelector, newJoinedSelector; - // our new selector path - newSelectorPath = []; - - // construct the joined selector - if & is the first thing this will be empty, - // if not newJoinedSelector will be the last set of elements in the selector - if (beginningPath.length > 0) { - newSelectorPath = utils.copyArray(beginningPath); - lastSelector = newSelectorPath.pop(); - newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements)); - } - else { - newJoinedSelector = originalSelector.createDerived([]); - } - - if (addPath.length > 0) { - // /deep/ is a CSS4 selector - (removed, so should deprecate) - // that is valid without anything in front of it - // so if the & does not have a combinator that is "" or " " then - // and there is a combinator on the parent, then grab that. - // this also allows + a { & .b { .a & { ... though not sure why you would want to do that - var combinator = replacedElement.combinator, parentEl = addPath[0].elements[0]; - if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) { - combinator = parentEl.combinator; - } - // join the elements so far with the first part of the parent - newJoinedSelector.elements.push(new Element( - combinator, - parentEl.value, - replacedElement.isVariable, - replacedElement._index, - replacedElement._fileInfo - )); - newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1)); - } - - // now add the joined selector - but only if it is not empty - if (newJoinedSelector.elements.length !== 0) { - newSelectorPath.push(newJoinedSelector); - } - - // put together the parent selectors after the join (e.g. the rest of the parent) - if (addPath.length > 1) { - var restOfPath = addPath.slice(1); - restOfPath = restOfPath.map(function (selector) { - return selector.createDerived(selector.elements, []); - }); - newSelectorPath = newSelectorPath.concat(restOfPath); - } - return newSelectorPath; - } - - // joins selector path from `beginningPath` with every selector path in `addPaths` array - // `replacedElement` contains element that is being replaced by `addPath` - // returns array with all concatenated paths - function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) { - var j; - for (j = 0; j < beginningPath.length; j++) { - var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); - result.push(newSelectorPath); - } - return result; - } - - function mergeElementsOnToSelectors(elements, selectors) { - var i, sel; - - if (elements.length === 0) { - return ; - } - if (selectors.length === 0) { - selectors.push([ new Selector(elements) ]); - return; - } - - for (i = 0; (sel = selectors[i]); i++) { - // if the previous thing in sel is a parent this needs to join on to it - if (sel.length > 0) { - sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements)); - } - else { - sel.push(new Selector(elements)); - } - } - } - - // replace all parent selectors inside `inSelector` by content of `context` array - // resulting selectors are returned inside `paths` array - // returns true if `inSelector` contained at least one parent selector - function replaceParentSelector(paths, context, inSelector) { - // The paths are [[Selector]] - // The first list is a list of comma separated selectors - // The inner list is a list of inheritance separated selectors - // e.g. - // .a, .b { - // .c { - // } - // } - // == [[.a] [.c]] [[.b] [.c]] - // - var i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector; - function findNestedSelector(element) { - var maybeSelector; - if (!(element.value instanceof Paren)) { - return null; - } - - maybeSelector = element.value.value; - if (!(maybeSelector instanceof Selector)) { - return null; - } - - return maybeSelector; - } - - // the elements from the current selector so far - currentElements = []; - // the current list of new selectors to add to the path. - // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors - // by the parents - newSelectors = [ - [] - ]; - - for (i = 0; (el = inSelector.elements[i]); i++) { - // non parent reference elements just get added - if (el.value !== '&') { - var nestedSelector = findNestedSelector(el); - if (nestedSelector != null) { - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - - var nestedPaths = [], replaced, replacedNewSelectors = []; - replaced = replaceParentSelector(nestedPaths, context, nestedSelector); - hadParentSelector = hadParentSelector || replaced; - // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors - for (k = 0; k < nestedPaths.length; k++) { - var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); - addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); - } - newSelectors = replacedNewSelectors; - currentElements = []; - - } else { - currentElements.push(el); - } - - } else { - hadParentSelector = true; - // the new list of selectors to add - selectorsMultiplied = []; - - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - - // loop through our current selectors - for (j = 0; j < newSelectors.length; j++) { - sel = newSelectors[j]; - // if we don't have any parent paths, the & might be in a mixin so that it can be used - // whether there are parents or not - if (context.length === 0) { - // the combinator used on el should now be applied to the next element instead so that - // it is not lost - if (sel.length > 0) { - sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo)); - } - selectorsMultiplied.push(sel); - } - else { - // and the parent selectors - for (k = 0; k < context.length; k++) { - // We need to put the current selectors - // then join the last selector's elements on to the parents selectors - var newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector); - // add that to our new set of selectors - selectorsMultiplied.push(newSelectorPath); - } - } - } - - // our new selectors has been multiplied, so reset the state - newSelectors = selectorsMultiplied; - currentElements = []; - } - } - - // if we have any elements left over (e.g. .a& .b == .b) - // add them on to all the current selectors - mergeElementsOnToSelectors(currentElements, newSelectors); - - for (i = 0; i < newSelectors.length; i++) { - length = newSelectors[i].length; - if (length > 0) { - paths.push(newSelectors[i]); - lastSelector = newSelectors[i][length - 1]; - newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList); - } - } - - return hadParentSelector; - } - - function deriveSelector(visibilityInfo, deriveFrom) { - var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); - newSelector.copyVisibilityInfo(visibilityInfo); - return newSelector; - } - - // joinSelector code follows - var i, newPaths, hadParentSelector; - - newPaths = []; - hadParentSelector = replaceParentSelector(newPaths, context, selector); - - if (!hadParentSelector) { - if (context.length > 0) { - newPaths = []; - for (i = 0; i < context.length; i++) { - - var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo())); - - concatenated.push(selector); - newPaths.push(concatenated); - } - } - else { - newPaths = [[selector]]; - } - } - - for (i = 0; i < newPaths.length; i++) { - paths.push(newPaths[i]); - } - -}; -module.exports = Ruleset; - -},{"../contexts":12,"../functions/default":24,"../functions/function-registry":26,"../utils":89,"./anonymous":50,"./comment":57,"./debug-info":59,"./declaration":60,"./element":63,"./keyword":70,"./node":76,"./paren":78,"./selector":82}],82:[function(require,module,exports){ -var Node = require('./node'), - Element = require('./element'), - LessError = require('../less-error'); - -var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) { - this.extendList = extendList; - this.condition = condition; - this.evaldCondition = !condition; - this._index = index; - this._fileInfo = currentFileInfo; - this.elements = this.getElements(elements); - this.mixinElements_ = undefined; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.elements, this); -}; -Selector.prototype = new Node(); -Selector.prototype.type = 'Selector'; -Selector.prototype.accept = function (visitor) { - if (this.elements) { - this.elements = visitor.visitArray(this.elements); - } - if (this.extendList) { - this.extendList = visitor.visitArray(this.extendList); - } - if (this.condition) { - this.condition = visitor.visit(this.condition); - } -}; -Selector.prototype.createDerived = function(elements, extendList, evaldCondition) { - elements = this.getElements(elements); - var newSelector = new Selector(elements, extendList || this.extendList, - null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition; - newSelector.mediaEmpty = this.mediaEmpty; - return newSelector; -}; -Selector.prototype.getElements = function(els) { - if (!els) { - return [new Element('', '&', false, this._index, this._fileInfo)]; - } - if (typeof els === 'string') { - this.parse.parseNode( - els, - ['selector'], - this._index, - this._fileInfo, - function(err, result) { - if (err) { - throw new LessError({ - index: err.index, - message: err.message - }, this.parse.imports, this._fileInfo.filename); - } - els = result[0].elements; - }); - } - return els; -}; -Selector.prototype.createEmptySelectors = function() { - var el = new Element('', '&', false, this._index, this._fileInfo), - sels = [new Selector([el], null, null, this._index, this._fileInfo)]; - sels[0].mediaEmpty = true; - return sels; -}; -Selector.prototype.match = function (other) { - var elements = this.elements, - len = elements.length, - olen, i; - - other = other.mixinElements(); - olen = other.length; - if (olen === 0 || len < olen) { - return 0; - } else { - for (i = 0; i < olen; i++) { - if (elements[i].value !== other[i]) { - return 0; - } - } - } - - return olen; // return number of matched elements -}; -Selector.prototype.mixinElements = function() { - if (this.mixinElements_) { - return this.mixinElements_; - } - - var elements = this.elements.map( function(v) { - return v.combinator.value + (v.value.value || v.value); - }).join('').match(/[,&#\*\.\w-]([\w-]|(\\.))*/g); - - if (elements) { - if (elements[0] === '&') { - elements.shift(); - } - } else { - elements = []; - } - - return (this.mixinElements_ = elements); -}; -Selector.prototype.isJustParentSelector = function() { - return !this.mediaEmpty && - this.elements.length === 1 && - this.elements[0].value === '&' && - (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); -}; -Selector.prototype.eval = function (context) { - var evaldCondition = this.condition && this.condition.eval(context), - elements = this.elements, extendList = this.extendList; - - elements = elements && elements.map(function (e) { return e.eval(context); }); - extendList = extendList && extendList.map(function(extend) { return extend.eval(context); }); - - return this.createDerived(elements, extendList, evaldCondition); -}; -Selector.prototype.genCSS = function (context, output) { - var i, element; - if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') { - output.add(' ', this.fileInfo(), this.getIndex()); - } - for (i = 0; i < this.elements.length; i++) { - element = this.elements[i]; - element.genCSS(context, output); - } -}; -Selector.prototype.getIsOutput = function() { - return this.evaldCondition; -}; -module.exports = Selector; - -},{"../less-error":37,"./element":63,"./node":76}],83:[function(require,module,exports){ -var Node = require('./node'); - -var UnicodeDescriptor = function (value) { - this.value = value; -}; -UnicodeDescriptor.prototype = new Node(); -UnicodeDescriptor.prototype.type = 'UnicodeDescriptor'; - -module.exports = UnicodeDescriptor; - -},{"./node":76}],84:[function(require,module,exports){ -var Node = require('./node'), - unitConversions = require('../data/unit-conversions'), - utils = require('../utils'); - -var Unit = function (numerator, denominator, backupUnit) { - this.numerator = numerator ? utils.copyArray(numerator).sort() : []; - this.denominator = denominator ? utils.copyArray(denominator).sort() : []; - if (backupUnit) { - this.backupUnit = backupUnit; - } else if (numerator && numerator.length) { - this.backupUnit = numerator[0]; - } -}; - -Unit.prototype = new Node(); -Unit.prototype.type = 'Unit'; -Unit.prototype.clone = function () { - return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit); -}; -Unit.prototype.genCSS = function (context, output) { - // Dimension checks the unit is singular and throws an error if in strict math mode. - var strictUnits = context && context.strictUnits; - if (this.numerator.length === 1) { - output.add(this.numerator[0]); // the ideal situation - } else if (!strictUnits && this.backupUnit) { - output.add(this.backupUnit); - } else if (!strictUnits && this.denominator.length) { - output.add(this.denominator[0]); - } -}; -Unit.prototype.toString = function () { - var i, returnStr = this.numerator.join('*'); - for (i = 0; i < this.denominator.length; i++) { - returnStr += '/' + this.denominator[i]; - } - return returnStr; -}; -Unit.prototype.compare = function (other) { - return this.is(other.toString()) ? 0 : undefined; -}; -Unit.prototype.is = function (unitString) { - return this.toString().toUpperCase() === unitString.toUpperCase(); -}; -Unit.prototype.isLength = function () { - return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); -}; -Unit.prototype.isEmpty = function () { - return this.numerator.length === 0 && this.denominator.length === 0; -}; -Unit.prototype.isSingular = function() { - return this.numerator.length <= 1 && this.denominator.length === 0; -}; -Unit.prototype.map = function(callback) { - var i; - - for (i = 0; i < this.numerator.length; i++) { - this.numerator[i] = callback(this.numerator[i], false); - } - - for (i = 0; i < this.denominator.length; i++) { - this.denominator[i] = callback(this.denominator[i], true); - } -}; -Unit.prototype.usedUnits = function() { - var group, result = {}, mapUnit, groupName; - - mapUnit = function (atomicUnit) { - /* jshint loopfunc:true */ - if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { - result[groupName] = atomicUnit; - } - - return atomicUnit; - }; - - for (groupName in unitConversions) { - if (unitConversions.hasOwnProperty(groupName)) { - group = unitConversions[groupName]; - - this.map(mapUnit); - } - } - - return result; -}; -Unit.prototype.cancel = function () { - var counter = {}, atomicUnit, i; - - for (i = 0; i < this.numerator.length; i++) { - atomicUnit = this.numerator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) + 1; - } - - for (i = 0; i < this.denominator.length; i++) { - atomicUnit = this.denominator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) - 1; - } - - this.numerator = []; - this.denominator = []; - - for (atomicUnit in counter) { - if (counter.hasOwnProperty(atomicUnit)) { - var count = counter[atomicUnit]; - - if (count > 0) { - for (i = 0; i < count; i++) { - this.numerator.push(atomicUnit); - } - } else if (count < 0) { - for (i = 0; i < -count; i++) { - this.denominator.push(atomicUnit); - } - } - } - } - - this.numerator.sort(); - this.denominator.sort(); -}; -module.exports = Unit; - -},{"../data/unit-conversions":15,"../utils":89,"./node":76}],85:[function(require,module,exports){ -var Node = require('./node'); - -var URL = function (val, index, currentFileInfo, isEvald) { - this.value = val; - this._index = index; - this._fileInfo = currentFileInfo; - this.isEvald = isEvald; -}; -URL.prototype = new Node(); -URL.prototype.type = 'Url'; -URL.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); -}; -URL.prototype.genCSS = function (context, output) { - output.add('url('); - this.value.genCSS(context, output); - output.add(')'); -}; -URL.prototype.eval = function (context) { - var val = this.value.eval(context), - rootpath; - - if (!this.isEvald) { - // Add the base path if the URL is relative - rootpath = this.fileInfo() && this.fileInfo().rootpath; - if (rootpath && - typeof val.value === 'string' && - context.isPathRelative(val.value)) { - - if (!val.quote) { - rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return '\\' + match; }); - } - val.value = rootpath + val.value; - } - - val.value = context.normalizePath(val.value); - - // Add url args if enabled - if (context.urlArgs) { - if (!val.value.match(/^\s*data:/)) { - var delimiter = val.value.indexOf('?') === -1 ? '?' : '&'; - var urlArgs = delimiter + context.urlArgs; - if (val.value.indexOf('#') !== -1) { - val.value = val.value.replace('#', urlArgs + '#'); - } else { - val.value += urlArgs; - } - } - } - } - - return new URL(val, this.getIndex(), this.fileInfo(), true); -}; -module.exports = URL; - -},{"./node":76}],86:[function(require,module,exports){ -var Node = require('./node'); - -var Value = function (value) { - if (!value) { - throw new Error('Value requires an array argument'); - } - if (!Array.isArray(value)) { - this.value = [ value ]; - } - else { - this.value = value; - } -}; -Value.prototype = new Node(); -Value.prototype.type = 'Value'; -Value.prototype.accept = function (visitor) { - if (this.value) { - this.value = visitor.visitArray(this.value); - } -}; -Value.prototype.eval = function (context) { - if (this.value.length === 1) { - return this.value[0].eval(context); - } else { - return new Value(this.value.map(function (v) { - return v.eval(context); - })); - } -}; -Value.prototype.genCSS = function (context, output) { - var i; - for (i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (i + 1 < this.value.length) { - output.add((context && context.compress) ? ',' : ', '); - } - } -}; -module.exports = Value; - -},{"./node":76}],87:[function(require,module,exports){ -var Node = require('./node'), - Variable = require('./variable'), - Ruleset = require('./ruleset'), - DetachedRuleset = require('./detached-ruleset'), - LessError = require('../less-error'); - -var VariableCall = function (variable, index, currentFileInfo) { - this.variable = variable; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; -}; -VariableCall.prototype = new Node(); -VariableCall.prototype.type = 'VariableCall'; -VariableCall.prototype.eval = function (context) { - var rules, detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context), - error = new LessError({message: 'Could not evaluate variable call ' + this.variable}); - - if (!detachedRuleset.ruleset) { - if (Array.isArray(detachedRuleset)) { - rules = detachedRuleset; - } - else if (Array.isArray(detachedRuleset.value)) { - rules = detachedRuleset.value; - } - else { - throw error; - } - detachedRuleset = new DetachedRuleset(new Ruleset('', rules)); - } - if (detachedRuleset.ruleset) { - return detachedRuleset.callEval(context); - } - throw error; -}; -module.exports = VariableCall; - -},{"../less-error":37,"./detached-ruleset":61,"./node":76,"./ruleset":81,"./variable":88}],88:[function(require,module,exports){ -var Node = require('./node'), - Call = require('./call'); - -var Variable = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; -}; -Variable.prototype = new Node(); -Variable.prototype.type = 'Variable'; -Variable.prototype.eval = function (context) { - var variable, name = this.name; - - if (name.indexOf('@@') === 0) { - name = '@' + new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value; - } - - if (this.evaluating) { - throw { type: 'Name', - message: 'Recursive variable definition for ' + name, - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - - this.evaluating = true; - - variable = this.find(context.frames, function (frame) { - var v = frame.variable(name); - if (v) { - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - // If in calc, wrap vars in a function call to cascade evaluate args first - if (context.inCalc) { - return (new Call('_SELF', [v.value])).eval(context); - } - else { - return v.value.eval(context); - } - } - }); - if (variable) { - this.evaluating = false; - return variable; - } else { - throw { type: 'Name', - message: 'variable ' + name + ' is undefined', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } -}; -Variable.prototype.find = function (obj, fun) { - for (var i = 0, r; i < obj.length; i++) { - r = fun.call(obj, obj[i]); - if (r) { return r; } - } - return null; -}; -module.exports = Variable; - -},{"./call":54,"./node":76}],89:[function(require,module,exports){ -/* jshint proto: true */ -var MATH = require('./math-constants'); - -var utils = { - getLocation: function(index, inputStream) { - var n = index + 1, - line = null, - column = -1; - - while (--n >= 0 && inputStream.charAt(n) !== '\n') { - column++; - } - - if (typeof index === 'number') { - line = (inputStream.slice(0, index).match(/\n/g) || '').length; - } - - return { - line: line, - column: column - }; - }, - copyArray: function(arr) { - var i, length = arr.length, - copy = new Array(length); - - for (i = 0; i < length; i++) { - copy[i] = arr[i]; - } - return copy; - }, - clone: function (obj) { - var cloned = {}; - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; - }, - copyOptions: function(obj1, obj2) { - var opts = utils.defaults(obj1, obj2); - if (opts.strictMath) { - opts.math = MATH.STRICT_LEGACY; - } - if (opts.hasOwnProperty('math') && typeof opts.math === 'string') { - switch (opts.math.toLowerCase()) { - case 'always': - opts.math = MATH.ALWAYS; - break; - case 'parens-division': - opts.math = MATH.PARENS_DIVISION; - break; - case 'strict': - case 'parens': - opts.math = MATH.PARENS; - break; - case 'strict-legacy': - opts.math = MATH.STRICT_LEGACY; - } - } - return opts; - }, - defaults: function(obj1, obj2) { - if (!obj2._defaults || obj2._defaults !== obj1) { - for (var prop in obj1) { - if (obj1.hasOwnProperty(prop)) { - if (!obj2.hasOwnProperty(prop)) { - obj2[prop] = obj1[prop]; - } - else if (Array.isArray(obj1[prop]) - && Array.isArray(obj2[prop])) { - - obj1[prop].forEach(function(p) { - if (obj2[prop].indexOf(p) === -1) { - obj2[prop].push(p); - } - }); - } - } - } - } - obj2._defaults = obj1; - return obj2; - }, - merge: function(obj1, obj2) { - for (var prop in obj2) { - if (obj2.hasOwnProperty(prop)) { - obj1[prop] = obj2[prop]; - } - } - return obj1; - }, - flattenArray: function(arr, result) { - result = result || []; - for (var i = 0, length = arr.length; i < length; i++) { - var value = arr[i]; - if (Array.isArray(value)) { - utils.flattenArray(value, result); - } else { - if (value !== undefined) { - result.push(value); - } - } - } - return result; - } -}; - -module.exports = utils; -},{"./math-constants":39}],90:[function(require,module,exports){ -var tree = require('../tree'), - Visitor = require('./visitor'), - logger = require('../logger'), - utils = require('../utils'); - -/* jshint loopfunc:true */ - -var ExtendFinderVisitor = function() { - this._visitor = new Visitor(this); - this.contexts = []; - this.allExtendsStack = [[]]; -}; - -ExtendFinderVisitor.prototype = { - run: function (root) { - root = this._visitor.visit(root); - root.allExtends = this.allExtendsStack[0]; - return root; - }, - visitDeclaration: function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitRuleset: function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - - var i, j, extend, allSelectorsExtendList = [], extendList; - - // get &:extend(.a); rules which apply to all selectors in this ruleset - var rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0; - for (i = 0; i < ruleCnt; i++) { - if (rulesetNode.rules[i] instanceof tree.Extend) { - allSelectorsExtendList.push(rules[i]); - rulesetNode.extendOnEveryPath = true; - } - } - - // now find every selector and apply the extends that apply to all extends - // and the ones which apply to an individual extend - var paths = rulesetNode.paths; - for (i = 0; i < paths.length; i++) { - var selectorPath = paths[i], - selector = selectorPath[selectorPath.length - 1], - selExtendList = selector.extendList; - - extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList) - : allSelectorsExtendList; - - if (extendList) { - extendList = extendList.map(function(allSelectorsExtend) { - return allSelectorsExtend.clone(); - }); - } - - for (j = 0; j < extendList.length; j++) { - this.foundExtends = true; - extend = extendList[j]; - extend.findSelfSelectors(selectorPath); - extend.ruleset = rulesetNode; - if (j === 0) { extend.firstExtendOnThisSelectorPath = true; } - this.allExtendsStack[this.allExtendsStack.length - 1].push(extend); - } - } - - this.contexts.push(rulesetNode.selectors); - }, - visitRulesetOut: function (rulesetNode) { - if (!rulesetNode.root) { - this.contexts.length = this.contexts.length - 1; - } - }, - visitMedia: function (mediaNode, visitArgs) { - mediaNode.allExtends = []; - this.allExtendsStack.push(mediaNode.allExtends); - }, - visitMediaOut: function (mediaNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - }, - visitAtRule: function (atRuleNode, visitArgs) { - atRuleNode.allExtends = []; - this.allExtendsStack.push(atRuleNode.allExtends); - }, - visitAtRuleOut: function (atRuleNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - } -}; - -var ProcessExtendsVisitor = function() { - this._visitor = new Visitor(this); -}; - -ProcessExtendsVisitor.prototype = { - run: function(root) { - var extendFinder = new ExtendFinderVisitor(); - this.extendIndices = {}; - extendFinder.run(root); - if (!extendFinder.foundExtends) { return root; } - root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends)); - this.allExtendsStack = [root.allExtends]; - var newRoot = this._visitor.visit(root); - this.checkExtendsForNonMatched(root.allExtends); - return newRoot; - }, - checkExtendsForNonMatched: function(extendList) { - var indices = this.extendIndices; - extendList.filter(function(extend) { - return !extend.hasFoundMatches && extend.parent_ids.length == 1; - }).forEach(function(extend) { - var selector = '_unknown_'; - try { - selector = extend.selector.toCSS({}); - } - catch (_) {} - - if (!indices[extend.index + ' ' + selector]) { - indices[extend.index + ' ' + selector] = true; - logger.warn('extend \'' + selector + '\' has no matches'); - } - }); - }, - doExtendChaining: function (extendsList, extendsListTarget, iterationCount) { - // - // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering - // and pasting the selector we would do normally, but we are also adding an extend with the same target selector - // this means this new extend can then go and alter other extends - // - // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors - // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already - // processed if we look at each selector at a time, as is done in visitRuleset - - var extendIndex, targetExtendIndex, matches, extendsToAdd = [], newSelector, extendVisitor = this, selectorPath, - extend, targetExtend, newExtend; - - iterationCount = iterationCount || 0; - - // loop through comparing every extend with every target extend. - // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place - // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one - // and the second is the target. - // the separation into two lists allows us to process a subset of chains with a bigger set, as is the - // case when processing media queries - for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) { - for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) { - - extend = extendsList[extendIndex]; - targetExtend = extendsListTarget[targetExtendIndex]; - - // look for circular references - if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; } - - // find a match in the target extends self selector (the bit before :extend) - selectorPath = [targetExtend.selfSelectors[0]]; - matches = extendVisitor.findMatch(extend, selectorPath); - - if (matches.length) { - extend.hasFoundMatches = true; - - // we found a match, so for each self selector.. - extend.selfSelectors.forEach(function(selfSelector) { - var info = targetExtend.visibilityInfo(); - - // process the extend as usual - newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible()); - - // but now we create a new extend from it - newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info); - newExtend.selfSelectors = newSelector; - - // add the extend onto the list of extends for that selector - newSelector[newSelector.length - 1].extendList = [newExtend]; - - // record that we need to add it. - extendsToAdd.push(newExtend); - newExtend.ruleset = targetExtend.ruleset; - - // remember its parents for circular references - newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids); - - // only process the selector once.. if we have :extend(.a,.b) then multiple - // extends will look at the same selector path, so when extending - // we know that any others will be duplicates in terms of what is added to the css - if (targetExtend.firstExtendOnThisSelectorPath) { - newExtend.firstExtendOnThisSelectorPath = true; - targetExtend.ruleset.paths.push(newSelector); - } - }); - } - } - } - - if (extendsToAdd.length) { - // try to detect circular references to stop a stack overflow. - // may no longer be needed. - this.extendChainCount++; - if (iterationCount > 100) { - var selectorOne = '{unable to calculate}'; - var selectorTwo = '{unable to calculate}'; - try { - selectorOne = extendsToAdd[0].selfSelectors[0].toCSS(); - selectorTwo = extendsToAdd[0].selector.toCSS(); - } - catch (e) {} - throw { message: 'extend circular reference detected. One of the circular extends is currently:' + - selectorOne + ':extend(' + selectorTwo + ')'}; - } - - // now process the new extends on the existing rules so that we can handle a extending b extending c extending - // d extending e... - return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1)); - } else { - return extendsToAdd; - } - }, - visitDeclaration: function (ruleNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitSelector: function (selectorNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitRuleset: function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - var matches, pathIndex, extendIndex, allExtends = this.allExtendsStack[this.allExtendsStack.length - 1], - selectorsToAdd = [], extendVisitor = this, selectorPath; - - // look at each selector path in the ruleset, find any extend matches and then copy, find and replace - - for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { - for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { - selectorPath = rulesetNode.paths[pathIndex]; - - // extending extends happens initially, before the main pass - if (rulesetNode.extendOnEveryPath) { continue; } - var extendList = selectorPath[selectorPath.length - 1].extendList; - if (extendList && extendList.length) { continue; } - - matches = this.findMatch(allExtends[extendIndex], selectorPath); - - if (matches.length) { - allExtends[extendIndex].hasFoundMatches = true; - - allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) { - var extendedSelectors; - extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); - selectorsToAdd.push(extendedSelectors); - }); - } - } - } - rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); - }, - findMatch: function (extend, haystackSelectorPath) { - // - // look through the haystack selector path to try and find the needle - extend.selector - // returns an array of selector matches that can then be replaced - // - var haystackSelectorIndex, hackstackSelector, hackstackElementIndex, haystackElement, - targetCombinator, i, - extendVisitor = this, - needleElements = extend.selector.elements, - potentialMatches = [], potentialMatch, matches = []; - - // loop through the haystack elements - for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) { - hackstackSelector = haystackSelectorPath[haystackSelectorIndex]; - - for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) { - - haystackElement = hackstackSelector.elements[hackstackElementIndex]; - - // if we allow elements before our match we can add a potential match every time. otherwise only at the first element. - if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) { - potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, - initialCombinator: haystackElement.combinator}); - } - - for (i = 0; i < potentialMatches.length; i++) { - potentialMatch = potentialMatches[i]; - - // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't - // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to - // work out what the resulting combinator will be - targetCombinator = haystackElement.combinator.value; - if (targetCombinator === '' && hackstackElementIndex === 0) { - targetCombinator = ' '; - } - - // if we don't match, null our match to indicate failure - if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || - (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) { - potentialMatch = null; - } else { - potentialMatch.matched++; - } - - // if we are still valid and have finished, test whether we have elements after and whether these are allowed - if (potentialMatch) { - potentialMatch.finished = potentialMatch.matched === needleElements.length; - if (potentialMatch.finished && - (!extend.allowAfter && - (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) { - potentialMatch = null; - } - } - // if null we remove, if not, we are still valid, so either push as a valid match or continue - if (potentialMatch) { - if (potentialMatch.finished) { - potentialMatch.length = needleElements.length; - potentialMatch.endPathIndex = haystackSelectorIndex; - potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match - potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again - matches.push(potentialMatch); - } - } else { - potentialMatches.splice(i, 1); - i--; - } - } - } - } - return matches; - }, - isElementValuesEqual: function(elementValue1, elementValue2) { - if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') { - return elementValue1 === elementValue2; - } - if (elementValue1 instanceof tree.Attribute) { - if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) { - return false; - } - if (!elementValue1.value || !elementValue2.value) { - if (elementValue1.value || elementValue2.value) { - return false; - } - return true; - } - elementValue1 = elementValue1.value.value || elementValue1.value; - elementValue2 = elementValue2.value.value || elementValue2.value; - return elementValue1 === elementValue2; - } - elementValue1 = elementValue1.value; - elementValue2 = elementValue2.value; - if (elementValue1 instanceof tree.Selector) { - if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) { - return false; - } - for (var i = 0; i < elementValue1.elements.length; i++) { - if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) { - if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) { - return false; - } - } - if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) { - return false; - } - } - return true; - } - return false; - }, - extendSelector:function (matches, selectorPath, replacementSelector, isVisible) { - - // for a set of matches, replace each match with the replacement selector - - var currentSelectorPathIndex = 0, - currentSelectorPathElementIndex = 0, - path = [], - matchIndex, - selector, - firstElement, - match, - newElements; - - for (matchIndex = 0; matchIndex < matches.length; matchIndex++) { - match = matches[matchIndex]; - selector = selectorPath[match.pathIndex]; - firstElement = new tree.Element( - match.initialCombinator, - replacementSelector.elements[0].value, - replacementSelector.elements[0].isVariable, - replacementSelector.elements[0].getIndex(), - replacementSelector.elements[0].fileInfo() - ); - - if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - - newElements = selector.elements - .slice(currentSelectorPathElementIndex, match.index) - .concat([firstElement]) - .concat(replacementSelector.elements.slice(1)); - - if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) { - path[path.length - 1].elements = - path[path.length - 1].elements.concat(newElements); - } else { - path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex)); - - path.push(new tree.Selector( - newElements - )); - } - currentSelectorPathIndex = match.endPathIndex; - currentSelectorPathElementIndex = match.endPathElementIndex; - if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) { - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - } - - if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathIndex++; - } - - path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length)); - path = path.map(function (currentValue) { - // we can re-use elements here, because the visibility property matters only for selectors - var derived = currentValue.createDerived(currentValue.elements); - if (isVisible) { - derived.ensureVisibility(); - } else { - derived.ensureInvisibility(); - } - return derived; - }); - return path; - }, - visitMedia: function (mediaNode, visitArgs) { - var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }, - visitMediaOut: function (mediaNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - }, - visitAtRule: function (atRuleNode, visitArgs) { - var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }, - visitAtRuleOut: function (atRuleNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - } -}; - -module.exports = ProcessExtendsVisitor; - -},{"../logger":38,"../tree":67,"../utils":89,"./visitor":97}],91:[function(require,module,exports){ -function ImportSequencer(onSequencerEmpty) { - this.imports = []; - this.variableImports = []; - this._onSequencerEmpty = onSequencerEmpty; - this._currentDepth = 0; -} - -ImportSequencer.prototype.addImport = function(callback) { - var importSequencer = this, - importItem = { - callback: callback, - args: null, - isReady: false - }; - this.imports.push(importItem); - return function() { - importItem.args = Array.prototype.slice.call(arguments, 0); - importItem.isReady = true; - importSequencer.tryRun(); - }; -}; - -ImportSequencer.prototype.addVariableImport = function(callback) { - this.variableImports.push(callback); -}; - -ImportSequencer.prototype.tryRun = function() { - this._currentDepth++; - try { - while (true) { - while (this.imports.length > 0) { - var importItem = this.imports[0]; - if (!importItem.isReady) { - return; - } - this.imports = this.imports.slice(1); - importItem.callback.apply(null, importItem.args); - } - if (this.variableImports.length === 0) { - break; - } - var variableImport = this.variableImports[0]; - this.variableImports = this.variableImports.slice(1); - variableImport(); - } - } finally { - this._currentDepth--; - } - if (this._currentDepth === 0 && this._onSequencerEmpty) { - this._onSequencerEmpty(); - } -}; - -module.exports = ImportSequencer; - -},{}],92:[function(require,module,exports){ -var contexts = require('../contexts'), - Visitor = require('./visitor'), - ImportSequencer = require('./import-sequencer'), - utils = require('../utils'); - -var ImportVisitor = function(importer, finish) { - - this._visitor = new Visitor(this); - this._importer = importer; - this._finish = finish; - this.context = new contexts.Eval(); - this.importCount = 0; - this.onceFileDetectionMap = {}; - this.recursionDetector = {}; - this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this)); -}; - -ImportVisitor.prototype = { - isReplacing: false, - run: function (root) { - try { - // process the contents - this._visitor.visit(root); - } - catch (e) { - this.error = e; - } - - this.isFinished = true; - this._sequencer.tryRun(); - }, - _onSequencerEmpty: function() { - if (!this.isFinished) { - return; - } - this._finish(this.error); - }, - visitImport: function (importNode, visitArgs) { - var inlineCSS = importNode.options.inline; - - if (!importNode.css || inlineCSS) { - - var context = new contexts.Eval(this.context, utils.copyArray(this.context.frames)); - var importParent = context.frames[0]; - - this.importCount++; - if (importNode.isVariableImport()) { - this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent)); - } else { - this.processImportNode(importNode, context, importParent); - } - } - visitArgs.visitDeeper = false; - }, - processImportNode: function(importNode, context, importParent) { - var evaldImportNode, - inlineCSS = importNode.options.inline; - - try { - evaldImportNode = importNode.evalForImport(context); - } catch (e) { - if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; } - // attempt to eval properly and treat as css - importNode.css = true; - // if that fails, this error will be thrown - importNode.error = e; - } - - if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) { - - if (evaldImportNode.options.multiple) { - context.importMultiple = true; - } - - // try appending if we haven't determined if it is css or not - var tryAppendLessExtension = evaldImportNode.css === undefined; - - for (var i = 0; i < importParent.rules.length; i++) { - if (importParent.rules[i] === importNode) { - importParent.rules[i] = evaldImportNode; - break; - } - } - - var onImported = this.onImported.bind(this, evaldImportNode, context), - sequencedOnImported = this._sequencer.addImport(onImported); - - this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), - evaldImportNode.options, sequencedOnImported); - } else { - this.importCount--; - if (this.isFinished) { - this._sequencer.tryRun(); - } - } - }, - onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { - if (e) { - if (!e.filename) { - e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; - } - this.error = e; - } - - var importVisitor = this, - inlineCSS = importNode.options.inline, - isPlugin = importNode.options.isPlugin, - isOptional = importNode.options.optional, - duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector; - - if (!context.importMultiple) { - if (duplicateImport) { - importNode.skip = true; - } else { - importNode.skip = function() { - if (fullPath in importVisitor.onceFileDetectionMap) { - return true; - } - importVisitor.onceFileDetectionMap[fullPath] = true; - return false; - }; - } - } - - if (!fullPath && isOptional) { - importNode.skip = true; - } - - if (root) { - importNode.root = root; - importNode.importedFilename = fullPath; - - if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) { - importVisitor.recursionDetector[fullPath] = true; - - var oldContext = this.context; - this.context = context; - try { - this._visitor.visit(root); - } catch (e) { - this.error = e; - } - this.context = oldContext; - } - } - - importVisitor.importCount--; - - if (importVisitor.isFinished) { - importVisitor._sequencer.tryRun(); - } - }, - visitDeclaration: function (declNode, visitArgs) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.unshift(declNode); - } else { - visitArgs.visitDeeper = false; - } - }, - visitDeclarationOut: function(declNode) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.shift(); - } - }, - visitAtRule: function (atRuleNode, visitArgs) { - this.context.frames.unshift(atRuleNode); - }, - visitAtRuleOut: function (atRuleNode) { - this.context.frames.shift(); - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - this.context.frames.unshift(mixinDefinitionNode); - }, - visitMixinDefinitionOut: function (mixinDefinitionNode) { - this.context.frames.shift(); - }, - visitRuleset: function (rulesetNode, visitArgs) { - this.context.frames.unshift(rulesetNode); - }, - visitRulesetOut: function (rulesetNode) { - this.context.frames.shift(); - }, - visitMedia: function (mediaNode, visitArgs) { - this.context.frames.unshift(mediaNode.rules[0]); - }, - visitMediaOut: function (mediaNode) { - this.context.frames.shift(); - } -}; -module.exports = ImportVisitor; - -},{"../contexts":12,"../utils":89,"./import-sequencer":91,"./visitor":97}],93:[function(require,module,exports){ -var visitors = { - Visitor: require('./visitor'), - ImportVisitor: require('./import-visitor'), - MarkVisibleSelectorsVisitor: require('./set-tree-visibility-visitor'), - ExtendVisitor: require('./extend-visitor'), - JoinSelectorVisitor: require('./join-selector-visitor'), - ToCSSVisitor: require('./to-css-visitor') -}; - -module.exports = visitors; - -},{"./extend-visitor":90,"./import-visitor":92,"./join-selector-visitor":94,"./set-tree-visibility-visitor":95,"./to-css-visitor":96,"./visitor":97}],94:[function(require,module,exports){ -var Visitor = require('./visitor'); - -var JoinSelectorVisitor = function() { - this.contexts = [[]]; - this._visitor = new Visitor(this); -}; - -JoinSelectorVisitor.prototype = { - run: function (root) { - return this._visitor.visit(root); - }, - visitDeclaration: function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }, - - visitRuleset: function (rulesetNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1], - paths = [], selectors; - - this.contexts.push(paths); - - if (!rulesetNode.root) { - selectors = rulesetNode.selectors; - if (selectors) { - selectors = selectors.filter(function(selector) { return selector.getIsOutput(); }); - rulesetNode.selectors = selectors.length ? selectors : (selectors = null); - if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); } - } - if (!selectors) { rulesetNode.rules = null; } - rulesetNode.paths = paths; - } - }, - visitRulesetOut: function (rulesetNode) { - this.contexts.length = this.contexts.length - 1; - }, - visitMedia: function (mediaNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia); - }, - visitAtRule: function (atRuleNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - if (atRuleNode.rules && atRuleNode.rules.length) { - atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null); - } - } -}; - -module.exports = JoinSelectorVisitor; - -},{"./visitor":97}],95:[function(require,module,exports){ -var SetTreeVisibilityVisitor = function(visible) { - this.visible = visible; -}; -SetTreeVisibilityVisitor.prototype.run = function(root) { - this.visit(root); -}; -SetTreeVisibilityVisitor.prototype.visitArray = function(nodes) { - if (!nodes) { - return nodes; - } - - var cnt = nodes.length, i; - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; -}; -SetTreeVisibilityVisitor.prototype.visit = function(node) { - if (!node) { - return node; - } - if (node.constructor === Array) { - return this.visitArray(node); - } - - if (!node.blocksVisibility || node.blocksVisibility()) { - return node; - } - if (this.visible) { - node.ensureVisibility(); - } else { - node.ensureInvisibility(); - } - - node.accept(this); - return node; -}; -module.exports = SetTreeVisibilityVisitor; -},{}],96:[function(require,module,exports){ -var tree = require('../tree'), - Visitor = require('./visitor'); - -var CSSVisitorUtils = function(context) { - this._visitor = new Visitor(this); - this._context = context; -}; - -CSSVisitorUtils.prototype = { - containsSilentNonBlockedChild: function(bodyRules) { - var rule; - if (!bodyRules) { - return false; - } - for (var r = 0; r < bodyRules.length; r++) { - rule = bodyRules[r]; - if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { - // the atrule contains something that was referenced (likely by extend) - // therefore it needs to be shown in output too - return true; - } - } - return false; - }, - - keepOnlyVisibleChilds: function(owner) { - if (owner && owner.rules) { - owner.rules = owner.rules.filter(function(thing) { - return thing.isVisible(); - }); - } - }, - - isEmpty: function(owner) { - return (owner && owner.rules) - ? (owner.rules.length === 0) : true; - }, - - hasVisibleSelector: function(rulesetNode) { - return (rulesetNode && rulesetNode.paths) - ? (rulesetNode.paths.length > 0) : false; - }, - - resolveVisibility: function (node, originalRules) { - if (!node.blocksVisibility()) { - if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) { - return ; - } - - return node; - } - - var compiledRulesBody = node.rules[0]; - this.keepOnlyVisibleChilds(compiledRulesBody); - - if (this.isEmpty(compiledRulesBody)) { - return ; - } - - node.ensureVisibility(); - node.removeVisibilityBlock(); - - return node; - }, - - isVisibleRuleset: function(rulesetNode) { - if (rulesetNode.firstRoot) { - return true; - } - - if (this.isEmpty(rulesetNode)) { - return false; - } - - if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) { - return false; - } - - return true; - } - -}; - -var ToCSSVisitor = function(context) { - this._visitor = new Visitor(this); - this._context = context; - this.utils = new CSSVisitorUtils(context); -}; - -ToCSSVisitor.prototype = { - isReplacing: true, - run: function (root) { - return this._visitor.visit(root); - }, - - visitDeclaration: function (declNode, visitArgs) { - if (declNode.blocksVisibility() || declNode.variable) { - return; - } - return declNode; - }, - - visitMixinDefinition: function (mixinNode, visitArgs) { - // mixin definitions do not get eval'd - this means they keep state - // so we have to clear that state here so it isn't used if toCSS is called twice - mixinNode.frames = []; - }, - - visitExtend: function (extendNode, visitArgs) { - }, - - visitComment: function (commentNode, visitArgs) { - if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) { - return; - } - return commentNode; - }, - - visitMedia: function(mediaNode, visitArgs) { - var originalRules = mediaNode.rules[0].rules; - mediaNode.accept(this._visitor); - visitArgs.visitDeeper = false; - - return this.utils.resolveVisibility(mediaNode, originalRules); - }, - - visitImport: function (importNode, visitArgs) { - if (importNode.blocksVisibility()) { - return ; - } - return importNode; - }, - - visitAtRule: function(atRuleNode, visitArgs) { - if (atRuleNode.rules && atRuleNode.rules.length) { - return this.visitAtRuleWithBody(atRuleNode, visitArgs); - } else { - return this.visitAtRuleWithoutBody(atRuleNode, visitArgs); - } - }, - - visitAnonymous: function(anonymousNode, visitArgs) { - if (!anonymousNode.blocksVisibility()) { - anonymousNode.accept(this._visitor); - return anonymousNode; - } - }, - - visitAtRuleWithBody: function(atRuleNode, visitArgs) { - // if there is only one nested ruleset and that one has no path, then it is - // just fake ruleset - function hasFakeRuleset(atRuleNode) { - var bodyRules = atRuleNode.rules; - return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); - } - function getBodyRules(atRuleNode) { - var nodeRules = atRuleNode.rules; - if (hasFakeRuleset(atRuleNode)) { - return nodeRules[0].rules; - } - - return nodeRules; - } - // it is still true that it is only one ruleset in array - // this is last such moment - // process childs - var originalRules = getBodyRules(atRuleNode); - atRuleNode.accept(this._visitor); - visitArgs.visitDeeper = false; - - if (!this.utils.isEmpty(atRuleNode)) { - this._mergeRules(atRuleNode.rules[0].rules); - } - - return this.utils.resolveVisibility(atRuleNode, originalRules); - }, - - visitAtRuleWithoutBody: function(atRuleNode, visitArgs) { - if (atRuleNode.blocksVisibility()) { - return; - } - - if (atRuleNode.name === '@charset') { - // Only output the debug info together with subsequent @charset definitions - // a comment (or @media statement) before the actual @charset atrule would - // be considered illegal css as it has to be on the first line - if (this.charset) { - if (atRuleNode.debugInfo) { - var comment = new tree.Comment('/* ' + atRuleNode.toCSS(this._context).replace(/\n/g, '') + ' */\n'); - comment.debugInfo = atRuleNode.debugInfo; - return this._visitor.visit(comment); - } - return; - } - this.charset = true; - } - - return atRuleNode; - }, - - checkValidNodes: function(rules, isRoot) { - if (!rules) { - return; - } - - for (var i = 0; i < rules.length; i++) { - var ruleNode = rules[i]; - if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) { - throw { message: 'Properties must be inside selector blocks. They cannot be in the root', - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename}; - } - if (ruleNode instanceof tree.Call) { - throw { message: 'Function \'' + ruleNode.name + '\' is undefined', - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename}; - } - if (ruleNode.type && !ruleNode.allowRoot) { - throw { message: ruleNode.type + ' node returned by a function is not valid here', - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename}; - } - } - }, - - visitRuleset: function (rulesetNode, visitArgs) { - // at this point rulesets are nested into each other - var rule, rulesets = []; - - this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); - - if (!rulesetNode.root) { - // remove invisible paths - this._compileRulesetPaths(rulesetNode); - - // remove rulesets from this ruleset body and compile them separately - var nodeRules = rulesetNode.rules, nodeRuleCnt = nodeRules ? nodeRules.length : 0; - for (var i = 0; i < nodeRuleCnt; ) { - rule = nodeRules[i]; - if (rule && rule.rules) { - // visit because we are moving them out from being a child - rulesets.push(this._visitor.visit(rule)); - nodeRules.splice(i, 1); - nodeRuleCnt--; - continue; - } - i++; - } - // accept the visitor to remove rules and refactor itself - // then we can decide nogw whether we want it or not - // compile body - if (nodeRuleCnt > 0) { - rulesetNode.accept(this._visitor); - } else { - rulesetNode.rules = null; - } - visitArgs.visitDeeper = false; - - } else { // if (! rulesetNode.root) { - rulesetNode.accept(this._visitor); - visitArgs.visitDeeper = false; - } - - if (rulesetNode.rules) { - this._mergeRules(rulesetNode.rules); - this._removeDuplicateRules(rulesetNode.rules); - } - - // now decide whether we keep the ruleset - if (this.utils.isVisibleRuleset(rulesetNode)) { - rulesetNode.ensureVisibility(); - rulesets.splice(0, 0, rulesetNode); - } - - if (rulesets.length === 1) { - return rulesets[0]; - } - return rulesets; - }, - - _compileRulesetPaths: function(rulesetNode) { - if (rulesetNode.paths) { - rulesetNode.paths = rulesetNode.paths - .filter(function(p) { - var i; - if (p[0].elements[0].combinator.value === ' ') { - p[0].elements[0].combinator = new(tree.Combinator)(''); - } - for (i = 0; i < p.length; i++) { - if (p[i].isVisible() && p[i].getIsOutput()) { - return true; - } - } - return false; - }); - } - }, - - _removeDuplicateRules: function(rules) { - if (!rules) { return; } - - // remove duplicates - var ruleCache = {}, - ruleList, rule, i; - - for (i = rules.length - 1; i >= 0 ; i--) { - rule = rules[i]; - if (rule instanceof tree.Declaration) { - if (!ruleCache[rule.name]) { - ruleCache[rule.name] = rule; - } else { - ruleList = ruleCache[rule.name]; - if (ruleList instanceof tree.Declaration) { - ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; - } - var ruleCSS = rule.toCSS(this._context); - if (ruleList.indexOf(ruleCSS) !== -1) { - rules.splice(i, 1); - } else { - ruleList.push(ruleCSS); - } - } - } - } - }, - - _mergeRules: function(rules) { - if (!rules) { - return; - } - - var groups = {}, - groupsArr = []; - - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (rule.merge) { - var key = rule.name; - groups[key] ? rules.splice(i--, 1) : - groupsArr.push(groups[key] = []); - groups[key].push(rule); - } - } - - groupsArr.forEach(function(group) { - if (group.length > 0) { - var result = group[0], - space = [], - comma = [new tree.Expression(space)]; - group.forEach(function(rule) { - if ((rule.merge === '+') && (space.length > 0)) { - comma.push(new tree.Expression(space = [])); - } - space.push(rule.value); - result.important = result.important || rule.important; - }); - result.value = new tree.Value(comma); - } - }); - } -}; - -module.exports = ToCSSVisitor; - -},{"../tree":67,"./visitor":97}],97:[function(require,module,exports){ -var tree = require('../tree'); - -var _visitArgs = { visitDeeper: true }, - _hasIndexed = false; - -function _noop(node) { - return node; -} - -function indexNodeTypes(parent, ticker) { - // add .typeIndex to tree node types for lookup table - var key, child; - for (key in parent) { - /* eslint guard-for-in: 0 */ - child = parent[key]; - switch (typeof child) { - case 'function': - // ignore bound functions directly on tree which do not have a prototype - // or aren't nodes - if (child.prototype && child.prototype.type) { - child.prototype.typeIndex = ticker++; - } - break; - case 'object': - ticker = indexNodeTypes(child, ticker); - break; - - } - } - return ticker; -} - -var Visitor = function(implementation) { - this._implementation = implementation; - this._visitInCache = {}; - this._visitOutCache = {}; - - if (!_hasIndexed) { - indexNodeTypes(tree, 1); - _hasIndexed = true; - } -}; - -Visitor.prototype = { - visit: function(node) { - if (!node) { - return node; - } - - var nodeTypeIndex = node.typeIndex; - if (!nodeTypeIndex) { - // MixinCall args aren't a node type? - if (node.value && node.value.typeIndex) { - this.visit(node.value); - } - return node; - } - - var impl = this._implementation, - func = this._visitInCache[nodeTypeIndex], - funcOut = this._visitOutCache[nodeTypeIndex], - visitArgs = _visitArgs, - fnName; - - visitArgs.visitDeeper = true; - - if (!func) { - fnName = 'visit' + node.type; - func = impl[fnName] || _noop; - funcOut = impl[fnName + 'Out'] || _noop; - this._visitInCache[nodeTypeIndex] = func; - this._visitOutCache[nodeTypeIndex] = funcOut; - } - - if (func !== _noop) { - var newNode = func.call(impl, node, visitArgs); - if (node && impl.isReplacing) { - node = newNode; - } - } - - if (visitArgs.visitDeeper && node && node.accept) { - node.accept(this); - } - - if (funcOut != _noop) { - funcOut.call(impl, node); - } - - return node; - }, - visitArray: function(nodes, nonReplacing) { - if (!nodes) { - return nodes; - } - - var cnt = nodes.length, i; - - // Non-replacing - if (nonReplacing || !this._implementation.isReplacing) { - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; - } - - // Replacing - var out = []; - for (i = 0; i < cnt; i++) { - var evald = this.visit(nodes[i]); - if (evald === undefined) { continue; } - if (!evald.splice) { - out.push(evald); - } else if (evald.length) { - this.flatten(evald, out); - } - } - return out; - }, - flatten: function(arr, out) { - if (!out) { - out = []; - } - - var cnt, i, item, - nestedCnt, j, nestedItem; - - for (i = 0, cnt = arr.length; i < cnt; i++) { - item = arr[i]; - if (item === undefined) { - continue; - } - if (!item.splice) { - out.push(item); - continue; - } - - for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) { - nestedItem = item[j]; - if (nestedItem === undefined) { - continue; - } - if (!nestedItem.splice) { - out.push(nestedItem); - } else if (nestedItem.length) { - this.flatten(nestedItem, out); - } - } - } - - return out; - } -}; -module.exports = Visitor; - -},{"../tree":67}],98:[function(require,module,exports){ -"use strict"; - -// rawAsap provides everything we need except exception management. -var rawAsap = require("./raw"); -// RawTasks are recycled to reduce GC churn. -var freeTasks = []; -// We queue errors to ensure they are thrown in right order (FIFO). -// Array-as-queue is good enough here, since we are just dealing with exceptions. -var pendingErrors = []; -var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError); - -function throwFirstError() { - if (pendingErrors.length) { - throw pendingErrors.shift(); - } -} - -/** - * Calls a task as soon as possible after returning, in its own event, with priority - * over other events like animation, reflow, and repaint. An error thrown from an - * event will not interrupt, nor even substantially slow down the processing of - * other events, but will be rather postponed to a lower priority event. - * @param {{call}} task A callable object, typically a function that takes no - * arguments. - */ -module.exports = asap; -function asap(task) { - var rawTask; - if (freeTasks.length) { - rawTask = freeTasks.pop(); - } else { - rawTask = new RawTask(); - } - rawTask.task = task; - rawAsap(rawTask); -} - -// We wrap tasks with recyclable task objects. A task object implements -// `call`, just like a function. -function RawTask() { - this.task = null; -} - -// The sole purpose of wrapping the task is to catch the exception and recycle -// the task object after its single use. -RawTask.prototype.call = function () { - try { - this.task.call(); - } catch (error) { - if (asap.onerror) { - // This hook exists purely for testing purposes. - // Its name will be periodically randomized to break any code that - // depends on its existence. - asap.onerror(error); - } else { - // In a web browser, exceptions are not fatal. However, to avoid - // slowing down the queue of pending tasks, we rethrow the error in a - // lower priority turn. - pendingErrors.push(error); - requestErrorThrow(); - } - } finally { - this.task = null; - freeTasks[freeTasks.length] = this; - } -}; - -},{"./raw":99}],99:[function(require,module,exports){ -(function (global){ -"use strict"; - -// Use the fastest means possible to execute a task in its own turn, with -// priority over other events including IO, animation, reflow, and redraw -// events in browsers. -// -// An exception thrown by a task will permanently interrupt the processing of -// subsequent tasks. The higher level `asap` function ensures that if an -// exception is thrown by a task, that the task queue will continue flushing as -// soon as possible, but if you use `rawAsap` directly, you are responsible to -// either ensure that no exceptions are thrown from your task, or to manually -// call `rawAsap.requestFlush` if an exception is thrown. -module.exports = rawAsap; -function rawAsap(task) { - if (!queue.length) { - requestFlush(); - flushing = true; - } - // Equivalent to push, but avoids a function call. - queue[queue.length] = task; -} - -var queue = []; -// Once a flush has been requested, no further calls to `requestFlush` are -// necessary until the next `flush` completes. -var flushing = false; -// `requestFlush` is an implementation-specific method that attempts to kick -// off a `flush` event as quickly as possible. `flush` will attempt to exhaust -// the event queue before yielding to the browser's own event loop. -var requestFlush; -// The position of the next task to execute in the task queue. This is -// preserved between calls to `flush` so that it can be resumed if -// a task throws an exception. -var index = 0; -// If a task schedules additional tasks recursively, the task queue can grow -// unbounded. To prevent memory exhaustion, the task queue will periodically -// truncate already-completed tasks. -var capacity = 1024; - -// The flush function processes all tasks that have been scheduled with -// `rawAsap` unless and until one of those tasks throws an exception. -// If a task throws an exception, `flush` ensures that its state will remain -// consistent and will resume where it left off when called again. -// However, `flush` does not make any arrangements to be called again if an -// exception is thrown. -function flush() { - while (index < queue.length) { - var currentIndex = index; - // Advance the index before calling the task. This ensures that we will - // begin flushing on the next task the task throws an error. - index = index + 1; - queue[currentIndex].call(); - // Prevent leaking memory for long chains of recursive calls to `asap`. - // If we call `asap` within tasks scheduled by `asap`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; - } - queue.length -= index; - index = 0; - } - } - queue.length = 0; - index = 0; - flushing = false; -} - -// `requestFlush` is implemented using a strategy based on data collected from -// every available SauceLabs Selenium web driver worker at time of writing. -// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 - -// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that -// have WebKitMutationObserver but not un-prefixed MutationObserver. -// Must use `global` or `self` instead of `window` to work in both frames and web -// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. - -/* globals self */ -var scope = typeof global !== "undefined" ? global : self; -var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; - -// MutationObservers are desirable because they have high priority and work -// reliably everywhere they are implemented. -// They are implemented in all modern browsers. -// -// - Android 4-4.3 -// - Chrome 26-34 -// - Firefox 14-29 -// - Internet Explorer 11 -// - iPad Safari 6-7.1 -// - iPhone Safari 7-7.1 -// - Safari 6-7 -if (typeof BrowserMutationObserver === "function") { - requestFlush = makeRequestCallFromMutationObserver(flush); - -// MessageChannels are desirable because they give direct access to the HTML -// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera -// 11-12, and in web workers in many engines. -// Although message channels yield to any queued rendering and IO tasks, they -// would be better than imposing the 4ms delay of timers. -// However, they do not work reliably in Internet Explorer or Safari. - -// Internet Explorer 10 is the only browser that has setImmediate but does -// not have MutationObservers. -// Although setImmediate yields to the browser's renderer, it would be -// preferrable to falling back to setTimeout since it does not have -// the minimum 4ms penalty. -// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and -// Desktop to a lesser extent) that renders both setImmediate and -// MessageChannel useless for the purposes of ASAP. -// https://github.com/kriskowal/q/issues/396 - -// Timers are implemented universally. -// We fall back to timers in workers in most engines, and in foreground -// contexts in the following browsers. -// However, note that even this simple case requires nuances to operate in a -// broad spectrum of browsers. -// -// - Firefox 3-13 -// - Internet Explorer 6-9 -// - iPad Safari 4.3 -// - Lynx 2.8.7 -} else { - requestFlush = makeRequestCallFromTimer(flush); -} - -// `requestFlush` requests that the high priority event queue be flushed as -// soon as possible. -// This is useful to prevent an error thrown in a task from stalling the event -// queue if the exception handled by Node.js’s -// `process.on("uncaughtException")` or by a domain. -rawAsap.requestFlush = requestFlush; - -// To request a high priority event, we induce a mutation observer by toggling -// the text of a text node between "1" and "-1". -function makeRequestCallFromMutationObserver(callback) { - var toggle = 1; - var observer = new BrowserMutationObserver(callback); - var node = document.createTextNode(""); - observer.observe(node, {characterData: true}); - return function requestCall() { - toggle = -toggle; - node.data = toggle; - }; -} - -// The message channel technique was discovered by Malte Ubl and was the -// original foundation for this library. -// http://www.nonblocking.io/2011/06/windownexttick.html - -// Safari 6.0.5 (at least) intermittently fails to create message ports on a -// page's first load. Thankfully, this version of Safari supports -// MutationObservers, so we don't need to fall back in that case. - -// function makeRequestCallFromMessageChannel(callback) { -// var channel = new MessageChannel(); -// channel.port1.onmessage = callback; -// return function requestCall() { -// channel.port2.postMessage(0); -// }; -// } - -// For reasons explained above, we are also unable to use `setImmediate` -// under any circumstances. -// Even if we were, there is another bug in Internet Explorer 10. -// It is not sufficient to assign `setImmediate` to `requestFlush` because -// `setImmediate` must be called *by name* and therefore must be wrapped in a -// closure. -// Never forget. - -// function makeRequestCallFromSetImmediate(callback) { -// return function requestCall() { -// setImmediate(callback); -// }; -// } - -// Safari 6.0 has a problem where timers will get lost while the user is -// scrolling. This problem does not impact ASAP because Safari 6.0 supports -// mutation observers, so that implementation is used instead. -// However, if we ever elect to use timers in Safari, the prevalent work-around -// is to add a scroll event listener that calls for a flush. - -// `setTimeout` does not call the passed callback if the delay is less than -// approximately 7 in web workers in Firefox 8 through 18, and sometimes not -// even then. - -function makeRequestCallFromTimer(callback) { - return function requestCall() { - // We dispatch a timeout with a specified delay of 0 for engines that - // can reliably accommodate that request. This will usually be snapped - // to a 4 milisecond delay, but once we're flushing, there's no delay - // between events. - var timeoutHandle = setTimeout(handleTimer, 0); - // However, since this timer gets frequently dropped in Firefox - // workers, we enlist an interval handle that will try to fire - // an event 20 times per second until it succeeds. - var intervalHandle = setInterval(handleTimer, 50); - - function handleTimer() { - // Whichever timer succeeds will cancel both timers and - // execute the callback. - clearTimeout(timeoutHandle); - clearInterval(intervalHandle); - callback(); - } - }; -} - -// This is for `asap.js` only. -// Its name will be periodically randomized to break any code that depends on -// its existence. -rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; - -// ASAP was originally a nextTick shim included in Q. This was factored out -// into this ASAP package. It was later adapted to RSVP which made further -// amendments. These decisions, particularly to marginalize MessageChannel and -// to capture the MutationObserver implementation in a closure, were integrated -// back into ASAP proper. -// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],100:[function(require,module,exports){ -'use strict'; - -var asap = require('asap/raw'); - -function noop() {} - -// States: -// -// 0 - pending -// 1 - fulfilled with _value -// 2 - rejected with _value -// 3 - adopted the state of another promise, _value -// -// once the state is no longer pending (0) it is immutable - -// All `_` prefixed properties will be reduced to `_{random number}` -// at build time to obfuscate them and discourage their use. -// We don't use symbols or Object.defineProperty to fully hide them -// because the performance isn't good enough. - - -// to avoid using try/catch inside critical functions, we -// extract them to here. -var LAST_ERROR = null; -var IS_ERROR = {}; -function getThen(obj) { - try { - return obj.then; - } catch (ex) { - LAST_ERROR = ex; - return IS_ERROR; - } -} - -function tryCallOne(fn, a) { - try { - return fn(a); - } catch (ex) { - LAST_ERROR = ex; - return IS_ERROR; - } -} -function tryCallTwo(fn, a, b) { - try { - fn(a, b); - } catch (ex) { - LAST_ERROR = ex; - return IS_ERROR; - } -} - -module.exports = Promise; - -function Promise(fn) { - if (typeof this !== 'object') { - throw new TypeError('Promises must be constructed via new'); - } - if (typeof fn !== 'function') { - throw new TypeError('Promise constructor\'s argument is not a function'); - } - this._40 = 0; - this._65 = 0; - this._55 = null; - this._72 = null; - if (fn === noop) return; - doResolve(fn, this); -} -Promise._37 = null; -Promise._87 = null; -Promise._61 = noop; - -Promise.prototype.then = function(onFulfilled, onRejected) { - if (this.constructor !== Promise) { - return safeThen(this, onFulfilled, onRejected); - } - var res = new Promise(noop); - handle(this, new Handler(onFulfilled, onRejected, res)); - return res; -}; - -function safeThen(self, onFulfilled, onRejected) { - return new self.constructor(function (resolve, reject) { - var res = new Promise(noop); - res.then(resolve, reject); - handle(self, new Handler(onFulfilled, onRejected, res)); - }); -} -function handle(self, deferred) { - while (self._65 === 3) { - self = self._55; - } - if (Promise._37) { - Promise._37(self); - } - if (self._65 === 0) { - if (self._40 === 0) { - self._40 = 1; - self._72 = deferred; - return; - } - if (self._40 === 1) { - self._40 = 2; - self._72 = [self._72, deferred]; - return; - } - self._72.push(deferred); - return; - } - handleResolved(self, deferred); -} - -function handleResolved(self, deferred) { - asap(function() { - var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - if (self._65 === 1) { - resolve(deferred.promise, self._55); - } else { - reject(deferred.promise, self._55); - } - return; - } - var ret = tryCallOne(cb, self._55); - if (ret === IS_ERROR) { - reject(deferred.promise, LAST_ERROR); - } else { - resolve(deferred.promise, ret); - } - }); -} -function resolve(self, newValue) { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) { - return reject( - self, - new TypeError('A promise cannot be resolved with itself.') - ); - } - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = getThen(newValue); - if (then === IS_ERROR) { - return reject(self, LAST_ERROR); - } - if ( - then === self.then && - newValue instanceof Promise - ) { - self._65 = 3; - self._55 = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(then.bind(newValue), self); - return; - } - } - self._65 = 1; - self._55 = newValue; - finale(self); -} - -function reject(self, newValue) { - self._65 = 2; - self._55 = newValue; - if (Promise._87) { - Promise._87(self, newValue); - } - finale(self); -} -function finale(self) { - if (self._40 === 1) { - handle(self, self._72); - self._72 = null; - } - if (self._40 === 2) { - for (var i = 0; i < self._72.length; i++) { - handle(self, self._72[i]); - } - self._72 = null; - } -} - -function Handler(onFulfilled, onRejected, promise){ - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; -} - -/** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ -function doResolve(fn, promise) { - var done = false; - var res = tryCallTwo(fn, function (value) { - if (done) return; - done = true; - resolve(promise, value); - }, function (reason) { - if (done) return; - done = true; - reject(promise, reason); - }); - if (!done && res === IS_ERROR) { - done = true; - reject(promise, LAST_ERROR); - } -} - -},{"asap/raw":99}],101:[function(require,module,exports){ -'use strict'; - -//This file contains the ES6 extensions to the core Promises/A+ API - -var Promise = require('./core.js'); - -module.exports = Promise; - -/* Static Functions */ - -var TRUE = valuePromise(true); -var FALSE = valuePromise(false); -var NULL = valuePromise(null); -var UNDEFINED = valuePromise(undefined); -var ZERO = valuePromise(0); -var EMPTYSTRING = valuePromise(''); - -function valuePromise(value) { - var p = new Promise(Promise._61); - p._65 = 1; - p._55 = value; - return p; -} -Promise.resolve = function (value) { - if (value instanceof Promise) return value; - - if (value === null) return NULL; - if (value === undefined) return UNDEFINED; - if (value === true) return TRUE; - if (value === false) return FALSE; - if (value === 0) return ZERO; - if (value === '') return EMPTYSTRING; - - if (typeof value === 'object' || typeof value === 'function') { - try { - var then = value.then; - if (typeof then === 'function') { - return new Promise(then.bind(value)); - } - } catch (ex) { - return new Promise(function (resolve, reject) { - reject(ex); - }); - } - } - return valuePromise(value); -}; - -Promise.all = function (arr) { - var args = Array.prototype.slice.call(arr); - - return new Promise(function (resolve, reject) { - if (args.length === 0) return resolve([]); - var remaining = args.length; - function res(i, val) { - if (val && (typeof val === 'object' || typeof val === 'function')) { - if (val instanceof Promise && val.then === Promise.prototype.then) { - while (val._65 === 3) { - val = val._55; - } - if (val._65 === 1) return res(i, val._55); - if (val._65 === 2) reject(val._55); - val.then(function (val) { - res(i, val); - }, reject); - return; - } else { - var then = val.then; - if (typeof then === 'function') { - var p = new Promise(then.bind(val)); - p.then(function (val) { - res(i, val); - }, reject); - return; - } - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); -}; - -Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); -}; - -Promise.race = function (values) { - return new Promise(function (resolve, reject) { - values.forEach(function(value){ - Promise.resolve(value).then(resolve, reject); - }); - }); -}; - -/* Prototype Methods */ - -Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); -}; - -},{"./core.js":100}],102:[function(require,module,exports){ -// should work in any browser without browserify - -if (typeof Promise.prototype.done !== 'function') { - Promise.prototype.done = function (onFulfilled, onRejected) { - var self = arguments.length ? this.then.apply(this, arguments) : this - self.then(null, function (err) { - setTimeout(function () { - throw err - }, 0) - }) - } -} -},{}],103:[function(require,module,exports){ -// not "use strict" so we can declare global "Promise" - -var asap = require('asap'); - -if (typeof Promise === 'undefined') { - Promise = require('./lib/core.js') - require('./lib/es6-extensions.js') -} - -require('./polyfill-done.js'); - -},{"./lib/core.js":100,"./lib/es6-extensions.js":101,"./polyfill-done.js":102,"asap":98}]},{},[2])(2) -}); \ No newline at end of file diff --git a/bibli/less.min.js b/bibli/less.min.js deleted file mode 100755 index 03df8e6..0000000 --- a/bibli/less.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Less - Leaner CSS v3.7.1 - * http://lesscss.org - * - * Copyright (c) 2009-2018, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - */ - - /** * @license Apache-2.0 - */ - -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":11}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill");var e=a("../less/default-options")();if(window.less)for(key in window.less)window.less.hasOwnProperty(key)&&(e[key]=window.less[key]);a("./add-default-options")(window,e),e.plugins=e.plugins||[],window.LESS_PLUGINS&&(e.plugins=e.plugins.concat(window.LESS_PLUGINS));var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"../less/default-options":16,"./add-default-options":1,"./index":8,"promise/polyfill":103}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":11}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},g=g||"{}",f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&JSON.stringify(c)===g)return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.line&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||c.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f,i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.line&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+=" on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":11}],6:[function(a,b,c){b.exports=function(b,c){var d=a("../less/environment/abstract-file-manager.js"),e={},f=function(){};return f.prototype=new d,f.prototype.alwaysMakePathsAbsolute=function(){return!0},f.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},f.prototype.doXHR=function(a,d,e,f){function g(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var h=new XMLHttpRequest,i=!b.isFileProtocol||b.fileAsync;"function"==typeof h.overrideMimeType&&h.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),h.open("GET",a,i),h.setRequestHeader("Accept",d||"text/x-less, text/css; q=0.9, */*; q=0.5"),h.send(null),b.isFileProtocol&&!b.fileAsync?0===h.status||h.status>=200&&h.status<300?e(h.responseText):f(h.status,a):i?h.onreadystatechange=function(){4==h.readyState&&g(h,e,f)}:g(h,e,f)},f.prototype.supports=function(a,b,c,d){return!0},f.prototype.clearFileCache=function(){e={}},f.prototype.loadFile=function(a,b,c,d){b&&!this.isPathAbsolute(a)&&(a=b+a),a=c.ext?this.tryAppendExtension(a,c.ext):a,c=c||{};var f=this.extractUrlParts(a,window.location.href),g=f.url,h=this;return new Promise(function(a,b){if(c.useFileCache&&e[g])try{var d=e[g];return a({contents:d,filename:g,webInfo:{lastModified:new Date}})}catch(f){return b({filename:g,message:"Error loading file "+g+" error was "+f.message})}h.doXHR(g,c.mime,function(b,c){e[g]=b,a({contents:b,filename:g,webInfo:{lastModified:c}})},function(a,c){b({type:"File",message:"'"+c+"' wasn't found ("+a+")",href:g})})})},f}},{"../less/environment/abstract-file-manager.js":17}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":26}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){return JSON.parse(JSON.stringify(a||{}))}function g(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function h(a){for(var b,d=l.getElementsByTagName("style"),e=0;e=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;ge.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},d.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/|#)/i.test(a)},d.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{"./math-constants":39}],13:[function(a,b,c){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],14:[function(a,b,c){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":13,"./unit-conversions":15}],15:[function(a,b,c){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],16:[function(a,b,c){b.exports=function(){return{javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",relativeUrls:!1,ieCompat:!1,math:0,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""}}},{}],17:[function(a,b,c){var d=function(){};d.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;cparseInt(b[c])?-1:1;return 0},f.prototype.versionToString=function(a){for(var b="",c=0;c=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":38}],20:[function(a,b,c){var d=a("./function-registry"),e=a("../tree/anonymous"),f=a("../tree/keyword");d.addMultiple({"boolean":function(a){return a?f.True:f.False},"if":function(a,b,c){return a?b:c||new e}})},{"../tree/anonymous":50,"../tree/keyword":70,"./function-registry":26}],21:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":55,"./function-registry":26}],22:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=h.rgba(255,255,255,1)),"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:f(d),a.luma()=v&&this.context.ieCompat!==!1?(h.warn("Skipped data-uri embedding of "+j+" because its size ("+u.length+" characters) exceeds IE8-safe "+v+" characters!"),g(this,f||a)):new d(new c('"'+u+'"',u,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":38,"../tree/quoted":80,"../tree/url":85,"../utils":89,"./function-registry":26}],24:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":70,"./function-registry":26}],25:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":64}],26:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},getLocalFunctions:function(){return this._data},inherit:function(){return d(this)},create:function(a){return d(a)}}}b.exports=d(null)},{}],27:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./boolean"),a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./list"), -a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./boolean":20,"./color":22,"./color-blending":21,"./data-uri":23,"./default":24,"./function-caller":25,"./function-registry":26,"./list":28,"./math":30,"./number":31,"./string":32,"./svg":33,"./types":34}],28:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/declaration"),f=a("../tree/ruleset"),g=a("../tree/selector"),h=a("../tree/element"),i=a("./function-registry"),j=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};i.addMultiple({_SELF:function(a){return a},extract:function(a,b){return b=b.value-1,j(a)[b]},length:function(a){return new d(j(a).length)},each:function(a,b){var c,i,j=0,k=[];i=a.value?Array.isArray(a.value)?a.value:[a.value]:a.ruleset?a.ruleset.rules:Array.isArray(a)?a:[a];var l="@value",m="@key",n="@index";return b.params?(l=b.params[0]&&b.params[0].name,m=b.params[1]&&b.params[1].name,n=b.params[2]&&b.params[2].name,b=b.rules):b=b.ruleset,i.forEach(function(a){j+=1;var i,o;a instanceof e?(i="string"==typeof a.name?a.name:a.name[0].value,o=a.value):(i=new d(j),o=a),c=b.rules.slice(0),l&&c.push(new e(l,o,(!1),(!1),this.index,this.currentFileInfo)),n&&c.push(new e(n,new d(j),(!1),(!1),this.index,this.currentFileInfo)),m&&c.push(new e(m,i,(!1),(!1),this.index,this.currentFileInfo)),k.push(new f([new g([new h("","&")])],c,b.strictImports,b.visibilityInfo()))}),new f([new g([new h("","&")])],k,b.strictImports,b.visibilityInfo()).eval(this.context)}})},{"../tree/declaration":60,"../tree/dimension":62,"../tree/element":63,"../tree/ruleset":81,"../tree/selector":82,"./function-registry":26}],29:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":62}],30:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":26,"./math-helper.js":29}],31:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;ci.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":50,"../tree/dimension":62,"./function-registry":26,"./math-helper.js":29}],32:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e",k=0;k";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":55,"../tree/dimension":62,"../tree/expression":64,"../tree/quoted":80,"../tree/url":85,"./function-registry":26}],34:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)}})},{"../tree/anonymous":50,"../tree/color":55,"../tree/detached-ruleset":61,"../tree/dimension":62,"../tree/keyword":70,"../tree/operation":77,"../tree/quoted":80,"../tree/url":85,"./function-registry":26}],35:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./less-error"),g=a("./utils"),h=("undefined"==typeof Promise?a("promise"):Promise,a("./logger"));b.exports=function(a){var b=function(a,b,c){this.less=a,this.rootFilename=c.filename,this.paths=b.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=b.mime,this.error=null,this.context=b,this.queue=[],this.files={}};return b.prototype.push=function(b,c,i,j,k){var l=this,m=this.context.pluginManager.Loader;this.queue.push(b);var n=function(a,c,d){l.queue.splice(l.queue.indexOf(b),1);var e=d===l.rootFilename;j.optional&&a?(k(null,{rules:[]},!1,null),h.info("The file "+d+" was skipped because it was not found and the import was marked optional.")):(l.files[d]||j.inline||(l.files[d]={root:c,options:j}),a&&!l.error&&(l.error=a),k(a,c,e,d))},o={relativeUrls:this.context.relativeUrls,entryPath:i.entryPath,rootpath:i.rootpath,rootFilename:i.rootFilename},p=a.getFileManager(b,i.currentDirectory,this.context,a);if(!p)return void n({message:"Could not find a file-manager for "+b});var q,r=function(a){var b,c=a.filename,g=a.contents.replace(/^\uFEFF/,"");o.currentDirectory=p.getPath(c),o.relativeUrls&&(o.rootpath=p.join(l.context.rootpath||"",p.pathDiff(o.currentDirectory,o.entryPath)),!p.isPathAbsolute(o.rootpath)&&p.alwaysMakePathsAbsolute()&&(o.rootpath=p.join(o.entryPath,o.rootpath))),o.filename=c;var h=new d.Parse(l.context);h.processImports=!1,l.contents[c]=g,(i.reference||j.reference)&&(o.reference=!0),j.isPlugin?(b=m.evalPlugin(g,h,l,j.pluginArgs,o),b instanceof f?n(b,null,c):n(null,b,c)):j.inline?n(null,g,c):!l.files[c]||l.files[c].options.multiple||j.multiple?new e(h,l,o).parse(g,function(a,b){n(a,b,c)}):n(null,l.files[c].root,c)},s=g.clone(this.context);c&&(s.ext=j.isPlugin?".js":".less"),q=j.isPlugin?m.loadPlugin(b,i.currentDirectory,s,a,p):p.loadFile(b,i.currentDirectory,s,a,function(a,b){a?n(a):r(b)}),q&&q.then(r,n)},b}},{"./contexts":12,"./less-error":37,"./logger":38,"./parser/parser":44,"./utils":89,promise:void 0}],36:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i,j={version:[3,7,1],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),AbstractPluginLoader:a("./environment/abstract-plugin-loader"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")},k=function(a){return function(){var b=Object.create(a.prototype);return a.apply(b,Array.prototype.slice.call(arguments,0)),b}},l=Object.create(j);for(var m in j.tree)if(i=j.tree[m],"function"==typeof i)l[m.toLowerCase()]=k(i);else{l[m]=Object.create(null);for(var n in i)l[m][n.toLowerCase()]=k(i[n])}return l}},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":17,"./environment/abstract-plugin-loader":18,"./environment/environment":19,"./functions":27,"./import-manager":35,"./less-error":37,"./logger":38,"./parse":41,"./parse-tree":40,"./parser/parser":44,"./plugin-manager":45,"./render":46,"./source-map-builder":47,"./source-map-output":48,"./transform-tree":49,"./tree":67,"./utils":89,"./visitors":93}],37:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(this.message=a.message,this.stack=a.stack,b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f?f.split("\n"):"";if(this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.column=i,!this.line&&this.stack){var l=this.stack.match(/(|Function):(\d+):(\d+)/);l&&(l[2]&&(this.line=parseInt(l[2])-2),l[3]&&(this.column=parseInt(l[3])))}this.callLine=j+1,this.callExtract=k[j],this.extract=[k[this.line-2],k[this.line-1],k[this.line]]}};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e,e.prototype.toString=function(a){a=a||{};var b="",c=this.extract||[],d=[],e=function(a){return a};if(a.stylize){var f=typeof a.stylize;if("function"!==f)throw Error("options.stylize should be a function, got a "+f+"!");e=a.stylize}if(null!==this.line){if("string"==typeof c[0]&&d.push(e(this.line-1+" "+c[0],"grey")),"string"==typeof c[1]){var g=this.line+" ";c[1]&&(g+=c[1].slice(0,this.column)+e(e(e(c[1].substr(this.column,1),"bold")+c[1].slice(this.column+1),"red"),"inverse")),d.push(g)}"string"==typeof c[2]&&d.push(e(this.line+1+" "+c[2],"grey")),d=d.join("\n")+e("","reset")+"\n"}return b+=e(this.type+"Error: "+this.message,"red"),this.filename&&(b+=e(" in ","red")+this.filename),this.line&&(b+=e(" on line "+this.line+", column "+(this.column+1)+":","grey")),b+="\n"+d,this.callLine&&(b+=e("from ","red")+(this.filename||"")+"/n",b+=e(this.callLine,"grey")+" "+this.callExtract+"/n"),b}},{"./utils":89}],38:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;hd&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],43:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(ce||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;el&&(p=!1)}q=r}while(p);return f?f:null},k.autoCommentAbsorb=!0,k.commentStore=[],k.finished=!1,k.peek=function(a){if("string"==typeof a){for(var c=0;cs||a=b.length;return k.i=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":42}],44:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=a("../functions/function-registry"),j=function k(a,b,c){function j(a,e){throw new d({index:q.i,filename:c.filename,type:e||"Syntax",message:a},b)}function l(a,b){var c=a instanceof Function?a.call(p):q.$re(a);return c?c:void j(b||("string"==typeof a?"expected '"+a+"' got '"+q.currentChar()+"'":"unexpected token"))}function m(a,b){return q.$char(a)?a:void j(b||"expected '"+a+"' got '"+q.currentChar()+"'")}function n(a){var b=c.filename;return{lineNumber:h.getLocation(a,q.getInput()).line+1,fileName:b}}function o(a,c,e,f,g){var h,i=[],j=q;try{j.start(a,!1,function(a,b){g({message:a,index:b+e})});for(var k,l,m=0;k=c[m];m++)l=j.i,h=p[k](),h?(h._index=l+e,h._fileInfo=f,i.push(h)):i.push(null);var n=j.end();n.isFinished?g(null,i):g(!0,null)}catch(o){throw new d({index:o.index+e,message:o.message},b,f.filename)}}var p,q=g();return{parserInput:q,imports:b,fileInfo:c,parseNode:o,parse:function(g,h,j){var l,m,n,o,p=null,r="";if(m=j&&j.globalVars?k.serializeVars(j.globalVars)+"\n":"",n=j&&j.modifyVars?"\n"+k.serializeVars(j.modifyVars):"",a.pluginManager)for(var s=a.pluginManager.getPreProcessors(),t=0;t")}return a},args:function(a){var b,c,d,f,g,h,i,k=p.entities,l={args:null,variadic:!1},m=[],n=[],o=[],r=!0;for(q.save();;){if(a)h=p.detachedRuleset()||p.expression();else{if(q.commentStore.length=0,q.$str("...")){l.variadic=!0,q.$char(";")&&!b&&(b=!0),(b?n:o).push({variadic:!0});break}h=k.variable()||k.property()||k.literal()||k.keyword()||this.call(!0)}if(!h||!r)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var s=null;if(a?h.value&&1==h.value.length&&(s=h.value[0]):s=h,s&&(s instanceof e.Variable||s instanceof e.Property))if(q.$char(":")){if(m.length>0&&(b&&j("Cannot mix ; and , as delimiter types"),c=!0),g=p.detachedRuleset()||p.expression(),!g){if(!a)return q.restore(),l.args=[],l;j("could not understand value for named argument")}f=d=s.name}else if(q.$str("...")){if(!a){l.variadic=!0,q.$char(";")&&!b&&(b=!0),(b?n:o).push({name:h.name,variadic:!0});break}i=!0}else a||(d=f=s.name,g=null);g&&m.push(g),o.push({name:f,value:g,expand:i}),q.$char(",")?r=!0:(r=";"===q.$char(";"),(r||b)&&(c&&j("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),n.push({name:d,value:g,expand:i}),d=null,m=[],c=!1))}return q.forget(),l.args=b?n:o,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==q.currentChar()&&"#"!==q.currentChar()||q.peek(/^[^{]*\}/)))if(q.save(),b=q.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!q.$char(")"))return void q.restore("Missing closing ')'");if(q.commentStore.length=0,q.$str("when")&&(d=l(p.conditions,"expected condition")),c=p.block())return q.forget(),new e.mixin.Definition(a,f,c,d,g);q.restore()}else q.forget()},ruleLookups:function(){var a,b,c=[];if("["===q.currentChar()){for(;;){if(q.save(),b=null,a=this.lookupValue(),!a&&""!==a){q.restore();break}c.push(a),q.forget()}return c.length>0?c:void 0}},lookupValue:function(){if(q.save(),!q.$char("["))return void q.restore();var a=q.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);return q.$char("]")&&(a||""===a)?(q.forget(),a):void q.restore()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.property()||a.call()||a.keyword()||this.mixin.call(!0)||a.javascript()},end:function(){return q.$char(";")||q.peek("}")},ieAlpha:function(){var a;if(q.$re(/^opacity=/i))return a=q.$re(/^\d+/),a||(a=l(p.entities.variable,"Could not parse alpha"),a="@{"+a.name.slice(1)+"}"),m(")"),new e.Quoted("","alpha(opacity="+a+")")},element:function(){var a,b,d,f=q.i;if(b=this.combinator(),a=q.$re(/^(?:\d+\.\d+|\d+)%/)||q.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||q.$char("*")||q.$char("&")||this.attribute()||q.$re(/^\([^&()@]+\)/)||q.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(q.save(),q.$char("(")?(d=this.selector(!1))&&q.$char(")")?(a=new e.Paren(d),q.forget()):q.restore("Missing closing ')'"):q.forget()),a)return new e.Element(b,a,a instanceof e.Variable,f,c)},combinator:function(){var a=q.currentChar();if("/"===a){q.save();var b=q.$re(/^\/[a-z]+\//i);if(b)return q.forget(),new e.Combinator(b);q.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(q.i++,"^"===a&&"^"===q.currentChar()&&(a="^^",q.i++);q.isWhitespace();)q.i++;return new e.Combinator(a)}return new e.Combinator(q.isWhitespace(-1)?" ":null); -},selector:function(a){var b,d,f,g,h,i,k,m=q.i;for(a=a!==!1;(a&&(d=this.extend())||a&&(i=q.$str("when"))||(g=this.element()))&&(i?k=l(this.conditions,"expected condition"):k?j("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&j("Extend can only be used at the end of selector"),f=q.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,k,m,c):void(h&&j("Extend must be used to extend a selector, it cannot be used on its own"))},selectors:function(){for(var a,b;;){if(a=this.selector(),!a)break;if(b?b.push(a):b=[a],q.commentStore.length=0,a.condition&&b.length>1&&j("Guards are only currently allowed on a single selector."),!q.$char(","))break;a.condition&&j("Guards are only currently allowed on a single selector."),q.commentStore.length=0}return b},attribute:function(){if(q.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=l(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=q.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||q.$re(/^[0-9]+%/)||q.$re(/^[\w-]+/)||d.variableCurly()),m("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(q.$char("{")&&(a=this.primary())&&q.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a,b,c;if(q.save(),q.$re(/^[.#]\(/)&&(a=this.mixin.args(!1),b=a.args,c=a.variadic,!q.$char(")")))return void q.restore();var d=this.blockRuleset();return d?(q.forget(),b?new e.mixin.Definition(null,b,d,null,c):new e.DetachedRuleset(d)):void q.restore()},ruleset:function(){var b,c,d;if(q.save(),a.dumpLineNumbers&&(d=n(q.i)),b=this.selectors(),b&&(c=this.block())){q.forget();var f=new e.Ruleset(b,c,a.strictImports);return a.dumpLineNumbers&&(f.debugInfo=d),f}q.restore()},declaration:function(){var a,b,d,f,g,h,i=q.i,j=q.currentChar();if("."!==j&&"#"!==j&&"&"!==j&&":"!==j)if(q.save(),a=this.variable()||this.ruleProperty()){if(h="string"==typeof a,h&&(b=this.detachedRuleset(),b&&(d=!0)),q.commentStore.length=0,!b){if(g=!h&&a.length>1&&a.pop().value,b=a[0].value&&"--"===a[0].value.slice(0,2)?this.permissiveValue():this.anonymousValue())return q.forget(),new e.Declaration(a,b,(!1),g,i,c);b||(b=this.value()),b?f=this.important():h&&(b=this.permissiveValue())}if(b&&(this.end()||d))return q.forget(),new e.Declaration(a,b,f,g,i,c);q.restore()}else q.restore()},anonymousValue:function(){var a=q.i,b=q.$re(/^([^.#@\$+\/'"*`(;{}-]*);/);if(b)return new e.Anonymous(b[1],a)},permissiveValue:function(a){function b(){var a=q.currentChar();return"string"==typeof i?a===i:i.test(a)}var d,f,g,h,i=a||";",k=q.i,l=[];if(!b()){h=[];do f=this.comment(),f?h.push(f):(f=this.entity(),f&&h.push(f));while(f);if(g=b(),h.length>0){if(h=new e.Expression(h),g)return h;l.push(h)," "===q.prevChar()&&l.push(new e.Anonymous(" ",k))}if(q.save(),h=q.$parseUntil(i)){if("string"==typeof h&&j("Expected '"+h+"'","Parse"),1===h.length&&" "===h[0])return q.forget(),new e.Anonymous("",k);var m;for(d=0;d0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!q.$char(","))break}else if(a=b.variable()||b.mixinLookup(),a&&(c.push(a),!q.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=q.i;return a.dumpLineNumbers&&(g=n(h)),q.save(),q.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||j("media definitions require block statements after any features"),q.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void q.restore()},plugin:function(){var a,b,d,f=q.i,g=q.$re(/^@plugin?\s+/);if(g){if(b=this.pluginArgs(),d=b?{pluginArgs:b,isPlugin:!0}:{isPlugin:!0},a=this.entities.quoted()||this.entities.url())return q.$char(";")||(q.i=f,j("missing semi-colon on @plugin")),new e.Import(a,null,d,f,c);q.i=f,j("malformed @plugin statement")}},pluginArgs:function(){if(q.save(),!q.$char("("))return q.restore(),null;var a=q.$re(/^\s*([^\);]+)\)\s*/);return a[1]?(q.forget(),a[1].trim()):(q.restore(),null)},atrule:function(){var b,d,f,g,h,i,k,l=q.i,m=!0,o=!0;if("@"===q.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(q.save(),b=q.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,m=!1;break;case"@namespace":i=!0,m=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,o=!1;break;default:k=!0}return q.commentStore.length=0,h?(d=this.entity(),d||j("expected "+b+" identifier")):i?(d=this.expression(),d||j("expected "+b+" expression")):k&&(d=this.permissiveValue(/^[{;]/),m="{"===q.currentChar(),d?d.value||(d=null):m||";"===q.currentChar()||j(b+" rule is missing block or ending semi-colon")),m&&(f=this.blockRuleset()),f||!m&&d&&q.$char(";")?(q.forget(),new e.AtRule(b,d,f,l,c,a.dumpLineNumbers?n(l):null,o)):void q.restore("at-rule options not recognised")}}},value:function(){var a,b=[],c=q.i;do if(a=this.expression(),a&&(b.push(a),!q.$char(",")))break;while(a);if(b.length>0)return new e.Value(b,c)},important:function(){if("!"===q.currentChar())return q.$re(/^! *important/)},sub:function(){var a,b;return q.save(),q.$char("(")?(a=this.addition(),a&&q.$char(")")?(q.forget(),b=new e.Expression([a]),b.parens=!0,b):void q.restore("Expected ')'")):void q.restore()},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=q.isWhitespace(-1);;){if(q.peek(/^\/[*\/]/))break;if(q.save(),c=q.$char("/")||q.$char("*")||q.$str("./"),!c){q.forget();break}if(b=this.operand(),!b){q.restore();break}q.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=q.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=q.isWhitespace(-1);;){if(c=q.$re(/^[-+]\s+/)||!f&&(q.$char("+")||q.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=q.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=q.i;if(a=this.condition(!0)){for(;;){if(!q.peek(/^,\s*(not\s*)?\(/)||!q.$char(","))break;if(b=this.condition(!0),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(a){function b(){return q.$str("or")}var c,d,f;if(c=this.conditionAnd(a)){if(d=b()){if(f=this.condition(a),!f)return;c=new e.Condition(d,c,f)}return c}},conditionAnd:function(a){function b(){var b=h.negatedCondition(a)||h.parenthesisCondition(a);return b||a?b:h.atomicCondition(a)}function c(){return q.$str("and")}var d,f,g,h=this;if(d=b()){if(f=c()){if(g=this.conditionAnd(a),!g)return;d=new e.Condition(f,d,g)}return d}},negatedCondition:function(a){if(q.$str("not")){var b=this.parenthesisCondition(a);return b&&(b.negate=!b.negate),b}},parenthesisCondition:function(a){function b(b){var c;return q.save(),(c=b.condition(a))&&q.$char(")")?(q.forget(),c):void q.restore()}var c;return q.save(),q.$str("(")?(c=b(this))?(q.forget(),c):(c=this.atomicCondition(a))?q.$char(")")?(q.forget(),c):void q.restore("expected ')' got '"+q.currentChar()+"'"):void q.restore():void q.restore()},atomicCondition:function(a){function b(){return this.addition()||h.keyword()||h.quoted()||h.mixinLookup()}var c,d,f,g,h=this.entities,i=q.i;if(b=b.bind(this),c=b())return q.$char(">")?g=q.$char("=")?">=":">":q.$char("<")?g=q.$char("=")?"<=":"<":q.$char("=")&&(g=q.$char(">")?"=>":q.$char("<")?"=<":"="),g?(d=b(),d?f=new e.Condition(g,c,d,i,(!1)):j("expected expression")):f=new e.Condition("=",c,new e.Keyword("true"),i,(!1)),f},operand:function(){var a,b=this.entities;q.peek(/^-[@\$\(]/)&&(a=q.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.property()||b.call()||b.quoted(!0)||b.colorKeyword()||b.mixinLookup();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[],d=q.i;do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),q.peek(/^\/[\/*]/)||(b=q.$char("/"),b&&c.push(new e.Anonymous(b,d)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=q.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=q.i,c=q.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];q.save();var h=q.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],q.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(q.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},e.prototype.addPostProcessor=function(a,b){var c;for(c=0;c=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.getPreProcessors=function(){for(var a=[],b=0;b0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],49:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Declaration("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j,k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})],l=[];if(b.pluginManager){j=b.pluginManager.visitor();for(var m=0;m<2;m++)for(j.first();i=j.get();)i.isPreEvalVisitor?0!==m&&l.indexOf(i)!==-1||(l.push(i),i.run(a)):0!==m&&k.indexOf(i)!==-1||(i.isPreVisitor?k.unshift(i):k.push(i))}c=a.eval(h);for(var m=0;m.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":76}],59:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],60:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;c-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px", -duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":15,"./color":55,"./node":76,"./unit":84}],63:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./combinator"),g=function(a,b,c,d,e,g){this.combinator=a instanceof f?a:new f(a),this.value="string"==typeof b?b.trim():b?b:"",this.isVariable=c,this._index=d,this._fileInfo=e,this.copyVisibilityInfo(g),this.setParent(this.combinator,this)};g.prototype=new d,g.prototype.type="Element",g.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},g.prototype.eval=function(a){return new g(this.combinator,this.value.eval?this.value.eval(a):this.value,this.isVariable,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.clone=function(){return new g(this.combinator,this.value,this.isVariable,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.fileInfo(),this.getIndex())},g.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof e&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=g},{"./combinator":56,"./node":76,"./paren":78}],64:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./comment"),g=a("./dimension"),h=a("../math-constants"),i=function(a,b){if(this.value=a,this.noSpacing=b,!a)throw new Error("Expression requires an array parameter")};i.prototype=new d,i.prototype.type="Expression",i.prototype.accept=function(a){this.value=a.visitArray(this.value)},i.prototype.eval=function(a){var b,c=a.isMathOn(),d=this.parens&&(a.math!==h.STRICT_LEGACY||!this.parensInOp),f=!1;return d&&a.inParenthesis(),this.value.length>1?b=new i(this.value.map(function(b){return b.eval?b.eval(a):b}),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||a.inCalc||(f=!0),b=this.value[0].eval(a)):b=this,d&&a.outOfParenthesis(),!this.parens||!this.parensInOp||c||f||b instanceof g||(b=new e(b)),b},i.prototype.genCSS=function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":76,"./selector":82}],66:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=a("../utils"),k=a("../less-error"),l=function(a,b,c,d,e,f){if(this.options=c,this._index=d,this._fileInfo=e,this.path=a,this.features=b,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f),this.setParent(this.features,this),this.setParent(this.path,this)};l.prototype=new d,l.prototype.type="Import",l.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.isPlugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},l.prototype.genCSS=function(a,b){this.css&&void 0===this.path._fileInfo.reference&&(b.add("@import ",this._fileInfo,this._index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},l.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},l.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},l.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new l(b.eval(a),this.features,this.options,this._index,this._fileInfo,this.visibilityInfo())},l.prototype.evalPath=function(a){var b=this.path.eval(a),c=this._fileInfo&&this._fileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},l.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},l.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.isPlugin){if(this.root&&this.root.eval)try{this.root.eval(a)}catch(f){throw f.message="Plugin error during evaluation",new k(f,this.root.imports,this.root.filename)}return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[]}if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var g=new i(this.root,0,{filename:this.importedFilename,reference:this.path._fileInfo&&this.path._fileInfo.reference},(!0),(!0));return this.features?new e([g],this.features.value):[g]}if(this.css){var m=new l(this.evalPath(a),d,this.options,this._index);if(!m.css&&this.error)throw this.error;return m}return b=new h(null,j.copyArray(this.root.rules)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=l},{"../less-error":37,"../utils":89,"./anonymous":50,"./media":71,"./node":76,"./quoted":80,"./ruleset":81,"./url":85}],67:[function(a,b,c){var d=Object.create(null);d.Node=a("./node"),d.Color=a("./color"),d.AtRule=a("./atrule"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Property=a("./property"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Declaration=a("./declaration"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDescriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.VariableCall=a("./variable-call"),d.NamespaceValue=a("./namespace-value"),b.exports=d},{"./anonymous":50,"./assignment":51,"./atrule":52,"./attribute":53,"./call":54,"./color":55,"./combinator":56,"./comment":57,"./condition":58,"./declaration":60,"./detached-ruleset":61,"./dimension":62,"./element":63,"./expression":64,"./extend":65,"./import":66,"./javascript":68,"./keyword":70,"./media":71,"./mixin-call":72,"./mixin-definition":73,"./namespace-value":74,"./negative":75,"./node":76,"./operation":77,"./paren":78,"./property":79,"./quoted":80,"./ruleset":81,"./selector":82,"./unicode-descriptor":83,"./unit":84,"./url":85,"./value":86,"./variable":88,"./variable-call":87}],68:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this._index=c,this._fileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a),c=typeof b;return"number"!==c||isNaN(b)?"string"===c?new f('"'+b+'"',b,this.escaped,this._index):new g(Array.isArray(b)?b.join(", "):b):new e(b)},b.exports=h},{"./anonymous":50,"./dimension":62,"./js-eval-node":69,"./quoted":80}],69:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(!b.javascriptEnabled)throw{message:"Inline JavaScript is not enabled. Is it set in your options?",filename:this.fileInfo().filename,index:this.getIndex()};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.getIndex(),d.fileInfo()).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.fileInfo().filename,index:this.getIndex()}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.fileInfo().filename,index:this.getIndex()}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":76,"./variable":88}],70:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":76}],71:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./atrule"),j=a("../utils"),k=function(a,b,c,g,h){this._index=c,this._fileInfo=g;var i=new f([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0,this.setParent(i,this),this.setParent(this.features,this),this.setParent(this.rules,this)};k.prototype=new i,k.prototype.type="Media",k.prototype.isRulesetLike=function(){return!0},k.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},k.prototype.genCSS=function(a,b){b.add("@media ",this._fileInfo,this._index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},k.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new k(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo),b.features=this.features.eval(a),a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},k.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo()),this.setParent(b,this)}return delete a.mediaBlocks,delete a.mediaPath,b},k.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b0;b--)a.splice(b,0,new g("and"));return new h(a)})),this.setParent(this.features,this),new d([],[])},k.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(n=!0,k=0;k0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(k=0;kthis.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;gb?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],77:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=a("../math-constants"),h=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};h.prototype=new d,h.prototype.type="Operation",h.prototype.accept=function(a){this.operands=a.visit(this.operands)},h.prototype.eval=function(a){var b,c=this.operands[0].eval(a),d=this.operands[1].eval(a);if(a.isMathOn(this.op)){if(b="./"===this.op?"/":this.op,c instanceof f&&d instanceof e&&(c=c.toColor()),d instanceof f&&c instanceof e&&(d=d.toColor()),!c.operate){if(c instanceof h&&"/"===c.op&&a.math===g.PARENS_DIVISION)return new h(this.op,[c,d],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return c.operate(a,b,d)}return new h(this.op,[c,d],this.isSpaced)},h.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=h},{"../math-constants":39,"./color":55,"./dimension":62,"./node":76}],78:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":76}],79:[function(a,b,c){var d=a("./node"),e=a("./declaration"),f=function(a,b,c){this.name=a,this._index=b,this._fileInfo=c};f.prototype=new d,f.prototype.type="Property",f.prototype.eval=function(a){var b,c=this.name,d=a.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;if(this.evaluating)throw{type:"Name",message:"Recursive property reference for "+c,filename:this.fileInfo().filename,index:this.getIndex()};if(this.evaluating=!0,b=this.find(a.frames,function(b){var f,g=b.property(c);if(g){for(var h=0;h0;a--){var b=this.rules[a-1];if(b instanceof e)return this.parseValue(b)}},q.prototype.parseValue=function(a){function b(a){return a.value instanceof k&&!a.parsed?("string"==typeof a.value.value?this.parse.parseNode(a.value.value,["value","important"],a.value.getIndex(),a.fileInfo(),function(b,c){b&&(a.parsed=!0),c&&(a.value=c[0],a.important=c[1]||"",a.parsed=!0)}):a.parsed=!0,a):a}var c=this;if(Array.isArray(a)){var d=[];return a.forEach(function(a){d.push(b.call(c,a))}),d}return b.call(c,a)},q.prototype.rulesets=function(){if(!this.rules)return[];var a,b,c=[],d=this.rules;for(a=0;b=d[a];a++)b.isRuleset&&c.push(b);return c},q.prototype.prependRule=function(a){var b=this.rules; -b?b.unshift(a):this.rules=[a],this.setParent(a,this)},q.prototype.find=function(a,b,c){b=b||this;var d,e,f=[],g=a.toCSS();return g in this._lookups?this._lookups[g]:(this.rulesets().forEach(function(g){if(g!==b)for(var h=0;hd){if(!c||c(g)){e=g.find(new i(a.elements.slice(d)),b,c);for(var j=0;j0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,d=1;d0?(e=p.copyArray(a),f=e.pop(),g=d.createDerived(p.copyArray(f.elements))):g=d.createDerived([]),b.length>0){var h=c.combinator,i=b[0].elements[0];h.emptyOrWhitespace&&!i.combinator.emptyOrWhitespace&&(h=i.combinator),g.elements.push(new j(h,i.value,c.isVariable,c._index,c._fileInfo)),g.elements=g.elements.concat(b[0].elements.slice(1))}if(0!==g.elements.length&&e.push(g),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function g(a,b,c,d,e){var g;for(g=0;g0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new i(a))}}function l(a,b,c){function m(a){var b;return a.value instanceof h?(b=a.value.value,b instanceof i?b:null):null}var n,o,p,q,r,s,t,u,v,w,x=!1;for(q=[],r=[[]],n=0;u=c.elements[n];n++)if("&"!==u.value){var y=m(u);if(null!=y){k(q,r);var z,A=[],B=[];for(z=l(A,b,y),x=x||z,p=0;p0&&t[0].elements.push(new j(u.combinator,"",u.isVariable,u._index,u._fileInfo)),s.push(t);else for(p=0;p0&&(a.push(r[n]),w=r[n][v-1],r[n][v-1]=w.createDerived(w.elements,c.extendList));return x}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,q;if(o=[],q=l(o,b,c),!q)if(b.length>0)for(o=[],n=0;n0)for(b=0;b=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}},copyArray:function(a){var b,c=a.length,d=new Array(c);for(b=0;b=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.fileInfo(),b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitDeclaration:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitAtRule:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitAtRuleOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=i},{"../logger":38,"../tree":67,"../utils":89,"./visitor":97}],91:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=d},{}],92:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=a("../utils"),h=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};h.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,g.copyArray(this.context.frames)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.getIndex(),f.filename=a.fileInfo().filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a},isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitDeclaration:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitAtRule:function(a,b){return a.rules&&a.rules.length?this.visitAtRuleWithBody(a,b):this.visitAtRuleWithoutBody(a,b)},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a},visitAtRuleWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitAtRuleWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b=0;e--)if(c=a[e],c instanceof d.Declaration)if(f[c.name]){b=f[c.name],b instanceof d.Declaration&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b={},c=[],e=0;e0){var b=a[0],c=[],e=[new d.Expression(c)];a.forEach(function(a){"+"===a.merge&&c.length>0&&e.push(new d.Expression(c=[])),c.push(a.value),b.important=b.important||a.important}),b.value=new d.Value(e)}})}}},b.exports=g},{"../tree":67,"./visitor":97}],97:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitInCache={},this._visitOutCache={},h||(e(f,1),h=!0)};i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a.value&&a.value.typeIndex&&this.visit(a.value),a;var c,e=this._implementation,f=this._visitInCache[b],h=this._visitOutCache[b],i=g;if(i.visitDeeper=!0,f||(c="visit"+a.type,f=e[c]||d,h=e[c+"Out"]||d,this._visitInCache[b]=f,this._visitOutCache[b]=h),f!==d){var j=f.call(e,a,i);a&&e.isReplacing&&(a=j)}return i.visitDeeper&&a&&a.accept&&a.accept(this),h!=d&&h.call(e,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;ck){for(var b=0,c=h.length-j;b + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + diff --git a/bibli/lessphp/README.md b/bibli/lessphp/README.md new file mode 100755 index 0000000..d3d8716 --- /dev/null +++ b/bibli/lessphp/README.md @@ -0,0 +1,96 @@ +[![Build Status](https://travis-ci.org/leafo/lessphp.svg?branch=master)](https://travis-ci.org/leafo/lessphp) + +# lessphp v0.5.0 +### + +`lessphp` is a compiler for LESS written in PHP. The documentation is great, +so check it out: . + +Here's a quick tutorial: + +### How to use in your PHP project + +The only file required is `lessc.inc.php`, so copy that to your include directory. + +The typical flow of **lessphp** is to create a new instance of `lessc`, +configure it how you like, then tell it to compile something using one built in +compile methods. + +The `compile` method compiles a string of LESS code to CSS. + +```php +compile(".block { padding: 3 + 4px }"); +``` + +The `compileFile` method reads and compiles a file. It will either return the +result or write it to the path specified by an optional second argument. + +```php +compileFile("input.less"); +``` + +The `checkedCompile` method is like `compileFile`, but it only compiles if the output +file doesn't exist or it's older than the input file: + +```php +checkedCompile("input.less", "output.css"); +``` + +If there any problem compiling your code, an exception is thrown with a helpful message: + +```php +compile("invalid LESS } {"); +} catch (exception $e) { + echo "fatal error: " . $e->getMessage(); +} +``` + +The `lessc` object can be configured through an assortment of instance methods. +Some possible configuration options include [changing the output format][1], +[setting variables from PHP][2], and [controlling the preservation of +comments][3], writing [custom functions][4] and much more. It's all described +in [the documentation][0]. + + + [0]: http://leafo.net/lessphp/docs/ + [1]: http://leafo.net/lessphp/docs/#output_formatting + [2]: http://leafo.net/lessphp/docs/#setting_variables_from_php + [3]: http://leafo.net/lessphp/docs/#preserving_comments + [4]: http://leafo.net/lessphp/docs/#custom_functions + + +### How to use from the command line + +An additional script has been included to use the compiler from the command +line. In the simplest invocation, you specify an input file and the compiled +css is written to standard out: + + $ plessc input.less > output.css + +Using the -r flag, you can specify LESS code directly as an argument or, if +the argument is left off, from standard in: + + $ plessc -r "my less code here" + +Finally, by using the -w flag you can watch a specified input file and have it +compile as needed to the output file: + + $ plessc -w input-file output-file + +Errors from watch mode are written to standard out. + +The -f flag sets the [output formatter][1]. For example, to compress the +output run this: + + $ plessc -f=compressed myfile.less + +For more help, run `plessc --help` + diff --git a/bibli/lessphp/lessc.inc.php b/bibli/lessphp/lessc.inc.php new file mode 100755 index 0000000..3798895 --- /dev/null +++ b/bibli/lessphp/lessc.inc.php @@ -0,0 +1,3880 @@ + + * Licensed under MIT or GPLv3, see LICENSE + */ + + +/** + * The LESS compiler and parser. + * + * Converting LESS to CSS is a three stage process. The incoming file is parsed + * by `lessc_parser` into a syntax tree, then it is compiled into another tree + * representing the CSS structure by `lessc`. The CSS tree is fed into a + * formatter, like `lessc_formatter` which then outputs CSS as a string. + * + * During the first compile, all values are *reduced*, which means that their + * types are brought to the lowest form before being dump as strings. This + * handles math equations, variable dereferences, and the like. + * + * The `parse` function of `lessc` is the entry point. + * + * In summary: + * + * The `lessc` class creates an instance of the parser, feeds it LESS code, + * then transforms the resulting tree to a CSS tree. This class also holds the + * evaluation context, such as all available mixins and variables at any given + * time. + * + * The `lessc_parser` class is only concerned with parsing its input. + * + * The `lessc_formatter` takes a CSS tree, and dumps it to a formatted string, + * handling things like indentation. + */ +class lessc { + static public $VERSION = "v0.5.0"; + + static public $TRUE = array("keyword", "true"); + static public $FALSE = array("keyword", "false"); + + protected $libFunctions = array(); + protected $registeredVars = array(); + protected $preserveComments = false; + + public $vPrefix = '@'; // prefix of abstract properties + public $mPrefix = '$'; // prefix of abstract blocks + public $parentSelector = '&'; + + public $importDisabled = false; + public $importDir = ''; + + protected $numberPrecision = null; + + protected $allParsedFiles = array(); + + // set to the parser that generated the current line when compiling + // so we know how to create error messages + protected $sourceParser = null; + protected $sourceLoc = null; + + static protected $nextImportId = 0; // uniquely identify imports + + // attempts to find the path of an import url, returns null for css files + protected function findImport($url) { + foreach ((array)$this->importDir as $dir) { + $full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url; + if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) { + return $file; + } + } + + return null; + } + + protected function fileExists($name) { + return is_file($name); + } + + public static function compressList($items, $delim) { + if (!isset($items[1]) && isset($items[0])) return $items[0]; + else return array('list', $delim, $items); + } + + public static function preg_quote($what) { + return preg_quote($what, '/'); + } + + protected function tryImport($importPath, $parentBlock, $out) { + if ($importPath[0] == "function" && $importPath[1] == "url") { + $importPath = $this->flattenList($importPath[2]); + } + + $str = $this->coerceString($importPath); + if ($str === null) return false; + + $url = $this->compileValue($this->lib_e($str)); + + // don't import if it ends in css + if (substr_compare($url, '.css', -4, 4) === 0) return false; + + $realPath = $this->findImport($url); + + if ($realPath === null) return false; + + if ($this->importDisabled) { + return array(false, "/* import disabled */"); + } + + if (isset($this->allParsedFiles[realpath($realPath)])) { + return array(false, null); + } + + $this->addParsedFile($realPath); + $parser = $this->makeParser($realPath); + $root = $parser->parse(file_get_contents($realPath)); + + // set the parents of all the block props + foreach ($root->props as $prop) { + if ($prop[0] == "block") { + $prop[1]->parent = $parentBlock; + } + } + + // copy mixins into scope, set their parents + // bring blocks from import into current block + // TODO: need to mark the source parser these came from this file + foreach ($root->children as $childName => $child) { + if (isset($parentBlock->children[$childName])) { + $parentBlock->children[$childName] = array_merge( + $parentBlock->children[$childName], + $child); + } else { + $parentBlock->children[$childName] = $child; + } + } + + $pi = pathinfo($realPath); + $dir = $pi["dirname"]; + + list($top, $bottom) = $this->sortProps($root->props, true); + $this->compileImportedProps($top, $parentBlock, $out, $parser, $dir); + + return array(true, $bottom, $parser, $dir); + } + + protected function compileImportedProps($props, $block, $out, $sourceParser, $importDir) { + $oldSourceParser = $this->sourceParser; + + $oldImport = $this->importDir; + + // TODO: this is because the importDir api is stupid + $this->importDir = (array)$this->importDir; + array_unshift($this->importDir, $importDir); + + foreach ($props as $prop) { + $this->compileProp($prop, $block, $out); + } + + $this->importDir = $oldImport; + $this->sourceParser = $oldSourceParser; + } + + /** + * Recursively compiles a block. + * + * A block is analogous to a CSS block in most cases. A single LESS document + * is encapsulated in a block when parsed, but it does not have parent tags + * so all of it's children appear on the root level when compiled. + * + * Blocks are made up of props and children. + * + * Props are property instructions, array tuples which describe an action + * to be taken, eg. write a property, set a variable, mixin a block. + * + * The children of a block are just all the blocks that are defined within. + * This is used to look up mixins when performing a mixin. + * + * Compiling the block involves pushing a fresh environment on the stack, + * and iterating through the props, compiling each one. + * + * See lessc::compileProp() + * + */ + protected function compileBlock($block) { + switch ($block->type) { + case "root": + $this->compileRoot($block); + break; + case null: + $this->compileCSSBlock($block); + break; + case "media": + $this->compileMedia($block); + break; + case "directive": + $name = "@" . $block->name; + if (!empty($block->value)) { + $name .= " " . $this->compileValue($this->reduce($block->value)); + } + + $this->compileNestedBlock($block, array($name)); + break; + default: + $this->throwError("unknown block type: $block->type\n"); + } + } + + protected function compileCSSBlock($block) { + $env = $this->pushEnv(); + + $selectors = $this->compileSelectors($block->tags); + $env->selectors = $this->multiplySelectors($selectors); + $out = $this->makeOutputBlock(null, $env->selectors); + + $this->scope->children[] = $out; + $this->compileProps($block, $out); + + $block->scope = $env; // mixins carry scope with them! + $this->popEnv(); + } + + protected function compileMedia($media) { + $env = $this->pushEnv($media); + $parentScope = $this->mediaParent($this->scope); + + $query = $this->compileMediaQuery($this->multiplyMedia($env)); + + $this->scope = $this->makeOutputBlock($media->type, array($query)); + $parentScope->children[] = $this->scope; + + $this->compileProps($media, $this->scope); + + if (count($this->scope->lines) > 0) { + $orphanSelelectors = $this->findClosestSelectors(); + if (!is_null($orphanSelelectors)) { + $orphan = $this->makeOutputBlock(null, $orphanSelelectors); + $orphan->lines = $this->scope->lines; + array_unshift($this->scope->children, $orphan); + $this->scope->lines = array(); + } + } + + $this->scope = $this->scope->parent; + $this->popEnv(); + } + + protected function mediaParent($scope) { + while (!empty($scope->parent)) { + if (!empty($scope->type) && $scope->type != "media") { + break; + } + $scope = $scope->parent; + } + + return $scope; + } + + protected function compileNestedBlock($block, $selectors) { + $this->pushEnv($block); + $this->scope = $this->makeOutputBlock($block->type, $selectors); + $this->scope->parent->children[] = $this->scope; + + $this->compileProps($block, $this->scope); + + $this->scope = $this->scope->parent; + $this->popEnv(); + } + + protected function compileRoot($root) { + $this->pushEnv(); + $this->scope = $this->makeOutputBlock($root->type); + $this->compileProps($root, $this->scope); + $this->popEnv(); + } + + protected function compileProps($block, $out) { + foreach ($this->sortProps($block->props) as $prop) { + $this->compileProp($prop, $block, $out); + } + $out->lines = $this->deduplicate($out->lines); + } + + /** + * Deduplicate lines in a block. Comments are not deduplicated. If a + * duplicate rule is detected, the comments immediately preceding each + * occurence are consolidated. + */ + protected function deduplicate($lines) { + $unique = array(); + $comments = array(); + + foreach ($lines as $line) { + if (strpos($line, '/*') === 0) { + $comments[] = $line; + continue; + } + if (!in_array($line, $unique)) { + $unique[] = $line; + } + array_splice($unique, array_search($line, $unique), 0, $comments); + $comments = array(); + } + return array_merge($unique, $comments); + } + + protected function sortProps($props, $split = false) { + $vars = array(); + $imports = array(); + $other = array(); + $stack = array(); + + foreach ($props as $prop) { + switch ($prop[0]) { + case "comment": + $stack[] = $prop; + break; + case "assign": + $stack[] = $prop; + if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) { + $vars = array_merge($vars, $stack); + } else { + $other = array_merge($other, $stack); + } + $stack = array(); + break; + case "import": + $id = self::$nextImportId++; + $prop[] = $id; + $stack[] = $prop; + $imports = array_merge($imports, $stack); + $other[] = array("import_mixin", $id); + $stack = array(); + break; + default: + $stack[] = $prop; + $other = array_merge($other, $stack); + $stack = array(); + break; + } + } + $other = array_merge($other, $stack); + + if ($split) { + return array(array_merge($imports, $vars), $other); + } else { + return array_merge($imports, $vars, $other); + } + } + + protected function compileMediaQuery($queries) { + $compiledQueries = array(); + foreach ($queries as $query) { + $parts = array(); + foreach ($query as $q) { + switch ($q[0]) { + case "mediaType": + $parts[] = implode(" ", array_slice($q, 1)); + break; + case "mediaExp": + if (isset($q[2])) { + $parts[] = "($q[1]: " . + $this->compileValue($this->reduce($q[2])) . ")"; + } else { + $parts[] = "($q[1])"; + } + break; + case "variable": + $parts[] = $this->compileValue($this->reduce($q)); + break; + } + } + + if (count($parts) > 0) { + $compiledQueries[] = implode(" and ", $parts); + } + } + + $out = "@media"; + if (!empty($parts)) { + $out .= " " . + implode($this->formatter->selectorSeparator, $compiledQueries); + } + return $out; + } + + protected function multiplyMedia($env, $childQueries = null) { + if (is_null($env) || + !empty($env->block->type) && $env->block->type != "media" + ) { + return $childQueries; + } + + // plain old block, skip + if (empty($env->block->type)) { + return $this->multiplyMedia($env->parent, $childQueries); + } + + $out = array(); + $queries = $env->block->queries; + if (is_null($childQueries)) { + $out = $queries; + } else { + foreach ($queries as $parent) { + foreach ($childQueries as $child) { + $out[] = array_merge($parent, $child); + } + } + } + + return $this->multiplyMedia($env->parent, $out); + } + + protected function expandParentSelectors(&$tag, $replace) { + $parts = explode("$&$", $tag); + $count = 0; + foreach ($parts as &$part) { + $part = str_replace($this->parentSelector, $replace, $part, $c); + $count += $c; + } + $tag = implode($this->parentSelector, $parts); + return $count; + } + + protected function findClosestSelectors() { + $env = $this->env; + $selectors = null; + while ($env !== null) { + if (isset($env->selectors)) { + $selectors = $env->selectors; + break; + } + $env = $env->parent; + } + + return $selectors; + } + + + // multiply $selectors against the nearest selectors in env + protected function multiplySelectors($selectors) { + // find parent selectors + + $parentSelectors = $this->findClosestSelectors(); + if (is_null($parentSelectors)) { + // kill parent reference in top level selector + foreach ($selectors as &$s) { + $this->expandParentSelectors($s, ""); + } + + return $selectors; + } + + $out = array(); + foreach ($parentSelectors as $parent) { + foreach ($selectors as $child) { + $count = $this->expandParentSelectors($child, $parent); + + // don't prepend the parent tag if & was used + if ($count > 0) { + $out[] = trim($child); + } else { + $out[] = trim($parent . ' ' . $child); + } + } + } + + return $out; + } + + // reduces selector expressions + protected function compileSelectors($selectors) { + $out = array(); + + foreach ($selectors as $s) { + if (is_array($s)) { + list(, $value) = $s; + $out[] = trim($this->compileValue($this->reduce($value))); + } else { + $out[] = $s; + } + } + + return $out; + } + + protected function eq($left, $right) { + return $left == $right; + } + + protected function patternMatch($block, $orderedArgs, $keywordArgs) { + // match the guards if it has them + // any one of the groups must have all its guards pass for a match + if (!empty($block->guards)) { + $groupPassed = false; + foreach ($block->guards as $guardGroup) { + foreach ($guardGroup as $guard) { + $this->pushEnv(); + $this->zipSetArgs($block->args, $orderedArgs, $keywordArgs); + + $negate = false; + if ($guard[0] == "negate") { + $guard = $guard[1]; + $negate = true; + } + + $passed = $this->reduce($guard) == self::$TRUE; + if ($negate) $passed = !$passed; + + $this->popEnv(); + + if ($passed) { + $groupPassed = true; + } else { + $groupPassed = false; + break; + } + } + + if ($groupPassed) break; + } + + if (!$groupPassed) { + return false; + } + } + + if (empty($block->args)) { + return $block->isVararg || empty($orderedArgs) && empty($keywordArgs); + } + + $remainingArgs = $block->args; + if ($keywordArgs) { + $remainingArgs = array(); + foreach ($block->args as $arg) { + if ($arg[0] == "arg" && isset($keywordArgs[$arg[1]])) { + continue; + } + + $remainingArgs[] = $arg; + } + } + + $i = -1; // no args + // try to match by arity or by argument literal + foreach ($remainingArgs as $i => $arg) { + switch ($arg[0]) { + case "lit": + if (empty($orderedArgs[$i]) || !$this->eq($arg[1], $orderedArgs[$i])) { + return false; + } + break; + case "arg": + // no arg and no default value + if (!isset($orderedArgs[$i]) && !isset($arg[2])) { + return false; + } + break; + case "rest": + $i--; // rest can be empty + break 2; + } + } + + if ($block->isVararg) { + return true; // not having enough is handled above + } else { + $numMatched = $i + 1; + // greater than because default values always match + return $numMatched >= count($orderedArgs); + } + } + + protected function patternMatchAll($blocks, $orderedArgs, $keywordArgs, $skip=array()) { + $matches = null; + foreach ($blocks as $block) { + // skip seen blocks that don't have arguments + if (isset($skip[$block->id]) && !isset($block->args)) { + continue; + } + + if ($this->patternMatch($block, $orderedArgs, $keywordArgs)) { + $matches[] = $block; + } + } + + return $matches; + } + + // attempt to find blocks matched by path and args + protected function findBlocks($searchIn, $path, $orderedArgs, $keywordArgs, $seen=array()) { + if ($searchIn == null) return null; + if (isset($seen[$searchIn->id])) return null; + $seen[$searchIn->id] = true; + + $name = $path[0]; + + if (isset($searchIn->children[$name])) { + $blocks = $searchIn->children[$name]; + if (count($path) == 1) { + $matches = $this->patternMatchAll($blocks, $orderedArgs, $keywordArgs, $seen); + if (!empty($matches)) { + // This will return all blocks that match in the closest + // scope that has any matching block, like lessjs + return $matches; + } + } else { + $matches = array(); + foreach ($blocks as $subBlock) { + $subMatches = $this->findBlocks($subBlock, + array_slice($path, 1), $orderedArgs, $keywordArgs, $seen); + + if (!is_null($subMatches)) { + foreach ($subMatches as $sm) { + $matches[] = $sm; + } + } + } + + return count($matches) > 0 ? $matches : null; + } + } + if ($searchIn->parent === $searchIn) return null; + return $this->findBlocks($searchIn->parent, $path, $orderedArgs, $keywordArgs, $seen); + } + + // sets all argument names in $args to either the default value + // or the one passed in through $values + protected function zipSetArgs($args, $orderedValues, $keywordValues) { + $assignedValues = array(); + + $i = 0; + foreach ($args as $a) { + if ($a[0] == "arg") { + if (isset($keywordValues[$a[1]])) { + // has keyword arg + $value = $keywordValues[$a[1]]; + } elseif (isset($orderedValues[$i])) { + // has ordered arg + $value = $orderedValues[$i]; + $i++; + } elseif (isset($a[2])) { + // has default value + $value = $a[2]; + } else { + $this->throwError("Failed to assign arg " . $a[1]); + $value = null; // :( + } + + $value = $this->reduce($value); + $this->set($a[1], $value); + $assignedValues[] = $value; + } else { + // a lit + $i++; + } + } + + // check for a rest + $last = end($args); + if ($last[0] == "rest") { + $rest = array_slice($orderedValues, count($args) - 1); + $this->set($last[1], $this->reduce(array("list", " ", $rest))); + } + + // wow is this the only true use of PHP's + operator for arrays? + $this->env->arguments = $assignedValues + $orderedValues; + } + + // compile a prop and update $lines or $blocks appropriately + protected function compileProp($prop, $block, $out) { + // set error position context + $this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1; + + switch ($prop[0]) { + case 'assign': + list(, $name, $value) = $prop; + if ($name[0] == $this->vPrefix) { + $this->set($name, $value); + } else { + $out->lines[] = $this->formatter->property($name, + $this->compileValue($this->reduce($value))); + } + break; + case 'block': + list(, $child) = $prop; + $this->compileBlock($child); + break; + case 'mixin': + list(, $path, $args, $suffix) = $prop; + + $orderedArgs = array(); + $keywordArgs = array(); + foreach ((array)$args as $arg) { + $argval = null; + switch ($arg[0]) { + case "arg": + if (!isset($arg[2])) { + $orderedArgs[] = $this->reduce(array("variable", $arg[1])); + } else { + $keywordArgs[$arg[1]] = $this->reduce($arg[2]); + } + break; + + case "lit": + $orderedArgs[] = $this->reduce($arg[1]); + break; + default: + $this->throwError("Unknown arg type: " . $arg[0]); + } + } + + $mixins = $this->findBlocks($block, $path, $orderedArgs, $keywordArgs); + + if ($mixins === null) { + $this->throwError("{$prop[1][0]} is undefined"); + } + + foreach ($mixins as $mixin) { + if ($mixin === $block && !$orderedArgs) { + continue; + } + + $haveScope = false; + if (isset($mixin->parent->scope)) { + $haveScope = true; + $mixinParentEnv = $this->pushEnv(); + $mixinParentEnv->storeParent = $mixin->parent->scope; + } + + $haveArgs = false; + if (isset($mixin->args)) { + $haveArgs = true; + $this->pushEnv(); + $this->zipSetArgs($mixin->args, $orderedArgs, $keywordArgs); + } + + $oldParent = $mixin->parent; + if ($mixin != $block) $mixin->parent = $block; + + foreach ($this->sortProps($mixin->props) as $subProp) { + if ($suffix !== null && + $subProp[0] == "assign" && + is_string($subProp[1]) && + $subProp[1]{0} != $this->vPrefix + ) { + $subProp[2] = array( + 'list', ' ', + array($subProp[2], array('keyword', $suffix)) + ); + } + + $this->compileProp($subProp, $mixin, $out); + } + + $mixin->parent = $oldParent; + + if ($haveArgs) $this->popEnv(); + if ($haveScope) $this->popEnv(); + } + + break; + case 'raw': + $out->lines[] = $prop[1]; + break; + case "directive": + list(, $name, $value) = $prop; + $out->lines[] = "@$name " . $this->compileValue($this->reduce($value)).';'; + break; + case "comment": + $out->lines[] = $prop[1]; + break; + case "import": + list(, $importPath, $importId) = $prop; + $importPath = $this->reduce($importPath); + + if (!isset($this->env->imports)) { + $this->env->imports = array(); + } + + $result = $this->tryImport($importPath, $block, $out); + + $this->env->imports[$importId] = $result === false ? + array(false, "@import " . $this->compileValue($importPath).";") : + $result; + + break; + case "import_mixin": + list(,$importId) = $prop; + $import = $this->env->imports[$importId]; + if ($import[0] === false) { + if (isset($import[1])) { + $out->lines[] = $import[1]; + } + } else { + list(, $bottom, $parser, $importDir) = $import; + $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); + } + + break; + default: + $this->throwError("unknown op: {$prop[0]}\n"); + } + } + + + /** + * Compiles a primitive value into a CSS property value. + * + * Values in lessphp are typed by being wrapped in arrays, their format is + * typically: + * + * array(type, contents [, additional_contents]*) + * + * The input is expected to be reduced. This function will not work on + * things like expressions and variables. + */ + public function compileValue($value) { + switch ($value[0]) { + case 'list': + // [1] - delimiter + // [2] - array of values + return implode($value[1], array_map(array($this, 'compileValue'), $value[2])); + case 'raw_color': + if (!empty($this->formatter->compressColors)) { + return $this->compileValue($this->coerceColor($value)); + } + return $value[1]; + case 'keyword': + // [1] - the keyword + return $value[1]; + case 'number': + list(, $num, $unit) = $value; + // [1] - the number + // [2] - the unit + if ($this->numberPrecision !== null) { + $num = round($num, $this->numberPrecision); + } + return $num . $unit; + case 'string': + // [1] - contents of string (includes quotes) + list(, $delim, $content) = $value; + foreach ($content as &$part) { + if (is_array($part)) { + $part = $this->compileValue($part); + } + } + return $delim . implode($content) . $delim; + case 'color': + // [1] - red component (either number or a %) + // [2] - green component + // [3] - blue component + // [4] - optional alpha component + list(, $r, $g, $b) = $value; + $r = round($r); + $g = round($g); + $b = round($b); + + if (count($value) == 5 && $value[4] != 1) { // rgba + return 'rgba('.$r.','.$g.','.$b.','.$value[4].')'; + } + + $h = sprintf("#%02x%02x%02x", $r, $g, $b); + + if (!empty($this->formatter->compressColors)) { + // Converting hex color to short notation (e.g. #003399 to #039) + if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { + $h = '#' . $h[1] . $h[3] . $h[5]; + } + } + + return $h; + + case 'function': + list(, $name, $args) = $value; + return $name.'('.$this->compileValue($args).')'; + default: // assumed to be unit + $this->throwError("unknown value type: $value[0]"); + } + } + + protected function lib_pow($args) { + list($base, $exp) = $this->assertArgs($args, 2, "pow"); + return pow($this->assertNumber($base), $this->assertNumber($exp)); + } + + protected function lib_pi() { + return pi(); + } + + protected function lib_mod($args) { + list($a, $b) = $this->assertArgs($args, 2, "mod"); + return $this->assertNumber($a) % $this->assertNumber($b); + } + + protected function lib_tan($num) { + return tan($this->assertNumber($num)); + } + + protected function lib_sin($num) { + return sin($this->assertNumber($num)); + } + + protected function lib_cos($num) { + return cos($this->assertNumber($num)); + } + + protected function lib_atan($num) { + $num = atan($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_asin($num) { + $num = asin($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_acos($num) { + $num = acos($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_sqrt($num) { + return sqrt($this->assertNumber($num)); + } + + protected function lib_extract($value) { + list($list, $idx) = $this->assertArgs($value, 2, "extract"); + $idx = $this->assertNumber($idx); + // 1 indexed + if ($list[0] == "list" && isset($list[2][$idx - 1])) { + return $list[2][$idx - 1]; + } + } + + protected function lib_isnumber($value) { + return $this->toBool($value[0] == "number"); + } + + protected function lib_isstring($value) { + return $this->toBool($value[0] == "string"); + } + + protected function lib_iscolor($value) { + return $this->toBool($this->coerceColor($value)); + } + + protected function lib_iskeyword($value) { + return $this->toBool($value[0] == "keyword"); + } + + protected function lib_ispixel($value) { + return $this->toBool($value[0] == "number" && $value[2] == "px"); + } + + protected function lib_ispercentage($value) { + return $this->toBool($value[0] == "number" && $value[2] == "%"); + } + + protected function lib_isem($value) { + return $this->toBool($value[0] == "number" && $value[2] == "em"); + } + + protected function lib_isrem($value) { + return $this->toBool($value[0] == "number" && $value[2] == "rem"); + } + + protected function lib_rgbahex($color) { + $color = $this->coerceColor($color); + if (is_null($color)) { + $this->throwError("color expected for rgbahex"); + } + + return sprintf("#%02x%02x%02x%02x", + isset($color[4]) ? $color[4] * 255 : 255, + $color[1], + $color[2], + $color[3] + ); + } + + protected function lib_argb($color){ + return $this->lib_rgbahex($color); + } + + /** + * Given an url, decide whether to output a regular link or the base64-encoded contents of the file + * + * @param array $value either an argument list (two strings) or a single string + * @return string formatted url(), either as a link or base64-encoded + */ + protected function lib_data_uri($value) { + $mime = ($value[0] === 'list') ? $value[2][0][2] : null; + $url = ($value[0] === 'list') ? $value[2][1][2][0] : $value[2][0]; + + $fullpath = $this->findImport($url); + + if ($fullpath && ($fsize = filesize($fullpath)) !== false) { + // IE8 can't handle data uris larger than 32KB + if ($fsize/1024 < 32) { + if (is_null($mime)) { + if (class_exists('finfo')) { // php 5.3+ + $finfo = new finfo(FILEINFO_MIME); + $mime = explode('; ', $finfo->file($fullpath)); + $mime = $mime[0]; + } elseif (function_exists('mime_content_type')) { // PHP 5.2 + $mime = mime_content_type($fullpath); + } + } + + if (!is_null($mime)) // fallback if the mime type is still unknown + $url = sprintf('data:%s;base64,%s', $mime, base64_encode(file_get_contents($fullpath))); + } + } + + return 'url("'.$url.'")'; + } + + // utility func to unquote a string + protected function lib_e($arg) { + switch ($arg[0]) { + case "list": + $items = $arg[2]; + if (isset($items[0])) { + return $this->lib_e($items[0]); + } + $this->throwError("unrecognised input"); + case "string": + $arg[1] = ""; + return $arg; + case "keyword": + return $arg; + default: + return array("keyword", $this->compileValue($arg)); + } + } + + protected function lib__sprintf($args) { + if ($args[0] != "list") return $args; + $values = $args[2]; + $string = array_shift($values); + $template = $this->compileValue($this->lib_e($string)); + + $i = 0; + if (preg_match_all('/%[dsa]/', $template, $m)) { + foreach ($m[0] as $match) { + $val = isset($values[$i]) ? + $this->reduce($values[$i]) : array('keyword', ''); + + // lessjs compat, renders fully expanded color, not raw color + if ($color = $this->coerceColor($val)) { + $val = $color; + } + + $i++; + $rep = $this->compileValue($this->lib_e($val)); + $template = preg_replace('/'.self::preg_quote($match).'/', + $rep, $template, 1); + } + } + + $d = $string[0] == "string" ? $string[1] : '"'; + return array("string", $d, array($template)); + } + + protected function lib_floor($arg) { + $value = $this->assertNumber($arg); + return array("number", floor($value), $arg[2]); + } + + protected function lib_ceil($arg) { + $value = $this->assertNumber($arg); + return array("number", ceil($value), $arg[2]); + } + + protected function lib_round($arg) { + if ($arg[0] != "list") { + $value = $this->assertNumber($arg); + return array("number", round($value), $arg[2]); + } else { + $value = $this->assertNumber($arg[2][0]); + $precision = $this->assertNumber($arg[2][1]); + return array("number", round($value, $precision), $arg[2][0][2]); + } + } + + protected function lib_unit($arg) { + if ($arg[0] == "list") { + list($number, $newUnit) = $arg[2]; + return array("number", $this->assertNumber($number), + $this->compileValue($this->lib_e($newUnit))); + } else { + return array("number", $this->assertNumber($arg), ""); + } + } + + /** + * Helper function to get arguments for color manipulation functions. + * takes a list that contains a color like thing and a percentage + */ + public function colorArgs($args) { + if ($args[0] != 'list' || count($args[2]) < 2) { + return array(array('color', 0, 0, 0), 0); + } + list($color, $delta) = $args[2]; + $color = $this->assertColor($color); + $delta = floatval($delta[1]); + + return array($color, $delta); + } + + protected function lib_darken($args) { + list($color, $delta) = $this->colorArgs($args); + + $hsl = $this->toHSL($color); + $hsl[3] = $this->clamp($hsl[3] - $delta, 100); + return $this->toRGB($hsl); + } + + protected function lib_lighten($args) { + list($color, $delta) = $this->colorArgs($args); + + $hsl = $this->toHSL($color); + $hsl[3] = $this->clamp($hsl[3] + $delta, 100); + return $this->toRGB($hsl); + } + + protected function lib_saturate($args) { + list($color, $delta) = $this->colorArgs($args); + + $hsl = $this->toHSL($color); + $hsl[2] = $this->clamp($hsl[2] + $delta, 100); + return $this->toRGB($hsl); + } + + protected function lib_desaturate($args) { + list($color, $delta) = $this->colorArgs($args); + + $hsl = $this->toHSL($color); + $hsl[2] = $this->clamp($hsl[2] - $delta, 100); + return $this->toRGB($hsl); + } + + protected function lib_spin($args) { + list($color, $delta) = $this->colorArgs($args); + + $hsl = $this->toHSL($color); + + $hsl[1] = $hsl[1] + $delta % 360; + if ($hsl[1] < 0) { + $hsl[1] += 360; + } + + return $this->toRGB($hsl); + } + + protected function lib_fadeout($args) { + list($color, $delta) = $this->colorArgs($args); + $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) - $delta/100); + return $color; + } + + protected function lib_fadein($args) { + list($color, $delta) = $this->colorArgs($args); + $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) + $delta/100); + return $color; + } + + protected function lib_hue($color) { + $hsl = $this->toHSL($this->assertColor($color)); + return round($hsl[1]); + } + + protected function lib_saturation($color) { + $hsl = $this->toHSL($this->assertColor($color)); + return round($hsl[2]); + } + + protected function lib_lightness($color) { + $hsl = $this->toHSL($this->assertColor($color)); + return round($hsl[3]); + } + + // get the alpha of a color + // defaults to 1 for non-colors or colors without an alpha + protected function lib_alpha($value) { + if (!is_null($color = $this->coerceColor($value))) { + return isset($color[4]) ? $color[4] : 1; + } + } + + // set the alpha of the color + protected function lib_fade($args) { + list($color, $alpha) = $this->colorArgs($args); + $color[4] = $this->clamp($alpha / 100.0); + return $color; + } + + protected function lib_percentage($arg) { + $num = $this->assertNumber($arg); + return array("number", $num*100, "%"); + } + + /** + * Mix color with white in variable proportion. + * + * It is the same as calling `mix(#ffffff, @color, @weight)`. + * + * tint(@color, [@weight: 50%]); + * + * http://lesscss.org/functions/#color-operations-tint + * + * @return array Color + */ + protected function lib_tint($args) { + $white = ['color', 255, 255, 255]; + if ($args[0] == 'color') { + return $this->lib_mix([ 'list', ',', [$white, $args] ]); + } elseif ($args[0] == "list" && count($args[2]) == 2) { + return $this->lib_mix([ $args[0], $args[1], [$white, $args[2][0], $args[2][1]] ]); + } else { + $this->throwError("tint expects (color, weight)"); + } + } + + /** + * Mix color with black in variable proportion. + * + * It is the same as calling `mix(#000000, @color, @weight)` + * + * shade(@color, [@weight: 50%]); + * + * http://lesscss.org/functions/#color-operations-shade + * + * @return array Color + */ + protected function lib_shade($args) { + $black = ['color', 0, 0, 0]; + if ($args[0] == 'color') { + return $this->lib_mix([ 'list', ',', [$black, $args] ]); + } elseif ($args[0] == "list" && count($args[2]) == 2) { + return $this->lib_mix([ $args[0], $args[1], [$black, $args[2][0], $args[2][1]] ]); + } else { + $this->throwError("shade expects (color, weight)"); + } + } + + // mixes two colors by weight + // mix(@color1, @color2, [@weight: 50%]); + // http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method + protected function lib_mix($args) { + if ($args[0] != "list" || count($args[2]) < 2) + $this->throwError("mix expects (color1, color2, weight)"); + + list($first, $second) = $args[2]; + $first = $this->assertColor($first); + $second = $this->assertColor($second); + + $first_a = $this->lib_alpha($first); + $second_a = $this->lib_alpha($second); + + if (isset($args[2][2])) { + $weight = $args[2][2][1] / 100.0; + } else { + $weight = 0.5; + } + + $w = $weight * 2 - 1; + $a = $first_a - $second_a; + + $w1 = (($w * $a == -1 ? $w : ($w + $a)/(1 + $w * $a)) + 1) / 2.0; + $w2 = 1.0 - $w1; + + $new = array('color', + $w1 * $first[1] + $w2 * $second[1], + $w1 * $first[2] + $w2 * $second[2], + $w1 * $first[3] + $w2 * $second[3], + ); + + if ($first_a != 1.0 || $second_a != 1.0) { + $new[] = $first_a * $weight + $second_a * ($weight - 1); + } + + return $this->fixColor($new); + } + + protected function lib_contrast($args) { + $darkColor = array('color', 0, 0, 0); + $lightColor = array('color', 255, 255, 255); + $threshold = 0.43; + + if ( $args[0] == 'list' ) { + $inputColor = ( isset($args[2][0]) ) ? $this->assertColor($args[2][0]) : $lightColor; + $darkColor = ( isset($args[2][1]) ) ? $this->assertColor($args[2][1]) : $darkColor; + $lightColor = ( isset($args[2][2]) ) ? $this->assertColor($args[2][2]) : $lightColor; + $threshold = ( isset($args[2][3]) ) ? $this->assertNumber($args[2][3]) : $threshold; + } + else { + $inputColor = $this->assertColor($args); + } + + $inputColor = $this->coerceColor($inputColor); + $darkColor = $this->coerceColor($darkColor); + $lightColor = $this->coerceColor($lightColor); + + //Figure out which is actually light and dark! + if ( $this->toLuma($darkColor) > $this->toLuma($lightColor) ) { + $t = $lightColor; + $lightColor = $darkColor; + $darkColor = $t; + } + + $inputColor_alpha = $this->lib_alpha($inputColor); + if ( ( $this->toLuma($inputColor) * $inputColor_alpha) < $threshold) { + return $lightColor; + } + return $darkColor; + } + + private function toLuma($color) { + list(, $r, $g, $b) = $this->coerceColor($color); + + $r = $r / 255; + $g = $g / 255; + $b = $b / 255; + + $r = ($r <= 0.03928) ? $r / 12.92 : pow((($r + 0.055) / 1.055), 2.4); + $g = ($g <= 0.03928) ? $g / 12.92 : pow((($g + 0.055) / 1.055), 2.4); + $b = ($b <= 0.03928) ? $b / 12.92 : pow((($b + 0.055) / 1.055), 2.4); + + return (0.2126 * $r) + (0.7152 * $g) + (0.0722 * $b); + } + + protected function lib_luma($color) { + return array("number", round($this->toLuma($color) * 100, 8), "%"); + } + + + public function assertColor($value, $error = "expected color value") { + $color = $this->coerceColor($value); + if (is_null($color)) $this->throwError($error); + return $color; + } + + public function assertNumber($value, $error = "expecting number") { + if ($value[0] == "number") return $value[1]; + $this->throwError($error); + } + + public function assertArgs($value, $expectedArgs, $name="") { + if ($expectedArgs == 1) { + return $value; + } else { + if ($value[0] !== "list" || $value[1] != ",") $this->throwError("expecting list"); + $values = $value[2]; + $numValues = count($values); + if ($expectedArgs != $numValues) { + if ($name) { + $name = $name . ": "; + } + + $this->throwError("${name}expecting $expectedArgs arguments, got $numValues"); + } + + return $values; + } + } + + protected function toHSL($color) { + if ($color[0] === 'hsl') { + return $color; + } + + $r = $color[1] / 255; + $g = $color[2] / 255; + $b = $color[3] / 255; + + $min = min($r, $g, $b); + $max = max($r, $g, $b); + + $L = ($min + $max) / 2; + if ($min == $max) { + $S = $H = 0; + } else { + if ($L < 0.5) { + $S = ($max - $min) / ($max + $min); + } else { + $S = ($max - $min) / (2.0 - $max - $min); + } + if ($r == $max) { + $H = ($g - $b) / ($max - $min); + } elseif ($g == $max) { + $H = 2.0 + ($b - $r) / ($max - $min); + } elseif ($b == $max) { + $H = 4.0 + ($r - $g) / ($max - $min); + } + + } + + $out = array('hsl', + ($H < 0 ? $H + 6 : $H)*60, + $S * 100, + $L * 100, + ); + + if (count($color) > 4) { + // copy alpha + $out[] = $color[4]; + } + return $out; + } + + protected function toRGB_helper($comp, $temp1, $temp2) { + if ($comp < 0) { + $comp += 1.0; + } elseif ($comp > 1) { + $comp -= 1.0; + } + + if (6 * $comp < 1) { + return $temp1 + ($temp2 - $temp1) * 6 * $comp; + } + if (2 * $comp < 1) { + return $temp2; + } + if (3 * $comp < 2) { + return $temp1 + ($temp2 - $temp1)*((2/3) - $comp) * 6; + } + + return $temp1; + } + + /** + * Converts a hsl array into a color value in rgb. + * Expects H to be in range of 0 to 360, S and L in 0 to 100 + */ + protected function toRGB($color) { + if ($color[0] === 'color') { + return $color; + } + + $H = $color[1] / 360; + $S = $color[2] / 100; + $L = $color[3] / 100; + + if ($S == 0) { + $r = $g = $b = $L; + } else { + $temp2 = $L < 0.5 ? + $L * (1.0 + $S) : + $L + $S - $L * $S; + + $temp1 = 2.0 * $L - $temp2; + + $r = $this->toRGB_helper($H + 1/3, $temp1, $temp2); + $g = $this->toRGB_helper($H, $temp1, $temp2); + $b = $this->toRGB_helper($H - 1/3, $temp1, $temp2); + } + + // $out = array('color', round($r*255), round($g*255), round($b*255)); + $out = array('color', $r*255, $g*255, $b*255); + if (count($color) > 4) { + // copy alpha + $out[] = $color[4]; + } + return $out; + } + + protected function clamp($v, $max = 1, $min = 0) { + return min($max, max($min, $v)); + } + + /** + * Convert the rgb, rgba, hsl color literals of function type + * as returned by the parser into values of color type. + */ + protected function funcToColor($func) { + $fname = $func[1]; + if ($func[2][0] != 'list') { + // need a list of arguments + return false; + } + $rawComponents = $func[2][2]; + + if ($fname == 'hsl' || $fname == 'hsla') { + $hsl = array('hsl'); + $i = 0; + foreach ($rawComponents as $c) { + $val = $this->reduce($c); + $val = isset($val[1]) ? floatval($val[1]) : 0; + + if ($i == 0) { + $clamp = 360; + } elseif ($i < 3) { + $clamp = 100; + } else { + $clamp = 1; + } + + $hsl[] = $this->clamp($val, $clamp); + $i++; + } + + while (count($hsl) < 4) { + $hsl[] = 0; + } + return $this->toRGB($hsl); + + } elseif ($fname == 'rgb' || $fname == 'rgba') { + $components = array(); + $i = 1; + foreach ($rawComponents as $c) { + $c = $this->reduce($c); + if ($i < 4) { + if ($c[0] == "number" && $c[2] == "%") { + $components[] = 255 * ($c[1] / 100); + } else { + $components[] = floatval($c[1]); + } + } elseif ($i == 4) { + if ($c[0] == "number" && $c[2] == "%") { + $components[] = 1.0 * ($c[1] / 100); + } else { + $components[] = floatval($c[1]); + } + } else break; + + $i++; + } + while (count($components) < 3) { + $components[] = 0; + } + array_unshift($components, 'color'); + return $this->fixColor($components); + } + + return false; + } + + protected function reduce($value, $forExpression = false) { + switch ($value[0]) { + case "interpolate": + $reduced = $this->reduce($value[1]); + $var = $this->compileValue($reduced); + $res = $this->reduce(array("variable", $this->vPrefix . $var)); + + if ($res[0] == "raw_color") { + $res = $this->coerceColor($res); + } + + if (empty($value[2])) $res = $this->lib_e($res); + + return $res; + case "variable": + $key = $value[1]; + if (is_array($key)) { + $key = $this->reduce($key); + $key = $this->vPrefix . $this->compileValue($this->lib_e($key)); + } + + $seen =& $this->env->seenNames; + + if (!empty($seen[$key])) { + $this->throwError("infinite loop detected: $key"); + } + + $seen[$key] = true; + $out = $this->reduce($this->get($key)); + $seen[$key] = false; + return $out; + case "list": + foreach ($value[2] as &$item) { + $item = $this->reduce($item, $forExpression); + } + return $value; + case "expression": + return $this->evaluate($value); + case "string": + foreach ($value[2] as &$part) { + if (is_array($part)) { + $strip = $part[0] == "variable"; + $part = $this->reduce($part); + if ($strip) $part = $this->lib_e($part); + } + } + return $value; + case "escape": + list(,$inner) = $value; + return $this->lib_e($this->reduce($inner)); + case "function": + $color = $this->funcToColor($value); + if ($color) return $color; + + list(, $name, $args) = $value; + if ($name == "%") $name = "_sprintf"; + + $f = isset($this->libFunctions[$name]) ? + $this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name)); + + if (is_callable($f)) { + if ($args[0] == 'list') + $args = self::compressList($args[2], $args[1]); + + $ret = call_user_func($f, $this->reduce($args, true), $this); + + if (is_null($ret)) { + return array("string", "", array( + $name, "(", $args, ")" + )); + } + + // convert to a typed value if the result is a php primitive + if (is_numeric($ret)) { + $ret = array('number', $ret, ""); + } elseif (!is_array($ret)) { + $ret = array('keyword', $ret); + } + + return $ret; + } + + // plain function, reduce args + $value[2] = $this->reduce($value[2]); + return $value; + case "unary": + list(, $op, $exp) = $value; + $exp = $this->reduce($exp); + + if ($exp[0] == "number") { + switch ($op) { + case "+": + return $exp; + case "-": + $exp[1] *= -1; + return $exp; + } + } + return array("string", "", array($op, $exp)); + } + + if ($forExpression) { + switch ($value[0]) { + case "keyword": + if ($color = $this->coerceColor($value)) { + return $color; + } + break; + case "raw_color": + return $this->coerceColor($value); + } + } + + return $value; + } + + + // coerce a value for use in color operation + protected function coerceColor($value) { + switch ($value[0]) { + case 'color': return $value; + case 'raw_color': + $c = array("color", 0, 0, 0); + $colorStr = substr($value[1], 1); + $num = hexdec($colorStr); + $width = strlen($colorStr) == 3 ? 16 : 256; + + for ($i = 3; $i > 0; $i--) { // 3 2 1 + $t = $num % $width; + $num /= $width; + + $c[$i] = $t * (256/$width) + $t * floor(16/$width); + } + + return $c; + case 'keyword': + $name = $value[1]; + if (isset(self::$cssColors[$name])) { + $rgba = explode(',', self::$cssColors[$name]); + + if (isset($rgba[3])) { + return array('color', $rgba[0], $rgba[1], $rgba[2], $rgba[3]); + } + return array('color', $rgba[0], $rgba[1], $rgba[2]); + } + return null; + } + } + + // make something string like into a string + protected function coerceString($value) { + switch ($value[0]) { + case "string": + return $value; + case "keyword": + return array("string", "", array($value[1])); + } + return null; + } + + // turn list of length 1 into value type + protected function flattenList($value) { + if ($value[0] == "list" && count($value[2]) == 1) { + return $this->flattenList($value[2][0]); + } + return $value; + } + + public function toBool($a) { + return $a ? self::$TRUE : self::$FALSE; + } + + // evaluate an expression + protected function evaluate($exp) { + list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp; + + $left = $this->reduce($left, true); + $right = $this->reduce($right, true); + + if ($leftColor = $this->coerceColor($left)) { + $left = $leftColor; + } + + if ($rightColor = $this->coerceColor($right)) { + $right = $rightColor; + } + + $ltype = $left[0]; + $rtype = $right[0]; + + // operators that work on all types + if ($op == "and") { + return $this->toBool($left == self::$TRUE && $right == self::$TRUE); + } + + if ($op == "=") { + return $this->toBool($this->eq($left, $right) ); + } + + if ($op == "+" && !is_null($str = $this->stringConcatenate($left, $right))) { + return $str; + } + + // type based operators + $fname = "op_${ltype}_${rtype}"; + if (is_callable(array($this, $fname))) { + $out = $this->$fname($op, $left, $right); + if (!is_null($out)) return $out; + } + + // make the expression look it did before being parsed + $paddedOp = $op; + if ($whiteBefore) { + $paddedOp = " " . $paddedOp; + } + if ($whiteAfter) { + $paddedOp .= " "; + } + + return array("string", "", array($left, $paddedOp, $right)); + } + + protected function stringConcatenate($left, $right) { + if ($strLeft = $this->coerceString($left)) { + if ($right[0] == "string") { + $right[1] = ""; + } + $strLeft[2][] = $right; + return $strLeft; + } + + if ($strRight = $this->coerceString($right)) { + array_unshift($strRight[2], $left); + return $strRight; + } + } + + + // make sure a color's components don't go out of bounds + protected function fixColor($c) { + foreach (range(1, 3) as $i) { + if ($c[$i] < 0) $c[$i] = 0; + if ($c[$i] > 255) $c[$i] = 255; + } + + return $c; + } + + protected function op_number_color($op, $lft, $rgt) { + if ($op == '+' || $op == '*') { + return $this->op_color_number($op, $rgt, $lft); + } + } + + protected function op_color_number($op, $lft, $rgt) { + if ($rgt[0] == '%') $rgt[1] /= 100; + + return $this->op_color_color($op, $lft, + array_fill(1, count($lft) - 1, $rgt[1])); + } + + protected function op_color_color($op, $left, $right) { + $out = array('color'); + $max = count($left) > count($right) ? count($left) : count($right); + foreach (range(1, $max - 1) as $i) { + $lval = isset($left[$i]) ? $left[$i] : 0; + $rval = isset($right[$i]) ? $right[$i] : 0; + switch ($op) { + case '+': + $out[] = $lval + $rval; + break; + case '-': + $out[] = $lval - $rval; + break; + case '*': + $out[] = $lval * $rval; + break; + case '%': + $out[] = $lval % $rval; + break; + case '/': + if ($rval == 0) { + $this->throwError("evaluate error: can't divide by zero"); + } + $out[] = $lval / $rval; + break; + default: + $this->throwError('evaluate error: color op number failed on op '.$op); + } + } + return $this->fixColor($out); + } + + public function lib_red($color){ + $color = $this->coerceColor($color); + if (is_null($color)) { + $this->throwError('color expected for red()'); + } + + return $color[1]; + } + + public function lib_green($color){ + $color = $this->coerceColor($color); + if (is_null($color)) { + $this->throwError('color expected for green()'); + } + + return $color[2]; + } + + public function lib_blue($color){ + $color = $this->coerceColor($color); + if (is_null($color)) { + $this->throwError('color expected for blue()'); + } + + return $color[3]; + } + + + // operator on two numbers + protected function op_number_number($op, $left, $right) { + $unit = empty($left[2]) ? $right[2] : $left[2]; + + $value = 0; + switch ($op) { + case '+': + $value = $left[1] + $right[1]; + break; + case '*': + $value = $left[1] * $right[1]; + break; + case '-': + $value = $left[1] - $right[1]; + break; + case '%': + $value = $left[1] % $right[1]; + break; + case '/': + if ($right[1] == 0) $this->throwError('parse error: divide by zero'); + $value = $left[1] / $right[1]; + break; + case '<': + return $this->toBool($left[1] < $right[1]); + case '>': + return $this->toBool($left[1] > $right[1]); + case '>=': + return $this->toBool($left[1] >= $right[1]); + case '=<': + return $this->toBool($left[1] <= $right[1]); + default: + $this->throwError('parse error: unknown number operator: '.$op); + } + + return array("number", $value, $unit); + } + + + /* environment functions */ + + protected function makeOutputBlock($type, $selectors = null) { + $b = new stdclass; + $b->lines = array(); + $b->children = array(); + $b->selectors = $selectors; + $b->type = $type; + $b->parent = $this->scope; + return $b; + } + + // the state of execution + protected function pushEnv($block = null) { + $e = new stdclass; + $e->parent = $this->env; + $e->store = array(); + $e->block = $block; + + $this->env = $e; + return $e; + } + + // pop something off the stack + protected function popEnv() { + $old = $this->env; + $this->env = $this->env->parent; + return $old; + } + + // set something in the current env + protected function set($name, $value) { + $this->env->store[$name] = $value; + } + + + // get the highest occurrence entry for a name + protected function get($name) { + $current = $this->env; + + $isArguments = $name == $this->vPrefix . 'arguments'; + while ($current) { + if ($isArguments && isset($current->arguments)) { + return array('list', ' ', $current->arguments); + } + + if (isset($current->store[$name])) { + return $current->store[$name]; + } + + $current = isset($current->storeParent) ? + $current->storeParent : + $current->parent; + } + + $this->throwError("variable $name is undefined"); + } + + // inject array of unparsed strings into environment as variables + protected function injectVariables($args) { + $this->pushEnv(); + $parser = new lessc_parser($this, __METHOD__); + foreach ($args as $name => $strValue) { + if ($name{0} !== '@') { + $name = '@' . $name; + } + $parser->count = 0; + $parser->buffer = (string)$strValue; + if (!$parser->propertyValue($value)) { + throw new Exception("failed to parse passed in variable $name: $strValue"); + } + + $this->set($name, $value); + } + } + + /** + * Initialize any static state, can initialize parser for a file + * $opts isn't used yet + */ + public function __construct($fname = null) { + if ($fname !== null) { + // used for deprecated parse method + $this->_parseFile = $fname; + } + } + + public function compile($string, $name = null) { + $locale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + + $this->parser = $this->makeParser($name); + $root = $this->parser->parse($string); + + $this->env = null; + $this->scope = null; + + $this->formatter = $this->newFormatter(); + + if (!empty($this->registeredVars)) { + $this->injectVariables($this->registeredVars); + } + + $this->sourceParser = $this->parser; // used for error messages + $this->compileBlock($root); + + ob_start(); + $this->formatter->block($this->scope); + $out = ob_get_clean(); + setlocale(LC_NUMERIC, $locale); + return $out; + } + + public function compileFile($fname, $outFname = null) { + if (!is_readable($fname)) { + throw new Exception('load error: failed to find '.$fname); + } + + $pi = pathinfo($fname); + + $oldImport = $this->importDir; + + $this->importDir = (array)$this->importDir; + $this->importDir[] = $pi['dirname'].'/'; + + $this->addParsedFile($fname); + + $out = $this->compile(file_get_contents($fname), $fname); + + $this->importDir = $oldImport; + + if ($outFname !== null) { + return file_put_contents($outFname, $out); + } + + return $out; + } + + // compile only if changed input has changed or output doesn't exist + public function checkedCompile($in, $out) { + if (!is_file($out) || filemtime($in) > filemtime($out)) { + $this->compileFile($in, $out); + return true; + } + return false; + } + + /** + * Execute lessphp on a .less file or a lessphp cache structure + * + * The lessphp cache structure contains information about a specific + * less file having been parsed. It can be used as a hint for future + * calls to determine whether or not a rebuild is required. + * + * The cache structure contains two important keys that may be used + * externally: + * + * compiled: The final compiled CSS + * updated: The time (in seconds) the CSS was last compiled + * + * The cache structure is a plain-ol' PHP associative array and can + * be serialized and unserialized without a hitch. + * + * @param mixed $in Input + * @param bool $force Force rebuild? + * @return array lessphp cache structure + */ + public function cachedCompile($in, $force = false) { + // assume no root + $root = null; + + if (is_string($in)) { + $root = $in; + } elseif (is_array($in) && isset($in['root'])) { + if ($force || !isset($in['files'])) { + // If we are forcing a recompile or if for some reason the + // structure does not contain any file information we should + // specify the root to trigger a rebuild. + $root = $in['root']; + } elseif (isset($in['files']) && is_array($in['files'])) { + foreach ($in['files'] as $fname => $ftime) { + if (!file_exists($fname) || filemtime($fname) > $ftime) { + // One of the files we knew about previously has changed + // so we should look at our incoming root again. + $root = $in['root']; + break; + } + } + } + } else { + // TODO: Throw an exception? We got neither a string nor something + // that looks like a compatible lessphp cache structure. + return null; + } + + if ($root !== null) { + // If we have a root value which means we should rebuild. + $out = array(); + $out['root'] = $root; + $out['compiled'] = $this->compileFile($root); + $out['files'] = $this->allParsedFiles(); + $out['updated'] = time(); + return $out; + } else { + // No changes, pass back the structure + // we were given initially. + return $in; + } + + } + + // parse and compile buffer + // This is deprecated + public function parse($str = null, $initialVariables = null) { + if (is_array($str)) { + $initialVariables = $str; + $str = null; + } + + $oldVars = $this->registeredVars; + if ($initialVariables !== null) { + $this->setVariables($initialVariables); + } + + if ($str == null) { + if (empty($this->_parseFile)) { + throw new exception("nothing to parse"); + } + + $out = $this->compileFile($this->_parseFile); + } else { + $out = $this->compile($str); + } + + $this->registeredVars = $oldVars; + return $out; + } + + protected function makeParser($name) { + $parser = new lessc_parser($this, $name); + $parser->writeComments = $this->preserveComments; + + return $parser; + } + + public function setFormatter($name) { + $this->formatterName = $name; + } + + protected function newFormatter() { + $className = "lessc_formatter_lessjs"; + if (!empty($this->formatterName)) { + if (!is_string($this->formatterName)) + return $this->formatterName; + $className = "lessc_formatter_$this->formatterName"; + } + + return new $className; + } + + public function setPreserveComments($preserve) { + $this->preserveComments = $preserve; + } + + public function registerFunction($name, $func) { + $this->libFunctions[$name] = $func; + } + + public function unregisterFunction($name) { + unset($this->libFunctions[$name]); + } + + public function setVariables($variables) { + $this->registeredVars = array_merge($this->registeredVars, $variables); + } + + public function unsetVariable($name) { + unset($this->registeredVars[$name]); + } + + public function setImportDir($dirs) { + $this->importDir = (array)$dirs; + } + + public function addImportDir($dir) { + $this->importDir = (array)$this->importDir; + $this->importDir[] = $dir; + } + + public function allParsedFiles() { + return $this->allParsedFiles; + } + + public function addParsedFile($file) { + $this->allParsedFiles[realpath($file)] = filemtime($file); + } + + /** + * Uses the current value of $this->count to show line and line number + */ + public function throwError($msg = null) { + if ($this->sourceLoc >= 0) { + $this->sourceParser->throwError($msg, $this->sourceLoc); + } + throw new exception($msg); + } + + // compile file $in to file $out if $in is newer than $out + // returns true when it compiles, false otherwise + public static function ccompile($in, $out, $less = null) { + if ($less === null) { + $less = new self; + } + return $less->checkedCompile($in, $out); + } + + public static function cexecute($in, $force = false, $less = null) { + if ($less === null) { + $less = new self; + } + return $less->cachedCompile($in, $force); + } + + static protected $cssColors = array( + 'aliceblue' => '240,248,255', + 'antiquewhite' => '250,235,215', + 'aqua' => '0,255,255', + 'aquamarine' => '127,255,212', + 'azure' => '240,255,255', + 'beige' => '245,245,220', + 'bisque' => '255,228,196', + 'black' => '0,0,0', + 'blanchedalmond' => '255,235,205', + 'blue' => '0,0,255', + 'blueviolet' => '138,43,226', + 'brown' => '165,42,42', + 'burlywood' => '222,184,135', + 'cadetblue' => '95,158,160', + 'chartreuse' => '127,255,0', + 'chocolate' => '210,105,30', + 'coral' => '255,127,80', + 'cornflowerblue' => '100,149,237', + 'cornsilk' => '255,248,220', + 'crimson' => '220,20,60', + 'cyan' => '0,255,255', + 'darkblue' => '0,0,139', + 'darkcyan' => '0,139,139', + 'darkgoldenrod' => '184,134,11', + 'darkgray' => '169,169,169', + 'darkgreen' => '0,100,0', + 'darkgrey' => '169,169,169', + 'darkkhaki' => '189,183,107', + 'darkmagenta' => '139,0,139', + 'darkolivegreen' => '85,107,47', + 'darkorange' => '255,140,0', + 'darkorchid' => '153,50,204', + 'darkred' => '139,0,0', + 'darksalmon' => '233,150,122', + 'darkseagreen' => '143,188,143', + 'darkslateblue' => '72,61,139', + 'darkslategray' => '47,79,79', + 'darkslategrey' => '47,79,79', + 'darkturquoise' => '0,206,209', + 'darkviolet' => '148,0,211', + 'deeppink' => '255,20,147', + 'deepskyblue' => '0,191,255', + 'dimgray' => '105,105,105', + 'dimgrey' => '105,105,105', + 'dodgerblue' => '30,144,255', + 'firebrick' => '178,34,34', + 'floralwhite' => '255,250,240', + 'forestgreen' => '34,139,34', + 'fuchsia' => '255,0,255', + 'gainsboro' => '220,220,220', + 'ghostwhite' => '248,248,255', + 'gold' => '255,215,0', + 'goldenrod' => '218,165,32', + 'gray' => '128,128,128', + 'green' => '0,128,0', + 'greenyellow' => '173,255,47', + 'grey' => '128,128,128', + 'honeydew' => '240,255,240', + 'hotpink' => '255,105,180', + 'indianred' => '205,92,92', + 'indigo' => '75,0,130', + 'ivory' => '255,255,240', + 'khaki' => '240,230,140', + 'lavender' => '230,230,250', + 'lavenderblush' => '255,240,245', + 'lawngreen' => '124,252,0', + 'lemonchiffon' => '255,250,205', + 'lightblue' => '173,216,230', + 'lightcoral' => '240,128,128', + 'lightcyan' => '224,255,255', + 'lightgoldenrodyellow' => '250,250,210', + 'lightgray' => '211,211,211', + 'lightgreen' => '144,238,144', + 'lightgrey' => '211,211,211', + 'lightpink' => '255,182,193', + 'lightsalmon' => '255,160,122', + 'lightseagreen' => '32,178,170', + 'lightskyblue' => '135,206,250', + 'lightslategray' => '119,136,153', + 'lightslategrey' => '119,136,153', + 'lightsteelblue' => '176,196,222', + 'lightyellow' => '255,255,224', + 'lime' => '0,255,0', + 'limegreen' => '50,205,50', + 'linen' => '250,240,230', + 'magenta' => '255,0,255', + 'maroon' => '128,0,0', + 'mediumaquamarine' => '102,205,170', + 'mediumblue' => '0,0,205', + 'mediumorchid' => '186,85,211', + 'mediumpurple' => '147,112,219', + 'mediumseagreen' => '60,179,113', + 'mediumslateblue' => '123,104,238', + 'mediumspringgreen' => '0,250,154', + 'mediumturquoise' => '72,209,204', + 'mediumvioletred' => '199,21,133', + 'midnightblue' => '25,25,112', + 'mintcream' => '245,255,250', + 'mistyrose' => '255,228,225', + 'moccasin' => '255,228,181', + 'navajowhite' => '255,222,173', + 'navy' => '0,0,128', + 'oldlace' => '253,245,230', + 'olive' => '128,128,0', + 'olivedrab' => '107,142,35', + 'orange' => '255,165,0', + 'orangered' => '255,69,0', + 'orchid' => '218,112,214', + 'palegoldenrod' => '238,232,170', + 'palegreen' => '152,251,152', + 'paleturquoise' => '175,238,238', + 'palevioletred' => '219,112,147', + 'papayawhip' => '255,239,213', + 'peachpuff' => '255,218,185', + 'peru' => '205,133,63', + 'pink' => '255,192,203', + 'plum' => '221,160,221', + 'powderblue' => '176,224,230', + 'purple' => '128,0,128', + 'red' => '255,0,0', + 'rosybrown' => '188,143,143', + 'royalblue' => '65,105,225', + 'saddlebrown' => '139,69,19', + 'salmon' => '250,128,114', + 'sandybrown' => '244,164,96', + 'seagreen' => '46,139,87', + 'seashell' => '255,245,238', + 'sienna' => '160,82,45', + 'silver' => '192,192,192', + 'skyblue' => '135,206,235', + 'slateblue' => '106,90,205', + 'slategray' => '112,128,144', + 'slategrey' => '112,128,144', + 'snow' => '255,250,250', + 'springgreen' => '0,255,127', + 'steelblue' => '70,130,180', + 'tan' => '210,180,140', + 'teal' => '0,128,128', + 'thistle' => '216,191,216', + 'tomato' => '255,99,71', + 'transparent' => '0,0,0,0', + 'turquoise' => '64,224,208', + 'violet' => '238,130,238', + 'wheat' => '245,222,179', + 'white' => '255,255,255', + 'whitesmoke' => '245,245,245', + 'yellow' => '255,255,0', + 'yellowgreen' => '154,205,50' + ); +} + +// responsible for taking a string of LESS code and converting it into a +// syntax tree +class lessc_parser { + static protected $nextBlockId = 0; // used to uniquely identify blocks + + static protected $precedence = array( + '=<' => 0, + '>=' => 0, + '=' => 0, + '<' => 0, + '>' => 0, + + '+' => 1, + '-' => 1, + '*' => 2, + '/' => 2, + '%' => 2, + ); + + static protected $whitePattern; + static protected $commentMulti; + + static protected $commentSingle = "//"; + static protected $commentMultiLeft = "/*"; + static protected $commentMultiRight = "*/"; + + // regex string to match any of the operators + static protected $operatorString; + + // these properties will supress division unless it's inside parenthases + static protected $supressDivisionProps = + array('/border-radius$/i', '/^font$/i'); + + protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport"); + protected $lineDirectives = array("charset"); + + /** + * if we are in parens we can be more liberal with whitespace around + * operators because it must evaluate to a single value and thus is less + * ambiguous. + * + * Consider: + * property1: 10 -5; // is two numbers, 10 and -5 + * property2: (10 -5); // should evaluate to 5 + */ + protected $inParens = false; + + // caches preg escaped literals + static protected $literalCache = array(); + + public function __construct($lessc, $sourceName = null) { + $this->eatWhiteDefault = true; + // reference to less needed for vPrefix, mPrefix, and parentSelector + $this->lessc = $lessc; + + $this->sourceName = $sourceName; // name used for error messages + + $this->writeComments = false; + + if (!self::$operatorString) { + self::$operatorString = + '('.implode('|', array_map(array('lessc', 'preg_quote'), + array_keys(self::$precedence))).')'; + + $commentSingle = lessc::preg_quote(self::$commentSingle); + $commentMultiLeft = lessc::preg_quote(self::$commentMultiLeft); + $commentMultiRight = lessc::preg_quote(self::$commentMultiRight); + + self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight; + self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais'; + } + } + + public function parse($buffer) { + $this->count = 0; + $this->line = 1; + + $this->env = null; // block stack + $this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer); + $this->pushSpecialBlock("root"); + $this->eatWhiteDefault = true; + $this->seenComments = array(); + + // trim whitespace on head + // if (preg_match('/^\s+/', $this->buffer, $m)) { + // $this->line += substr_count($m[0], "\n"); + // $this->buffer = ltrim($this->buffer); + // } + $this->whitespace(); + + // parse the entire file + while (false !== $this->parseChunk()); + + if ($this->count != strlen($this->buffer)) + $this->throwError(); + + // TODO report where the block was opened + if ( !property_exists($this->env, 'parent') || !is_null($this->env->parent) ) + throw new exception('parse error: unclosed block'); + + return $this->env; + } + + /** + * Parse a single chunk off the head of the buffer and append it to the + * current parse environment. + * Returns false when the buffer is empty, or when there is an error. + * + * This function is called repeatedly until the entire document is + * parsed. + * + * This parser is most similar to a recursive descent parser. Single + * functions represent discrete grammatical rules for the language, and + * they are able to capture the text that represents those rules. + * + * Consider the function lessc::keyword(). (all parse functions are + * structured the same) + * + * The function takes a single reference argument. When calling the + * function it will attempt to match a keyword on the head of the buffer. + * If it is successful, it will place the keyword in the referenced + * argument, advance the position in the buffer, and return true. If it + * fails then it won't advance the buffer and it will return false. + * + * All of these parse functions are powered by lessc::match(), which behaves + * the same way, but takes a literal regular expression. Sometimes it is + * more convenient to use match instead of creating a new function. + * + * Because of the format of the functions, to parse an entire string of + * grammatical rules, you can chain them together using &&. + * + * But, if some of the rules in the chain succeed before one fails, then + * the buffer position will be left at an invalid state. In order to + * avoid this, lessc::seek() is used to remember and set buffer positions. + * + * Before parsing a chain, use $s = $this->seek() to remember the current + * position into $s. Then if a chain fails, use $this->seek($s) to + * go back where we started. + */ + protected function parseChunk() { + if (empty($this->buffer)) return false; + $s = $this->seek(); + + if ($this->whitespace()) { + return true; + } + + // setting a property + if ($this->keyword($key) && $this->assign() && + $this->propertyValue($value, $key) && $this->end() + ) { + $this->append(array('assign', $key, $value), $s); + return true; + } else { + $this->seek($s); + } + + + // look for special css blocks + if ($this->literal('@', false)) { + $this->count--; + + // media + if ($this->literal('@media')) { + if (($this->mediaQueryList($mediaQueries) || true) + && $this->literal('{') + ) { + $media = $this->pushSpecialBlock("media"); + $media->queries = is_null($mediaQueries) ? array() : $mediaQueries; + return true; + } else { + $this->seek($s); + return false; + } + } + + if ($this->literal("@", false) && $this->keyword($dirName)) { + if ($this->isDirective($dirName, $this->blockDirectives)) { + if (($this->openString("{", $dirValue, null, array(";")) || true) && + $this->literal("{") + ) { + $dir = $this->pushSpecialBlock("directive"); + $dir->name = $dirName; + if (isset($dirValue)) $dir->value = $dirValue; + return true; + } + } elseif ($this->isDirective($dirName, $this->lineDirectives)) { + if ($this->propertyValue($dirValue) && $this->end()) { + $this->append(array("directive", $dirName, $dirValue)); + return true; + } + } + } + + $this->seek($s); + } + + // setting a variable + if ($this->variable($var) && $this->assign() && + $this->propertyValue($value) && $this->end() + ) { + $this->append(array('assign', $var, $value), $s); + return true; + } else { + $this->seek($s); + } + + if ($this->import($importValue)) { + $this->append($importValue, $s); + return true; + } + + // opening parametric mixin + if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) && + ($this->guards($guards) || true) && + $this->literal('{') + ) { + $block = $this->pushBlock($this->fixTags(array($tag))); + $block->args = $args; + $block->isVararg = $isVararg; + if (!empty($guards)) $block->guards = $guards; + return true; + } else { + $this->seek($s); + } + + // opening a simple block + if ($this->tags($tags) && $this->literal('{', false)) { + $tags = $this->fixTags($tags); + $this->pushBlock($tags); + return true; + } else { + $this->seek($s); + } + + // closing a block + if ($this->literal('}', false)) { + try { + $block = $this->pop(); + } catch (exception $e) { + $this->seek($s); + $this->throwError($e->getMessage()); + } + + $hidden = false; + if (is_null($block->type)) { + $hidden = true; + if (!isset($block->args)) { + foreach ($block->tags as $tag) { + if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { + $hidden = false; + break; + } + } + } + + foreach ($block->tags as $tag) { + if (is_string($tag)) { + $this->env->children[$tag][] = $block; + } + } + } + + if (!$hidden) { + $this->append(array('block', $block), $s); + } + + // this is done here so comments aren't bundled into he block that + // was just closed + $this->whitespace(); + return true; + } + + // mixin + if ($this->mixinTags($tags) && + ($this->argumentDef($argv, $isVararg) || true) && + ($this->keyword($suffix) || true) && $this->end() + ) { + $tags = $this->fixTags($tags); + $this->append(array('mixin', $tags, $argv, $suffix), $s); + return true; + } else { + $this->seek($s); + } + + // spare ; + if ($this->literal(';')) return true; + + return false; // got nothing, throw error + } + + protected function isDirective($dirname, $directives) { + // TODO: cache pattern in parser + $pattern = implode("|", + array_map(array("lessc", "preg_quote"), $directives)); + $pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i'; + + return preg_match($pattern, $dirname); + } + + protected function fixTags($tags) { + // move @ tags out of variable namespace + foreach ($tags as &$tag) { + if ($tag{0} == $this->lessc->vPrefix) + $tag[0] = $this->lessc->mPrefix; + } + return $tags; + } + + // a list of expressions + protected function expressionList(&$exps) { + $values = array(); + + while ($this->expression($exp)) { + $values[] = $exp; + } + + if (count($values) == 0) return false; + + $exps = lessc::compressList($values, ' '); + return true; + } + + /** + * Attempt to consume an expression. + * @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code + */ + protected function expression(&$out) { + if ($this->value($lhs)) { + $out = $this->expHelper($lhs, 0); + + // look for / shorthand + if (!empty($this->env->supressedDivision)) { + unset($this->env->supressedDivision); + $s = $this->seek(); + if ($this->literal("/") && $this->value($rhs)) { + $out = array("list", "", + array($out, array("keyword", "/"), $rhs)); + } else { + $this->seek($s); + } + } + + return true; + } + return false; + } + + /** + * recursively parse infix equation with $lhs at precedence $minP + */ + protected function expHelper($lhs, $minP) { + $this->inExp = true; + $ss = $this->seek(); + + while (true) { + $whiteBefore = isset($this->buffer[$this->count - 1]) && + ctype_space($this->buffer[$this->count - 1]); + + // If there is whitespace before the operator, then we require + // whitespace after the operator for it to be an expression + $needWhite = $whiteBefore && !$this->inParens; + + if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) { + if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) { + foreach (self::$supressDivisionProps as $pattern) { + if (preg_match($pattern, $this->env->currentProperty)) { + $this->env->supressedDivision = true; + break 2; + } + } + } + + + $whiteAfter = isset($this->buffer[$this->count - 1]) && + ctype_space($this->buffer[$this->count - 1]); + + if (!$this->value($rhs)) break; + + // peek for next operator to see what to do with rhs + if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) { + $rhs = $this->expHelper($rhs, self::$precedence[$next[1]]); + } + + $lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter); + $ss = $this->seek(); + + continue; + } + + break; + } + + $this->seek($ss); + + return $lhs; + } + + // consume a list of values for a property + public function propertyValue(&$value, $keyName = null) { + $values = array(); + + if ($keyName !== null) $this->env->currentProperty = $keyName; + + $s = null; + while ($this->expressionList($v)) { + $values[] = $v; + $s = $this->seek(); + if (!$this->literal(',')) break; + } + + if ($s) $this->seek($s); + + if ($keyName !== null) unset($this->env->currentProperty); + + if (count($values) == 0) return false; + + $value = lessc::compressList($values, ', '); + return true; + } + + protected function parenValue(&$out) { + $s = $this->seek(); + + // speed shortcut + if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "(") { + return false; + } + + $inParens = $this->inParens; + if ($this->literal("(") && + ($this->inParens = true) && $this->expression($exp) && + $this->literal(")") + ) { + $out = $exp; + $this->inParens = $inParens; + return true; + } else { + $this->inParens = $inParens; + $this->seek($s); + } + + return false; + } + + // a single value + protected function value(&$value) { + $s = $this->seek(); + + // speed shortcut + if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") { + // negation + if ($this->literal("-", false) && + (($this->variable($inner) && $inner = array("variable", $inner)) || + $this->unit($inner) || + $this->parenValue($inner)) + ) { + $value = array("unary", "-", $inner); + return true; + } else { + $this->seek($s); + } + } + + if ($this->parenValue($value)) return true; + if ($this->unit($value)) return true; + if ($this->color($value)) return true; + if ($this->func($value)) return true; + if ($this->string($value)) return true; + + if ($this->keyword($word)) { + $value = array('keyword', $word); + return true; + } + + // try a variable + if ($this->variable($var)) { + $value = array('variable', $var); + return true; + } + + // unquote string (should this work on any type? + if ($this->literal("~") && $this->string($str)) { + $value = array("escape", $str); + return true; + } else { + $this->seek($s); + } + + // css hack: \0 + if ($this->literal('\\') && $this->match('([0-9]+)', $m)) { + $value = array('keyword', '\\'.$m[1]); + return true; + } else { + $this->seek($s); + } + + return false; + } + + // an import statement + protected function import(&$out) { + if (!$this->literal('@import')) return false; + + // @import "something.css" media; + // @import url("something.css") media; + // @import url(something.css) media; + + if ($this->propertyValue($value)) { + $out = array("import", $value); + return true; + } + } + + protected function mediaQueryList(&$out) { + if ($this->genericList($list, "mediaQuery", ",", false)) { + $out = $list[2]; + return true; + } + return false; + } + + protected function mediaQuery(&$out) { + $s = $this->seek(); + + $expressions = null; + $parts = array(); + + if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) { + $prop = array("mediaType"); + if (isset($only)) $prop[] = "only"; + if (isset($not)) $prop[] = "not"; + $prop[] = $mediaType; + $parts[] = $prop; + } else { + $this->seek($s); + } + + + if (!empty($mediaType) && !$this->literal("and")) { + // ~ + } else { + $this->genericList($expressions, "mediaExpression", "and", false); + if (is_array($expressions)) $parts = array_merge($parts, $expressions[2]); + } + + if (count($parts) == 0) { + $this->seek($s); + return false; + } + + $out = $parts; + return true; + } + + protected function mediaExpression(&$out) { + $s = $this->seek(); + $value = null; + if ($this->literal("(") && + $this->keyword($feature) && + ($this->literal(":") && $this->expression($value) || true) && + $this->literal(")") + ) { + $out = array("mediaExp", $feature); + if ($value) $out[] = $value; + return true; + } elseif ($this->variable($variable)) { + $out = array('variable', $variable); + return true; + } + + $this->seek($s); + return false; + } + + // an unbounded string stopped by $end + protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null) { + $oldWhite = $this->eatWhiteDefault; + $this->eatWhiteDefault = false; + + $stop = array("'", '"', "@{", $end); + $stop = array_map(array("lessc", "preg_quote"), $stop); + // $stop[] = self::$commentMulti; + + if (!is_null($rejectStrs)) { + $stop = array_merge($stop, $rejectStrs); + } + + $patt = '(.*?)('.implode("|", $stop).')'; + + $nestingLevel = 0; + + $content = array(); + while ($this->match($patt, $m, false)) { + if (!empty($m[1])) { + $content[] = $m[1]; + if ($nestingOpen) { + $nestingLevel += substr_count($m[1], $nestingOpen); + } + } + + $tok = $m[2]; + + $this->count-= strlen($tok); + if ($tok == $end) { + if ($nestingLevel == 0) { + break; + } else { + $nestingLevel--; + } + } + + if (($tok == "'" || $tok == '"') && $this->string($str)) { + $content[] = $str; + continue; + } + + if ($tok == "@{" && $this->interpolation($inter)) { + $content[] = $inter; + continue; + } + + if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) { + break; + } + + $content[] = $tok; + $this->count+= strlen($tok); + } + + $this->eatWhiteDefault = $oldWhite; + + if (count($content) == 0) return false; + + // trim the end + if (is_string(end($content))) { + $content[count($content) - 1] = rtrim(end($content)); + } + + $out = array("string", "", $content); + return true; + } + + protected function string(&$out) { + $s = $this->seek(); + if ($this->literal('"', false)) { + $delim = '"'; + } elseif ($this->literal("'", false)) { + $delim = "'"; + } else { + return false; + } + + $content = array(); + + // look for either ending delim , escape, or string interpolation + $patt = '([^\n]*?)(@\{|\\\\|' . + lessc::preg_quote($delim).')'; + + $oldWhite = $this->eatWhiteDefault; + $this->eatWhiteDefault = false; + + while ($this->match($patt, $m, false)) { + $content[] = $m[1]; + if ($m[2] == "@{") { + $this->count -= strlen($m[2]); + if ($this->interpolation($inter, false)) { + $content[] = $inter; + } else { + $this->count += strlen($m[2]); + $content[] = "@{"; // ignore it + } + } elseif ($m[2] == '\\') { + $content[] = $m[2]; + if ($this->literal($delim, false)) { + $content[] = $delim; + } + } else { + $this->count -= strlen($delim); + break; // delim + } + } + + $this->eatWhiteDefault = $oldWhite; + + if ($this->literal($delim)) { + $out = array("string", $delim, $content); + return true; + } + + $this->seek($s); + return false; + } + + protected function interpolation(&$out) { + $oldWhite = $this->eatWhiteDefault; + $this->eatWhiteDefault = true; + + $s = $this->seek(); + if ($this->literal("@{") && + $this->openString("}", $interp, null, array("'", '"', ";")) && + $this->literal("}", false) + ) { + $out = array("interpolate", $interp); + $this->eatWhiteDefault = $oldWhite; + if ($this->eatWhiteDefault) $this->whitespace(); + return true; + } + + $this->eatWhiteDefault = $oldWhite; + $this->seek($s); + return false; + } + + protected function unit(&$unit) { + // speed shortcut + if (isset($this->buffer[$this->count])) { + $char = $this->buffer[$this->count]; + if (!ctype_digit($char) && $char != ".") return false; + } + + if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) { + $unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]); + return true; + } + return false; + } + + // a # color + protected function color(&$out) { + if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) { + if (strlen($m[1]) > 7) { + $out = array("string", "", array($m[1])); + } else { + $out = array("raw_color", $m[1]); + } + return true; + } + + return false; + } + + // consume an argument definition list surrounded by () + // each argument is a variable name with optional value + // or at the end a ... or a variable named followed by ... + // arguments are separated by , unless a ; is in the list, then ; is the + // delimiter. + protected function argumentDef(&$args, &$isVararg) { + $s = $this->seek(); + if (!$this->literal('(')) { + return false; + } + + $values = array(); + $delim = ","; + $method = "expressionList"; + + $isVararg = false; + while (true) { + if ($this->literal("...")) { + $isVararg = true; + break; + } + + if ($this->$method($value)) { + if ($value[0] == "variable") { + $arg = array("arg", $value[1]); + $ss = $this->seek(); + + if ($this->assign() && $this->$method($rhs)) { + $arg[] = $rhs; + } else { + $this->seek($ss); + if ($this->literal("...")) { + $arg[0] = "rest"; + $isVararg = true; + } + } + + $values[] = $arg; + if ($isVararg) { + break; + } + continue; + } else { + $values[] = array("lit", $value); + } + } + + + if (!$this->literal($delim)) { + if ($delim == "," && $this->literal(";")) { + // found new delim, convert existing args + $delim = ";"; + $method = "propertyValue"; + + // transform arg list + if (isset($values[1])) { // 2 items + $newList = array(); + foreach ($values as $i => $arg) { + switch ($arg[0]) { + case "arg": + if ($i) { + $this->throwError("Cannot mix ; and , as delimiter types"); + } + $newList[] = $arg[2]; + break; + case "lit": + $newList[] = $arg[1]; + break; + case "rest": + $this->throwError("Unexpected rest before semicolon"); + } + } + + $newList = array("list", ", ", $newList); + + switch ($values[0][0]) { + case "arg": + $newArg = array("arg", $values[0][1], $newList); + break; + case "lit": + $newArg = array("lit", $newList); + break; + } + + } elseif ($values) { // 1 item + $newArg = $values[0]; + } + + if ($newArg) { + $values = array($newArg); + } + } else { + break; + } + } + } + + if (!$this->literal(')')) { + $this->seek($s); + return false; + } + + $args = $values; + + return true; + } + + // consume a list of tags + // this accepts a hanging delimiter + protected function tags(&$tags, $simple = false, $delim = ',') { + $tags = array(); + while ($this->tag($tt, $simple)) { + $tags[] = $tt; + if (!$this->literal($delim)) break; + } + if (count($tags) == 0) return false; + + return true; + } + + // list of tags of specifying mixin path + // optionally separated by > (lazy, accepts extra >) + protected function mixinTags(&$tags) { + $tags = array(); + while ($this->tag($tt, true)) { + $tags[] = $tt; + $this->literal(">"); + } + + if (!$tags) { + return false; + } + + return true; + } + + // a bracketed value (contained within in a tag definition) + protected function tagBracket(&$parts, &$hasExpression) { + // speed shortcut + if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { + return false; + } + + $s = $this->seek(); + + $hasInterpolation = false; + + if ($this->literal("[", false)) { + $attrParts = array("["); + // keyword, string, operator + while (true) { + if ($this->literal("]", false)) { + $this->count--; + break; // get out early + } + + if ($this->match('\s+', $m)) { + $attrParts[] = " "; + continue; + } + if ($this->string($str)) { + // escape parent selector, (yuck) + foreach ($str[2] as &$chunk) { + $chunk = str_replace($this->lessc->parentSelector, "$&$", $chunk); + } + + $attrParts[] = $str; + $hasInterpolation = true; + continue; + } + + if ($this->keyword($word)) { + $attrParts[] = $word; + continue; + } + + if ($this->interpolation($inter, false)) { + $attrParts[] = $inter; + $hasInterpolation = true; + continue; + } + + // operator, handles attr namespace too + if ($this->match('[|-~\$\*\^=]+', $m)) { + $attrParts[] = $m[0]; + continue; + } + + break; + } + + if ($this->literal("]", false)) { + $attrParts[] = "]"; + foreach ($attrParts as $part) { + $parts[] = $part; + } + $hasExpression = $hasExpression || $hasInterpolation; + return true; + } + $this->seek($s); + } + + $this->seek($s); + return false; + } + + // a space separated list of selectors + protected function tag(&$tag, $simple = false) { + if ($simple) { + $chars = '^@,:;{}\][>\(\) "\''; + } else { + $chars = '^@,;{}["\''; + } + $s = $this->seek(); + + $hasExpression = false; + $parts = array(); + while ($this->tagBracket($parts, $hasExpression)); + + $oldWhite = $this->eatWhiteDefault; + $this->eatWhiteDefault = false; + + while (true) { + if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) { + $parts[] = $m[1]; + if ($simple) break; + + while ($this->tagBracket($parts, $hasExpression)); + continue; + } + + if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "@") { + if ($this->interpolation($interp)) { + $hasExpression = true; + $interp[2] = true; // don't unescape + $parts[] = $interp; + continue; + } + + if ($this->literal("@")) { + $parts[] = "@"; + continue; + } + } + + if ($this->unit($unit)) { // for keyframes + $parts[] = $unit[1]; + $parts[] = $unit[2]; + continue; + } + + break; + } + + $this->eatWhiteDefault = $oldWhite; + if (!$parts) { + $this->seek($s); + return false; + } + + if ($hasExpression) { + $tag = array("exp", array("string", "", $parts)); + } else { + $tag = trim(implode($parts)); + } + + $this->whitespace(); + return true; + } + + // a css function + protected function func(&$func) { + $s = $this->seek(); + + if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) { + $fname = $m[1]; + + $sPreArgs = $this->seek(); + + $args = array(); + while (true) { + $ss = $this->seek(); + // this ugly nonsense is for ie filter properties + if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) { + $args[] = array("string", "", array($name, "=", $value)); + } else { + $this->seek($ss); + if ($this->expressionList($value)) { + $args[] = $value; + } + } + + if (!$this->literal(',')) break; + } + $args = array('list', ',', $args); + + if ($this->literal(')')) { + $func = array('function', $fname, $args); + return true; + } elseif ($fname == 'url') { + // couldn't parse and in url? treat as string + $this->seek($sPreArgs); + if ($this->openString(")", $string) && $this->literal(")")) { + $func = array('function', $fname, $string); + return true; + } + } + } + + $this->seek($s); + return false; + } + + // consume a less variable + protected function variable(&$name) { + $s = $this->seek(); + if ($this->literal($this->lessc->vPrefix, false) && + ($this->variable($sub) || $this->keyword($name)) + ) { + if (!empty($sub)) { + $name = array('variable', $sub); + } else { + $name = $this->lessc->vPrefix.$name; + } + return true; + } + + $name = null; + $this->seek($s); + return false; + } + + /** + * Consume an assignment operator + * Can optionally take a name that will be set to the current property name + */ + protected function assign($name = null) { + if ($name) $this->currentProperty = $name; + return $this->literal(':') || $this->literal('='); + } + + // consume a keyword + protected function keyword(&$word) { + if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) { + $word = $m[1]; + return true; + } + return false; + } + + // consume an end of statement delimiter + protected function end() { + if ($this->literal(';', false)) { + return true; + } elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') { + // if there is end of file or a closing block next then we don't need a ; + return true; + } + return false; + } + + protected function guards(&$guards) { + $s = $this->seek(); + + if (!$this->literal("when")) { + $this->seek($s); + return false; + } + + $guards = array(); + + while ($this->guardGroup($g)) { + $guards[] = $g; + if (!$this->literal(",")) break; + } + + if (count($guards) == 0) { + $guards = null; + $this->seek($s); + return false; + } + + return true; + } + + // a bunch of guards that are and'd together + // TODO rename to guardGroup + protected function guardGroup(&$guardGroup) { + $s = $this->seek(); + $guardGroup = array(); + while ($this->guard($guard)) { + $guardGroup[] = $guard; + if (!$this->literal("and")) break; + } + + if (count($guardGroup) == 0) { + $guardGroup = null; + $this->seek($s); + return false; + } + + return true; + } + + protected function guard(&$guard) { + $s = $this->seek(); + $negate = $this->literal("not"); + + if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { + $guard = $exp; + if ($negate) $guard = array("negate", $guard); + return true; + } + + $this->seek($s); + return false; + } + + /* raw parsing functions */ + + protected function literal($what, $eatWhitespace = null) { + if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; + + // shortcut on single letter + if (!isset($what[1]) && isset($this->buffer[$this->count])) { + if ($this->buffer[$this->count] == $what) { + if (!$eatWhitespace) { + $this->count++; + return true; + } + // goes below... + } else { + return false; + } + } + + if (!isset(self::$literalCache[$what])) { + self::$literalCache[$what] = lessc::preg_quote($what); + } + + return $this->match(self::$literalCache[$what], $m, $eatWhitespace); + } + + protected function genericList(&$out, $parseItem, $delim="", $flatten=true) { + $s = $this->seek(); + $items = array(); + while ($this->$parseItem($value)) { + $items[] = $value; + if ($delim) { + if (!$this->literal($delim)) break; + } + } + + if (count($items) == 0) { + $this->seek($s); + return false; + } + + if ($flatten && count($items) == 1) { + $out = $items[0]; + } else { + $out = array("list", $delim, $items); + } + + return true; + } + + + // advance counter to next occurrence of $what + // $until - don't include $what in advance + // $allowNewline, if string, will be used as valid char set + protected function to($what, &$out, $until = false, $allowNewline = false) { + if (is_string($allowNewline)) { + $validChars = $allowNewline; + } else { + $validChars = $allowNewline ? "." : "[^\n]"; + } + if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false; + if ($until) $this->count -= strlen($what); // give back $what + $out = $m[1]; + return true; + } + + // try to match something on head of buffer + protected function match($regex, &$out, $eatWhitespace = null) { + if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; + + $r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais'; + if (preg_match($r, $this->buffer, $out, null, $this->count)) { + $this->count += strlen($out[0]); + if ($eatWhitespace && $this->writeComments) $this->whitespace(); + return true; + } + return false; + } + + // match some whitespace + protected function whitespace() { + if ($this->writeComments) { + $gotWhite = false; + while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { + if (isset($m[1]) && empty($this->seenComments[$this->count])) { + $this->append(array("comment", $m[1])); + $this->seenComments[$this->count] = true; + } + $this->count += strlen($m[0]); + $gotWhite = true; + } + return $gotWhite; + } else { + $this->match("", $m); + return strlen($m[0]) > 0; + } + } + + // match something without consuming it + protected function peek($regex, &$out = null, $from=null) { + if (is_null($from)) $from = $this->count; + $r = '/'.$regex.'/Ais'; + $result = preg_match($r, $this->buffer, $out, null, $from); + + return $result; + } + + // seek to a spot in the buffer or return where we are on no argument + protected function seek($where = null) { + if ($where === null) return $this->count; + else $this->count = $where; + return true; + } + + /* misc functions */ + + public function throwError($msg = "parse error", $count = null) { + $count = is_null($count) ? $this->count : $count; + + $line = $this->line + + substr_count(substr($this->buffer, 0, $count), "\n"); + + if (!empty($this->sourceName)) { + $loc = "$this->sourceName on line $line"; + } else { + $loc = "line: $line"; + } + + // TODO this depends on $this->count + if ($this->peek("(.*?)(\n|$)", $m, $count)) { + throw new exception("$msg: failed at `$m[1]` $loc"); + } else { + throw new exception("$msg: $loc"); + } + } + + protected function pushBlock($selectors=null, $type=null) { + $b = new stdclass; + $b->parent = $this->env; + + $b->type = $type; + $b->id = self::$nextBlockId++; + + $b->isVararg = false; // TODO: kill me from here + $b->tags = $selectors; + + $b->props = array(); + $b->children = array(); + + $this->env = $b; + return $b; + } + + // push a block that doesn't multiply tags + protected function pushSpecialBlock($type) { + return $this->pushBlock(null, $type); + } + + // append a property to the current block + protected function append($prop, $pos = null) { + if ($pos !== null) $prop[-1] = $pos; + $this->env->props[] = $prop; + } + + // pop something off the stack + protected function pop() { + $old = $this->env; + $this->env = $this->env->parent; + return $old; + } + + // remove comments from $text + // todo: make it work for all functions, not just url + protected function removeComments($text) { + $look = array( + 'url(', '//', '/*', '"', "'" + ); + + $out = ''; + $min = null; + while (true) { + // find the next item + foreach ($look as $token) { + $pos = strpos($text, $token); + if ($pos !== false) { + if (!isset($min) || $pos < $min[1]) $min = array($token, $pos); + } + } + + if (is_null($min)) break; + + $count = $min[1]; + $skip = 0; + $newlines = 0; + switch ($min[0]) { + case 'url(': + if (preg_match('/url\(.*?\)/', $text, $m, 0, $count)) + $count += strlen($m[0]) - strlen($min[0]); + break; + case '"': + case "'": + if (preg_match('/'.$min[0].'.*?(?indentLevel = 0; + } + + public function indentStr($n = 0) { + return str_repeat($this->indentChar, max($this->indentLevel + $n, 0)); + } + + public function property($name, $value) { + return $name . $this->assignSeparator . $value . ";"; + } + + protected function isEmpty($block) { + if (empty($block->lines)) { + foreach ($block->children as $child) { + if (!$this->isEmpty($child)) return false; + } + + return true; + } + return false; + } + + public function block($block) { + if ($this->isEmpty($block)) return; + + $inner = $pre = $this->indentStr(); + + $isSingle = !$this->disableSingle && + is_null($block->type) && count($block->lines) == 1; + + if (!empty($block->selectors)) { + $this->indentLevel++; + + if ($this->breakSelectors) { + $selectorSeparator = $this->selectorSeparator . $this->break . $pre; + } else { + $selectorSeparator = $this->selectorSeparator; + } + + echo $pre . + implode($selectorSeparator, $block->selectors); + if ($isSingle) { + echo $this->openSingle; + $inner = ""; + } else { + echo $this->open . $this->break; + $inner = $this->indentStr(); + } + + } + + if (!empty($block->lines)) { + $glue = $this->break.$inner; + echo $inner . implode($glue, $block->lines); + if (!$isSingle && !empty($block->children)) { + echo $this->break; + } + } + + foreach ($block->children as $child) { + $this->block($child); + } + + if (!empty($block->selectors)) { + if (!$isSingle && empty($block->children)) echo $this->break; + + if ($isSingle) { + echo $this->closeSingle . $this->break; + } else { + echo $pre . $this->close . $this->break; + } + + $this->indentLevel--; + } + } +} + +class lessc_formatter_compressed extends lessc_formatter_classic { + public $disableSingle = true; + public $open = "{"; + public $selectorSeparator = ","; + public $assignSeparator = ":"; + public $break = ""; + public $compressColors = true; + + public function indentStr($n = 0) { + return ""; + } +} + +class lessc_formatter_lessjs extends lessc_formatter_classic { + public $disableSingle = true; + public $breakSelectors = true; + public $assignSeparator = ": "; + public $selectorSeparator = ","; +} diff --git a/bibli/normalize.css b/bibli/normalize.css index 47b010e..192eb9c 100755 --- a/bibli/normalize.css +++ b/bibli/normalize.css @@ -1,4 +1,4 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /* Document ========================================================================== */ @@ -24,6 +24,14 @@ body { margin: 0; } +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + /** * Correct the font size and margin on `h1` elements within `section` and * `article` contexts in Chrome, Firefox, and Safari. diff --git a/bibli/sense3/.eslintrc b/bibli/sense3/.eslintrc deleted file mode 100755 index ad5eaeb..0000000 --- a/bibli/sense3/.eslintrc +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "jquery": true, - "browser": true, - "es6": true - }, - "extends": [ - "airbnb-base", - "plugin:vue/recommended" - ], - "globals": { - "__webpack_public_path__": true, - "gl": false, - "gon": false, - "localStorage": false - }, - "parserOptions": { - "parser": "babel-eslint" - }, - "plugins": [ - "filenames", - "import", - "html", - "promise" - ], - "settings": { - "html/html-extensions": [".html", ".html.raw"], - "import/resolver": { - "webpack": { - "config": "./config/webpack.config.js" - } - } - }, - "rules": { - "filenames/match-regex": [2, "^[a-z0-9_]+$"], - "import/no-commonjs": "error", - "no-multiple-empty-lines": ["error", { "max": 1 }], - "promise/catch-or-return": "error", - "no-underscore-dangle": ["error", { "allow": ["__"]}], - "vue/html-self-closing": ["error", { - "html": { - "void": "always", - "normal": "never", - "component": "always" - }, - "svg": "always", - "math": "always" - }] - } -} diff --git a/bibli/sense3/.gitlab-ci.yml b/bibli/sense3/.gitlab-ci.yml deleted file mode 100755 index 4bdf9d1..0000000 --- a/bibli/sense3/.gitlab-ci.yml +++ /dev/null @@ -1,30 +0,0 @@ -image: node:8.9.4-stretch -stages: - - test - - deploy - -test: - stage: test - before_script: - - npm install -g eslint - - npm install -g eslint-plugin-filenames - - npm install -g eslint-plugin-import - - npm install -g eslint-plugin-html - - npm install -g eslint-plugin-promise - - npm install -g eslint-plugin-vue - - npm install -g eslint-config-airbnb-base - - npm install -g babel-eslint - script: - - eslint sense3.js - -pages: - stage: deploy - script: - - mkdir .public - - cp -r * .public - - mv .public public - artifacts: - paths: - - public - only: - - master diff --git a/bibli/sense3/img/dioAmazon-300_250-xx.png b/bibli/sense3/img/dioAmazon-300_250-xx.png index 87a42a6..4362294 100755 Binary files a/bibli/sense3/img/dioAmazon-300_250-xx.png and b/bibli/sense3/img/dioAmazon-300_250-xx.png differ diff --git a/bibli/sense3/img/dioFacebook-300_250-xx.png b/bibli/sense3/img/dioFacebook-300_250-xx.png index e4d807b..1c5f4d4 100755 Binary files a/bibli/sense3/img/dioFacebook-300_250-xx.png and b/bibli/sense3/img/dioFacebook-300_250-xx.png differ diff --git a/bibli/sense3/img/dioGafam-300_250-xx.png b/bibli/sense3/img/dioGafam-300_250-xx.png index a638a07..7e252f5 100755 Binary files a/bibli/sense3/img/dioGafam-300_250-xx.png and b/bibli/sense3/img/dioGafam-300_250-xx.png differ diff --git a/bibli/sense3/img/dioGoogle-300_250-xx.png b/bibli/sense3/img/dioGoogle-300_250-xx.png index 392e99d..27d2117 100755 Binary files a/bibli/sense3/img/dioGoogle-300_250-xx.png and b/bibli/sense3/img/dioGoogle-300_250-xx.png differ diff --git a/bibli/sense3/img/dioMicrosoft-300_250-xx.png b/bibli/sense3/img/dioMicrosoft-300_250-xx.png index c3625b0..4505178 100755 Binary files a/bibli/sense3/img/dioMicrosoft-300_250-xx.png and b/bibli/sense3/img/dioMicrosoft-300_250-xx.png differ diff --git a/licences/aboutant.html b/bibli/sense3/img/icons/adetect-300_250.php similarity index 68% rename from licences/aboutant.html rename to bibli/sense3/img/icons/adetect-300_250.php index 9802d7e..c2db231 100755 --- a/licences/aboutant.html +++ b/bibli/sense3/img/icons/adetect-300_250.php @@ -5,8 +5,48 @@ about:ant - - + diff --git a/bibli/sense3/img/icons/adetect-728_90.php b/bibli/sense3/img/icons/adetect-728_90.php new file mode 100755 index 0000000..571905f --- /dev/null +++ b/bibli/sense3/img/icons/adetect-728_90.php @@ -0,0 +1,19 @@ + + + ABCDEFG + + + + + diff --git a/bibli/ubuntu/CONTRIBUTING.txt b/bibli/ubuntu/CONTRIBUTING.txt deleted file mode 100755 index 15bdc0c..0000000 --- a/bibli/ubuntu/CONTRIBUTING.txt +++ /dev/null @@ -1,21 +0,0 @@ -The Ubuntu Font Family is very long-term endeavour, and the first time -that a professionally-designed font has been funded specifically with -the intent of being an on-going community expanded project: - - http://font.ubuntu.com/ - -Development of the Ubuntu Font Family is undertaken on Launchpad: - - http://launchpad.net/ubuntu-font-family/ - -and this is where milestones, bug management and releases are handled. - -Contributions are welcomed. Your work will be used on millions of -computers every single day! Following the initial bootstrapping of -Latin, Cyrillic, Greek, Arabic and Hebrew expansion will be undertaken -by font designers from the font design and Ubuntu communities. - -To ensure that the Ubuntu Font Family can be re-licensed to future -widely-used libre font licences, copyright assignment is being required: - - https://launchpad.net/~uff-contributors diff --git a/bibli/ubuntu/FONTLOG.txt b/bibli/ubuntu/FONTLOG.txt deleted file mode 100755 index 83022be..0000000 --- a/bibli/ubuntu/FONTLOG.txt +++ /dev/null @@ -1,292 +0,0 @@ -This is the FONTLOG file for the Ubuntu Font Family and attempts to follow -the recommendations at: http://scripts.sil.org/OFL-FAQ_web#43cecb44 - - -Overview - -The new Ubuntu Font Family was started to enable the personality of -Ubuntu to be seen and felt in every menu, button and dialog. -The typeface is sans-serif, uses OpenType features and is manually -hinted for clarity on desktop and mobile computing screens. - -The scope of the Ubuntu Font Family includes all the languages used by -the various Ubuntu users around the world in tune with Ubuntu's -philosophy which states that every user should be able to use their -software in the language of their choice. So the Ubuntu Font Family -project will be extended to cover many more written languages. - - -History - -The Ubuntu Font Family has been creating during 2010 and 2011. As of -September 2011 coverage is provided for Latin, Cyrillic and Greek across -Regular, Italic, Bold and Bold-Italic. Further work was uptaken during -2015. - - -ChangeLog - -2015-08-21 (Paul Sladen) Ubuntu Font Family version 0.83 - - Note: This release was created by binary patching from the v0.80 - release using the scripts in 'sources/patch-0.80-0.83/' to rebuild - the necessary tables. The release selectively updates only those - proportional .ttf font files exhibiting the bug below bug number; - the Ubuntu Mono monospace font files remain unchanged, being the - original version 0.80 ones. - - [Marc Foley] - * [Engineering] Fixed wrong characters appear in some mac apps. (LP: #1334363) - - -2011-09-22 (Paul Sladen) Ubuntu Font Family version 0.80 - - [Vincent Connare/Dalton Maag] - * Wish for addition of a monospaced member to the family (LP: #640382) - * Mono: No hinting yet - Ubuntu Beta Mono font looks jagged in - Netbeans and terrible with ClearType (LP: #820493) - * Emacs: choosing normal monospace font in Emacs but gives bold-italic - (LP: #791076) - * PUA: ensure that Ubuntu Circle of Friends logo is full size: (LP: #853855) - + U+E0FF becomes large size in proportionals, remains small width in - monospaces - + U+F0FF becomes small size (proportionals only) - + U+F200 is full ubuntu logomark (proportionals only) - - [Paul Sladen] - * Monospace: Patch Family Name to be "Ubuntu Mono" - * Monospace: Patch U+EFFD version debugging glyph to be '0.8' - - [Cody Boisclair] - * Monospace: Force .null HDMX advance to 500 - * Monospace: Remap ASCII box-drawing characters (LP: #788757) - - [Júlio Reis] - * Date corrections to 'FONTLOG' (LP: #836595) - -2011-03-08 (Paul Sladen) Ubuntu Font Family version 0.71.2 - - * (Production) Adjust Medium WeightClass to 500 (Md, MdIt) (LP: #730912) - -2011-03-07 (Paul Sladen) Ubuntu Font Family version 0.71.1 - - * (Design) Add Capitalised version of glyphs and kern. (Lt, LtIt, - Md, MdIt) DM (LP: #677446) - * (Design) Re-space and tighen Regular and Italic by amount specified - by Mark Shuttleworth (minus 4 FUnits). (Rg, It) (LP: #677149) - * (Design) Design: Latin (U+0192) made straight more like l/c f with - tail (LP: #670768) - * (Design) (U+01B3) should have hook on right, as the lowercase - (U+01B4) (LP: #681026) - * (Design) Tail of Light Italic germandbls, longs and lowercase 'f' - to match Italic/BoldItalic (LP: #623925) - * (Production) Update feature (Lt, LtIt, Md, MdIt). DM - (LP: #676538, #676539) - * (Production) Remove Bulgarian locl feature for Italics. (LP: #708578) - * (Production) Update Description information with new string: - "The Ubuntu Font Family are libre fonts funded by Canonical Ltd - on behalf of the Ubuntu project. The font design work and - technical implementation is being undertaken by Dalton Maag. The - typeface is sans-serif, uses OpenType features and is manually - hinted for clarity on desktop and mobile computing screens. The - scope of the Ubuntu Font Family includes all the languages used - by the various Ubuntu users around the world in tune with - Ubuntu's philosophy which states that every user should be able - to use their software in the language of their choice. The - project is ongoing, and we expect the family will be extended to - cover many written languages in the coming years." - (Rg, It, Bd, BdIt, Lt, LtIt, Md, MdIt) (LP: #690590) - * (Production) Pixel per em indicator added at U+F000 (Lt, LtIt, Md, - MdIt) (LP: #615787) - * (Production) Version number indicator added at U+EFFD (Lt, LtIt, Md, - MdIt) (LP: #640623) - * (Production) fstype bit set to 0 - Editable (Lt, LtIt, Md, MdIt) - (LP: #648406) - * (Production) Localisation of name table has been removed because - of problems with Mac OS/X interpretation of localisation. DM - (LP: #730785) - * (Hinting) Regular '?' dot non-circular (has incorrect control - value). (LP: #654336) - * (Hinting) Too much space after latin capital 'G' in 13pt - regular. Now reduced. (LP: #683437) - * (Hinting) Balance Indian Rupee at 18,19pt (LP: #662177) - * (Hinting) Make Regular '£' less ambiguous at 13-15 ppm (LP: #685562) - * (Hinting) Regular capital 'W' made symmetrical at 31 ppem (LP: #686168) - -2010-12-14 (Paul Sladen) Ubuntu Font Family version 0.70.1 - - Packaging, rebuilt from '2010-12-08 UbuntuFontsSourceFiles_070.zip': - * (Midstream) Fstype bit != 0 (LP: #648406) - * (Midstream) Add unit test to validate fstype bits (LP: #648406) - * (Midstream) Add unit test to validate licence - -2010-12-14 (Paul Sladen) Ubuntu Font Family version 0.70 - - Release notes 0.70: - * (Design) Add Capitalised version of glyphs and kern. (Rg, It, Bd, - BdIt) DM (LP: #676538, #677446) - * (Design) Give acute and grave a slight upright move to more match - the Hungarian double acute angle. (Rg, It, Bd, BdIt) (LP: #656647) - * (Design) Shift Bold Italic accent glyphs to be consistent with the - Italic. (BdIt only) DM (LP: #677449) - * (Design) Check spacing and kerning of dcaron, lcaron and - tcaron. (Rg, It, Bd, BdIt) (LP: #664722) - * (Design) Add positive kerning to () {} [] to open out the - combinations so they are less like a closed box. (Rg, It, Bd, - BdIt) (LP: #671228) - * (Design) Change design of acute.asc and check highest points (Bd - and BdIt only) DM - * (Production) Update feature. DM (LP: #676538, #676539) - * (Production) Remove Romanian locl feature. (Rg, It, Bd, BdIt) - (LP: #635615) - * (Production) Update Copyright information with new - strings. "Copyright 2010 Canonical Ltd. Licensed under the Ubuntu - Font Licence 1.0" Trademark string "Ubuntu and Canonical are - registered trademarks of Canonical Ltd." (Rg, It, Bd, BdIt) DM - (LP: #677450) - * (Design) Check aligning of hyphen, math signs em, en, check braces - and other brackets. 16/11 (LP: #676465) - * (Production) Pixel per em indicator added at U+F000 (Rg, It, Bd, - BdIt) (LP: #615787) - * (Production) Version number indicator added at U+EFFD (Rg, It, Bd, - BdIt) (LP: #640623) - * (Production) fstype bit set to 0 - Editable (Rg, It, Bd, BdIt) - (LP: #648406) - -2010-10-05 (Paul Sladen) Ubuntu Font Family version 0.69 - - [Dalton Maag] - * Italic, - - Hinting on lowercase Italic l amended 19ppm (LP: #632451) - - Hinting on lowercase Italic u amended 12ppm (LP: #626376) - - * Regular, Italic, Bold, BoldItalic - - New Rupee Sign added @ U+20B9 (LP: #645987) - - Ubuntu Roundel added @ U+E0FF (LP: #651606) - - [Paul Sladen] - * All - - Removed "!ubu" GSUB.calt ligature for U+E0FF (LP: #651606) - - -Acknowledgements - -If you make modifications be sure to add your name (N), email (E), -web-address (if you have one) (W) and description (D). This list is in -alphabetical order. - -N: Ryan Abdullah -W: http://www.rayan.de/ -D: Arabic calligraphy and design in collaboration with Dalton Maag -D: Arabic testing - -N: Cody Boisclair -D: Monospace low-level debugging and patching ('fixboxdrawing-ft.py') - -N: Amélie Bonet -W: http://ameliebonet.com/ -D: Type design with Dalton Maag, particularly Ubuntu Mono and Ubuntu Condensed - -N: Jason Campbell -W: http://www.campbellgraphics.com/design/fonts.shtml -D: Monospace hinting (first phase) at Dalton Maag - -N: Pilar Cano -W: http://www.pilarcano.com/ -D: Hebrew realisation with Dalton Maag - -N: Fernando Caro -D: Type design with Dalton Maag, particularly Ubuntu Condensed - -N: Ron Carpenter -W: http://www.daltonmaag.com/ -D: Type design with Dalton Maag -D: Arabic realisation in collaboration with Ryan Abdullah - -N: Vincent Connare -W: http://www.connare.com/ -D: Type design, and engineering with Dalton Maag -D: Monospace hinting (second phase) at Dalton Maag - -N: Dave Crossland -E: dave@understandingfonts.com -W: http://understandingfonts.com/ -D: Documentation and libre licensing guidance -D: Google Webfont integration at Google - -N: Steve Edwards -W: http://www.madebymake.com/ -D: font.ubuntu.com revamp implementation with Canonical Web Team - -N: Iain Farrell -W: http://www.flickr.com/photos/iain -D: Ubuntu Font Family delivery for the Ubuntu UX team at Canonical - -N: Marc Foley -W: http://www.marcfoley.co/ -D: Font Engineer at Dalton Maag for the 2015 updates - -N: Shiraaz Gabru -W: http://www.daltonmaag.com/ -D: Ubuntu Font Family project management at Dalton Maag - -N: Marcus Haslam -W: http://design.canonical.com/author/marcus-haslam/ -D: Creative inspiration - -N: Ben Laenen -D: Inspiration behind the pixels-per-em (PPEM) readout debugging glyph at U+F000 - (for this font the concept was re-implemented from scratch by Dalton-Maag) - -N: Bruno Maag -W: http://www.daltonmaag.com/ -D: Stylistic direction of the Ubuntu Font Family, as head of Dalton Maag - -N: Ivanka Majic -W: http://www.ivankamajic.com/ -D: Guiding the UX team and Cyrillic feedback - -N: David Marshall -W: http://www.daltonmaag.com/ -D: Technical guidance and administration at Dalton Maag - -N: Malcolm Wooden -W: http://www.daltonmaag.com/ -D: Font Engineering at Dalton Maag - -N: Lukas Paltram -W: http://www.daltonmaag.com/ -D: Type design with Dalton Maag - -N: Júlio Reis -D: Date fixes to the documentation - -N: Rodrigo Rivas -D: Indian Rupee Sign glyph - -N: Mark Shuttleworth -E: mark@ubuntu.com -W: http://www.markshuttleworth.com/ -D: Executive quality-control and funding - -N: Paul Sladen -E: ubuntu@paul.sladen.org -W: http://www.paul.sladen.org/ -D: Bug triaging, packaging at Ubuntu and Canonical - -N: Nicolas Spalinger -W: http://planet.open-fonts.org -D: Continuous guidance on libre/open font licensing, best practises in source - tree layout, release and packaging (pkg-fonts Debian team) - -N: Kenneth Wimer -D: Initial PPA packaging - -* Canonical Ltd is the primary commercial sponsor of the Ubuntu and - Kubuntu operating systems -* Dalton Maag are a custom type foundry headed by Bruno Maag - -For further documentation, information on contributors, source code -downloads and those involved with the Ubuntu Font Family, visit: - - http://font.ubuntu.com/ diff --git a/bibli/ubuntu/LICENCE-FAQ.txt b/bibli/ubuntu/LICENCE-FAQ.txt deleted file mode 100755 index 776a25e..0000000 --- a/bibli/ubuntu/LICENCE-FAQ.txt +++ /dev/null @@ -1,177 +0,0 @@ - Ubuntu Font Family Licensing FAQ - - Stylistic Foundations - - The Ubuntu Font Family is the first time that a libre typeface has been - designed professionally and explicitly with the intent of developing a - public and long-term community-based development process. - - When developing an open project, it is generally necessary to have firm - foundations: a font needs to maintain harmony within itself even across - many type designers and writing systems. For the [1]Ubuntu Font Family, - the process has been guided with the type foundry Dalton Maag setting - the project up with firm stylistic foundation covering several - left-to-right scripts: Latin, Greek and Cyrillic; and right-to-left - scripts: Arabic and Hebrew (due in 2011). - - With this starting point the community will, under the supervision of - [2]Canonical and [3]Dalton Maag, be able to build on the existing font - sources to expand their character coverage. Ultimately everybody will - be able to use the Ubuntu Font Family in their own written languages - across the whole of Unicode (and this will take some time!). - - Licensing - - The licence chosen by any free software project is one of the - foundational decisions that sets out how derivatives and contributions - can occur, and in turn what kind of community will form around the - project. - - Using a licence that is compatible with other popular licences is a - powerful constraint because of the [4]network effects: the freedom to - share improvements between projects allows free software to reach - high-quality over time. Licence-proliferation leads to many - incompatible licences, undermining the network effect, the freedom to - share and ultimately making the libre movement that Ubuntu is a part of - less effective. For all kinds of software, writing a new licence is not - to be taken lightly and is a choice that needs to be thoroughly - justified if this path is taken. - - Today it is not clear to Canonical what the best licence for a font - project like the Ubuntu Font Family is: one that starts life designed - by professionals and continues with the full range of community - development, from highly commercial work in new directions to curious - beginners' experimental contributions. The fast and steady pace of the - Ubuntu release cycle means that an interim libre licence has been - necessary to enable the consideration of the font family as part of - Ubuntu 10.10 operating system release. - - Before taking any decision on licensing, Canonical as sponsor and - backer of the project has reviewed the many existing licenses used for - libre/open fonts and engaged the stewards of the most popular licenses - in detailed discussions. The current interim licence is the first step - in progressing the state-of-the-art in licensing for libre/open font - development. - - The public discussion must now involve everyone in the (comparatively - new) area of the libre/open font community; including font users, - software freedom advocates, open source supporters and existing libre - font developers. Most importantly, the minds and wishes of professional - type designers considering entering the free software business - community must be taken on board. - - Conversations and discussion has taken place, privately, with - individuals from the following groups (generally speaking personally on - behalf of themselves, rather than their affiliations): - * [5]SIL International - * [6]Open Font Library - * [7]Software Freedom Law Center - * [8]Google Font API - - Document embedding - - One issue highlighted early on in the survey of existing font licences - is that of document embedding. Almost all font licences, both free and - unfree, permit embedding a font into a document to a certain degree. - Embedding a font with other works that make up a document creates a - "combined work" and copyleft would normally require the whole document - to be distributed under the terms of the font licence. As beautiful as - the font might be, such a licence makes a font too restrictive for - useful general purpose digital publishing. - - The situation is not entirely unique to fonts and is encountered also - with tools such as GNU Bison: a vanilla GNU GPL licence would require - anything generated with Bison to be made available under the terms of - the GPL as well. To avoid this, Bison is [9]published with an - additional permission to the GPL which allows the output of Bison to be - made available under any licence. - - The conflict between licensing of fonts and licensing of documents, is - addressed in two popular libre font licences, the SIL OFL and GNU GPL: - * [10]SIL Open Font Licence: When OFL fonts are embedded in a - document, the OFL's terms do not apply to that document. (See - [11]OFL-FAQ for details. - * [12]GPL Font Exception: The situation is resolved by granting an - additional permission to allow documents to not be covered by the - GPL. (The exception is being reviewed). - - The Ubuntu Font Family must also resolve this conflict, ensuring that - if the font is embedded and then extracted it is once again clearly - under the terms of its libre licence. - - Long-term licensing - - Those individuals involved, especially from Ubuntu and Canonical, are - interested in finding a long-term libre licence that finds broad favour - across the whole libre/open font community. The deliberation during the - past months has been on how to licence the Ubuntu Font Family in the - short-term, while knowingly encouraging everyone to pursue a long-term - goal. - * [13]Copyright assignment will be required so that the Ubuntu Font - Family's licensing can be progressively expanded to one (or more) - licences, as best practice continues to evolve within the - libre/open font community. - * Canonical will support and fund legal work on libre font licensing. - It is recognised that the cost and time commitments required are - likely to be significant. We invite other capable parties to join - in supporting this activity. - - The GPL version 3 (GPLv3) will be used for Ubuntu Font Family build - scripts and the CC-BY-SA for associated documentation and non-font - content: all items which do not end up embedded in general works and - documents. - -Ubuntu Font Licence - - For the short-term only, the initial licence is the [14]Ubuntu Font - License (UFL). This is loosely inspired from the work on the SIL - OFL 1.1, and seeks to clarify the issues that arose during discussions - and legal review, from the perspective of the backers, Canonical Ltd. - Those already using established licensing models such as the GPL, OFL - or Creative Commons licensing should have no worries about continuing - to use them. The Ubuntu Font Licence (UFL) and the SIL Open Font - Licence (SIL OFL) are not identical and should not be confused with - each other. Please read the terms precisely. The UFL is only intended - as an interim license, and the overriding aim is to support the - creation of a more suitable and generic libre font licence. As soon as - such a licence is developed, the Ubuntu Font Family will migrate to - it—made possible by copyright assignment in the interium. Between the - OFL 1.1, and the UFL 1.0, the following changes are made to produce the - Ubuntu Font Licence: - * Clarification: - - 1. Document embedding (see [15]embedding section above). - 2. Apply at point of distribution, instead of receipt - 3. Author vs. copyright holder disambiguation (type designers are - authors, with the copyright holder normally being the funder) - 4. Define "Propagate" (for internationalisation, similar to the GPLv3) - 5. Define "Substantially Changed" - 6. Trademarks are explicitly not transferred - 7. Refine renaming requirement - - Streamlining: - 8. Remove "not to be sold separately" clause - 9. Remove "Reserved Font Name(s)" declaration - - A visual demonstration of how these points were implemented can be - found in the accompanying coloured diff between SIL OFL 1.1 and the - Ubuntu Font Licence 1.0: [16]ofl-1.1-ufl-1.0.diff.html - -References - - 1. http://font.ubuntu.com/ - 2. http://www.canonical.com/ - 3. http://www.daltonmaag.com/ - 4. http://en.wikipedia.org/wiki/Network_effect - 5. http://scripts.sil.org/ - 6. http://openfontlibrary.org/ - 7. http://www.softwarefreedom.org/ - 8. http://code.google.com/webfonts - 9. http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF - 10. http://scripts.sil.org/OFL_web - 11. http://scripts.sil.org/OFL-FAQ_web - 12. http://www.gnu.org/licenses/gpl-faq.html#FontException - 13. https://launchpad.net/~uff-contributors - 14. http://font.ubuntu.com/ufl/ubuntu-font-licence-1.0.txt - 15. http://font.ubuntu.com/ufl/FAQ.html#embedding - 16. http://font.ubuntu.com/ufl/ofl-1.1-ufl-1.0.diff.html diff --git a/bibli/ubuntu/LICENCE.txt b/bibli/ubuntu/LICENSE similarity index 100% rename from bibli/ubuntu/LICENCE.txt rename to bibli/ubuntu/LICENSE diff --git a/bibli/ubuntu/README.txt b/bibli/ubuntu/README.txt deleted file mode 100755 index 5602821..0000000 --- a/bibli/ubuntu/README.txt +++ /dev/null @@ -1,16 +0,0 @@ - ---------------------- - Ubuntu Font Family - ====================== - -The Ubuntu Font Family are a set of matching new libre/open fonts in -development during 2010--2011. And with further expansion work and -bug fixing during 2015. The development is being funded by -Canonical Ltd on behalf the wider Free Software community and the -Ubuntu project. The technical font design work and implementation is -being undertaken by Dalton Maag. - -Both the final font Truetype/OpenType files and the design files used -to produce the font family are distributed under an open licence and -you are expressly encouraged to experiment, modify, share and improve. - - http://font.ubuntu.com/ diff --git a/bibli/ubuntu/TRADEMARKS.txt b/bibli/ubuntu/TRADEMARKS.txt deleted file mode 100755 index d34265b..0000000 --- a/bibli/ubuntu/TRADEMARKS.txt +++ /dev/null @@ -1,4 +0,0 @@ -Ubuntu and Canonical are registered trademarks of Canonical Ltd. - -The licence accompanying these works does not grant any rights -under trademark law and all such rights are reserved. diff --git a/bibli/ubuntu/copyright.txt b/bibli/ubuntu/copyright.txt deleted file mode 100755 index 7734070..0000000 --- a/bibli/ubuntu/copyright.txt +++ /dev/null @@ -1,5 +0,0 @@ -Copyright 2010,2011 Canonical Ltd. - -This Font Software is licensed under the Ubuntu Font Licence, Version -1.0. https://launchpad.net/ubuntu-font-licence - diff --git a/cave.definition.php b/cave.definition.php deleted file mode 100755 index ddc4df0..0000000 --- a/cave.definition.php +++ /dev/null @@ -1,39 +0,0 @@ - - - -
    -

    Diverses infos concernant internet

    - -

    Internet

    -

    Internet est un réseau de réseaux. C'est le principal moyen qui permet de communiquer entre ordinateurs autour du monde.

    - -

    Web

    -

    Le Web est une partie d'internet accessible avec un navigateur Web (Firefox, Chrome, Opera, Safari ...).

    - - -

    Un navigateur Web permet d'afficher des pages Web.

    - -

    Moteur de recherche

    -

    Un moteur de recherche indexe les pages Web pour que ses utilisateurs puissent les retrouver avec un ou des mots-clés.

    - -

    Site Web

    -

    Un site Web est un regroupement de pages Web sous un nom de domaine (ex : anternet.pw).

    - -

    Page Web

    -

    Une page Web est un fichier affichant du contenu pour le Web.

    - - -

    Les cookies sont des petits fichiers invisibles déposés par certains sites Web sur votre navigateur pour personnaliser le contenu (publicité, langue, connexion ...).

    - -

    Deep web

    -

    Le DeepWeb fait parti du Web. Il désigne la partie non-indexée par les moteurs de recherche.

    - -

    Dark web

    -

    Le DarkWeb est un Web spécial, accessible uniquement via un navigateur Web spécifique. Il est diffusé par un darknet.

    - -

    Darknet

    -

    Un Darknet est réseau qui utilise internet pour le transfert anonyme d'informations. Le plus connu est celui de Tor.

    -
    - - diff --git a/cave.mdr.php b/cave.mdr.php deleted file mode 100755 index 2a90dfa..0000000 --- a/cave.mdr.php +++ /dev/null @@ -1,30 +0,0 @@ - - - -
    - -

    Moteurs de recherche

    - Cette page est encore en construction, revenez dans quelques temps. -

    -

    Qwant

    - - C'est un moteur de recherche axé sur le respect des données et de la vie privée.
    - Il n'enregistre aucune information vous concernant. - -

    - -

    -

    Google

    - - C'est un moteur de recherche axé sur la revente des informations des utilisateurs aux publicitaires.
    - Il enregistre toutes les informations vous concernant. - -

    - - -
    - - - - diff --git a/cave.module.php b/cave.module.php deleted file mode 100755 index d29d668..0000000 --- a/cave.module.php +++ /dev/null @@ -1,193 +0,0 @@ - - -
    - -

    Modules complémentaires

    - -
    -

    Bloquer les publicités | uBlock Origin

    - Popup de uBlock - Cette extension bloque les publicités sur les pages que vous visitez. Il va par conséquent accélérer la navigation. Elle est publiée sous license GNU GPL 3.0. -

    - - Télécharcher uBlock Origin pour Firefox - -
    - -
    -
    - -
    - -

    Bloquer le pistage (avec la protection contre le pistage de Firefox)

    - Préférences Firefox - - C'est une fonctionnalité intégrée dans Firefox. - - Pour l'activer, rendez-vous dans Menu > Préférences > Vie privée et sécurité > Protection contre le pistage
    puis cochez Toujours, comme montré ci-dessous.

    - -
    -
    -
    - - - -
    -

    Supprimer les cookies automatiquement (avec Cookie AutoDelete)

    - Popup de Cookie AutoDelete - Cette extension supprime automatiquement les cookies, après un certain temps. Il y a un système de liste blanche, pour garder les cookies de certains sites. Elle est publiée sous license MIT. -

    - - Télécharcher Cookie AutoDelete - - -
    - -
    -
    - - -
    -

    Se connecter par défaut en HTTPS | HTTPS partout

    - Popup de HTTPS partout - HTTPS partout (HTTPS everywhere en anglais) tente par défaut d'établir une connexion en HTTPS, puis, si cela ne marche pas, passe en HTTP. C'est un module de sécurité. - On peut également le régler pour ne se connecter qu'en HTTPS. Elle est publiée sous license GNU GPL 2.0 et +. -

    - - - Télécharcher HTTPS partout - - -
    - -
    -
    - - -
    -

    Connaître les outils utilisés sur un site | Wappalyser

    - Popup de Wappalyser - Cette extension affiche une petite icone dans la barre d'adresse. Lorsque vous cliquez dessus, elle affiche des informations sur le site Web que vous visitez. Par exemple, sur ce site, elle vous affichera qu'il fonctionne avec Nginx et PHP. Elle a simplement un but informatif. Elle est publiée sous license GNU GPL 3.0. -

    - - Télécharcher Wappalyser - -
    - -
    -
    - -
    -

    Bloquer les mouchards | Ghostery

    - Popup de Ghostery - Cette extension permet de bloquer les mouchards (publicitaires, d'analyse d'audience, etc...). Il est passé récement sous license libre (la MPL 2.0) -

    - - Télécharcher Wappalyser - -
    - -
    -
    - -
    -

    Gérez le navigateur avec les mouvements de la souris | Mouvement de la souris

    - Ce module permet d'effectuer des actions en maintenant le clic droit appuyé et en faisant un geste. Par défault :
    - ↑ - Ouvrir un nouvel onglet
    - ↓ - Fermer l'onglet actuel
    - → - Passer à l'onglet suivant
    - ← - Revenir à l'onglet précédent
    - ↗ - Actualiser l'onglet actuel
    - ↙ - Rouvrir un onglet fermé
    - ↘ - Aller à la page suivante
    - ↖ - Aller à la page précédente
    - ⇡ - Haut de page
    - ⇣ - Bas de page
    - Elle est publiée sous license GNU GPL 3.0. - -

    - - - Télécharcher Mouvement de la souris - - - -
    - -
    -

    Jouer au 2048

    - Popup du 2048 - Cette extension ouvre une popup pour jouer au 2048. C'est une adaptation par Miraty sous forme d'extension du jeu original du 2048 de Gabriele Cirulli publié sous license libre à cette adresse. - -

    - - - Télécharcher le 2048 - - - -
    - -
    -

    Les utilitaires massivement utilisés qu’il ne faut pas utiliser

    - - AdBlock Plus : vend aux entreprises de publicité des passe-droit pour figurer sur une liste blanche. En gros, si l’entreprise paye, elle peut mettre sa pub et installer son mouchard. De plus, AdBlock et AdBlock Plus sont très lourds, peuvent ralentir l’affichage des pages web et saturer l’ordinateur/smartphone. Source - - -
    -

    Explosion de TNT

    - Popup du 2048 - Une explosion de TNT de Minecraft sur un fond noir. - -

    - - - Télécharcher ce thème - - -
    - -
    -

    Explosion de TNT

    - Popup du 2048 - Une explosion de TNT de Minecraft sur un fond blanc. - -

    - - - Télécharcher ce thème - - -
    - -
    -

    Explosion de TNT

    - Popup du 2048 - Une explosion de TNT de Minecraft sur un fond gris. - -

    - - - Télécharger ce thème - - -
    - -
    -

    Explosion de TNT

    - Popup du 2048 - Une explosion de TNT de Minecraft sur un fond bleu. - -

    - - - Télécharcher ce thème - - -
    - -
    - - - diff --git a/cave.navigateur.php b/cave.navigateur.php deleted file mode 100755 index fceab62..0000000 --- a/cave.navigateur.php +++ /dev/null @@ -1,95 +0,0 @@ - - -
    -

    Navigateurs web

    -

    - Voici une liste de navigateurs web, destinée à ce que vous trouviez celui qui vous convienne. - -

    -

    Menu

    -
    - - - - - - - - - - - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->query('SELECT * FROM navigateur'); - - while ($donnees = $reponse->fetch()) { ?> - - - - - - - - - - closeCursor(); ?> - - - -
    NomEditeurLibreMoteur de renduExtensions
    -
    -

    - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->query("SELECT * FROM navigateur ORDER BY 'num' DESC"); - - while ($donnees = $reponse->fetch()) { ?> - -
    - Logo <?php echo $donnees['nomComplet']; ?> -
    - -
    -
    - Mon avis : - -
    - Interface de <?php echo $donnees['nomComplet']; ?> - Site officiel - Page Wikipédia -
    -
    - - - - - - closeCursor(); ?> -
    - - - - diff --git a/cave.os.php b/cave.os.php deleted file mode 100755 index 5a8d1ed..0000000 --- a/cave.os.php +++ /dev/null @@ -1,123 +0,0 @@ - - -

    Systèmes d'exploitation

    - - L'abréviation "OS" désigne les systèmes d'exploitation (Operating System en anglais). - - -
    -

    Linux

    - -
    - - Le noyau Linux est un logiciel TRÈS complexe qui sert de base à beaucoup d'OS en raison de la liberté de son code. - Linux désigne les OS basés sur son noyau. - -
    -

    Debian

    - Debian est un OS complet et peut être utilisé directement sur un ordinateur, mais il est aussi la base d'autres OS. - -
    -

    Ubuntu

    - Ubuntu est un OS développé par Canonical qui se base sur Debian en lui ajoutant un certain nombre de modifications. -
    -
    Ubuntu 16.04 Xenial Xerus
    - Ubuntu 16.04 Xenial Xerus est la version d'Ubuntu sortie en avril 2016. -
    - -
    -
    Ubuntu 18.04 Bionic Beaver
    - Ubuntu 18.04 Bionic Beaver est la version d'Ubuntu sortie en avril 2018. -
    - -
    -
    Kubuntu
    - Kubuntu est une "saveur" d'Ubuntu : cet OS utilise la base logicielle d'Ubuntu. La différence se trouve dans l'environnement de bureau qui est celui de KDE. -
    - -
    -
    Edubuntu
    -
    - -
    -
    Linux Mint
    - Linux Mint est une "saveur" d'Ubuntu : cet OS utilise la base logicielle d'Ubuntu. La différence se trouve dans l'environnement de bureau qui est cinnamon. -
    - -
    -
    Xubuntu
    - Kubuntu est une "saveur" d'Ubuntu : cet OS utilise la base logicielle d'Ubuntu. La différence se trouve dans l'environnement de bureau qui est XFCE. -
    - -
    -
    Lubuntu
    -
    - -
    -
    - -
    -

    Red Hat

    - -
    -

    Fedora

    -
    - -
    -

    Suse

    - -
    -
    OpenSuse
    -
    - -
    -
    - -
    -

    Slackware

    -
    - -
    -

    Android

    - -
    -

    Android 7 Nougat

    -
    - -
    -

    Android 8 Oreo

    -
    - -
    -

    LineageOS

    -
    - -
    - -
    -
    - -
    -

    Windows

    - -
    -

    Windows 7

    -
    - -
    -

    Windows 8

    -
    - -
    -

    Windows 10

    -
    - -
    - -
    -

    MacOS / iOS

    -
    - - - diff --git a/cgu.php b/cgu.php index 8d3f256..073ff5a 100755 --- a/cgu.php +++ b/cgu.php @@ -1,172 +1,175 @@ + -

    Conditions générales d'utilisation du site www.antopie.org

    +

    Conditions d'utilisation

    - +

    Préambule

    +

    + En utilisant l'un des services Antopie listés + ici, vous acceptez d’être lié par + les conditions suivantes.
    Antopie se réserve le droit de mettre + à jour et modifier ces conditions de temps à autre. + Ces conditions sont dérivées de celles de Framasoft. +

    + - function motShadock($nombreDeMots) { - $i = 1; - while ($i <= $nombreDeMots) { - switch (mt_rand(0, 69)) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: - echo "GA "; - break; - case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: - echo "BU "; - break; - case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: - echo "ZO "; - break; - case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: case 64: - echo "MEU "; - break; +
    +

    Conditions des services

    - case 65: - switch (mt_rand(1, 4)) { - case 1: - echo "GA "; - break; - case 2: - echo "BU "; - break; - case 3: - echo "ZO "; - break; - case 4: - echo "MEU "; - break; - default: - echo "ERREUR 1"; - } - break; +
      +
    1. L’utilisation des services se fait à vos propres risques. Le + service est fourni tel quel.
    2. +
    3. Vous ne devez pas modifier un autre site afin de signifier + faussement qu’il est associé avec ce service Antopie.
    4. +
    5. Les comptes ne peuvent être créés et utilisés que par des + humains. Les comptes créés par les robots ou autres méthodes + automatisées pourront être supprimés sans avertissement.
    6. +
    7. Vous êtes responsable de la sécurité de votre compte et de + votre mot de passe.
      Antopie ne peut pas et ne sera pas + responsable de toutes pertes ou dommages résultant de votre + non-respect de cette obligation de sécurité.
    8. +
    9. Vous êtes responsable de tout contenu affiché et de l’activité + qui se produit sous votre compte.
    10. +
    11. Vous ne pouvez pas utiliser le service à des fins illégales ou + non autorisées.
      Antopie étant hébergé en France par un + français, vous devez respecter la loi française.
    12. +
    13. Vous ne pouvez pas vendre, échanger, revendre, ou exploiter + dans un but commercial non autorisé un compte du service + utilisé.
    14. +
    +

    La violation de l’un de ces accords entraînera la résiliation de + votre compte.
    + Vous comprenez et acceptez que le collectif Antopie ne puisse être + tenu responsable pour les contenus publiés sur ce service.

    - case 66: - switch (mt_rand(1, 4)) { - case 1: - echo "GA "; - break; - case 2: - echo "BU "; - break; - case 3: - echo "ZO "; - break; - case 4: - echo "MEU "; - break; - default: - echo "ERREUR 2"; - } - break; +
      +
    1. Vous comprenez que la mise en ligne du service ainsi que de + votre contenu implique une transmission (chiffrée, normalement) sur divers réseaux. +
    2. +
    3. Vous ne devez pas transmettre des vers, des virus ou tout autre + code de nature malveillante.
    4. +
    5. Antopie ne garantit pas : +
        +
      • que les services seront maintenus à long terme,
      • +
      • que le service répondra à vos besoins spécifiques,
      • +
      • que le service sera ininterrompu ou exempte de bugs,
      • +
      • que les erreurs dans le service seront corrigées.
      • +
      +
    6. +
    7. Vous comprenez et acceptez qu'Antopie ne puisse être tenu + responsable de tous dommages directs, indirects, ou fortuits, + comprenant les dommages pour perte de profits, de clientèle, + d’accès, de données ou d’autres pertes intangibles (même si + Antopie est informé de la possibilité de tels dommages) et + qui résulteraient de : +
        +
      1. l’utilisation ou de l’impossibilité d’utiliser l'un des services ;
      2. +
      3. l’accès non autorisé ou altéré de la transmission des données ;
      4. +
      5. les déclarations ou les agissements d’un tiers sur l'un des services ;
      6. +
      7. la résiliation de votre compte ;
      8. +
      9. toute autre question relative au service.
      10. +
      +
    8. +
    9. L’échec d'Antopie à exercer ou à appliquer tout droit ou + disposition des Conditions Générales d’Utilisation ne constitue + pas une renonciation à ce droit ou à cette disposition. Les + Conditions d’utilisation constituent l’intégralité de l’accord + entre vous et Antopie et régissent votre utilisation du + service, remplaçant tous les accords antérieurs entre vous et + Antopie (y compris les versions précédentes des conditions + d’utilisation). +
    10. +
    11. Les questions sur les conditions de service doivent être + envoyées par email.
    12. +
    - case 67: - switch (mt_rand(1, 4)) { - case 1: - echo "GA "; - break; - case 2: - echo "BU "; - break; - case 3: - echo "ZO "; - break; - case 4: - echo "MEU "; - break; +

    Modifications du service

    +
      +
    1. Antopie se réserve le droit, à tout moment de modifier ou + d’interrompre, temporairement ou définitivement, le service + avec ou sans préavis.
    2. +
    3. Antopie ne sera pas responsable envers vous ou tout tiers + pour toute modification, suspension ou interruption du + service.
    4. +
    - default: - echo "ERREUR"; - } - break; +

    Droit d’auteur sur le contenu

    - case 68: - switch (mt_rand(1, 3)) { - case 1: - echo "JE CE RT IF IE ÊT RE UN PO UL ET WI SI GO TH AF FA MÉ "; - break; - case 2: - echo "JE JU RE SU RL 'H ON NE UR ÊT RE UN IL LU MI NA TI AY AN TP OU RO BJ EC TI FD ED ÉT RU IR EL 'H UM AN IT É, PA SL EJ OU RN AL ,L 'E SP ÈCE "; - break; - case 3: - echo "J' AC CE PT ED EN EP AS PO UV OI RP OR TE RP LA IN TE AU PR ÈS DE AN TO PI E. OR G "; - break; +
      +
    1. Vous ne pouvez pas envoyer, télécharger, publier sur un blog, + distribuer, diffuser tout contenu illégal, diffamatoire, + harcelant, abusif, frauduleux, contrefait, obscène ou autrement + répréhensible.
    2. +
    3. Nous ne revendiquons aucun droit sur vos données : textes, + images, son, vidéo, ou tout autre élément, que vous téléchargez + ou transmettez depuis votre compte.
    4. +
    5. Nous n’utiliserons pas votre contenu pour un autre usage que de + vous fournir le service.
    6. +
    7. Vous ne devez pas télécharger ou rendre disponible tout contenu + qui porte atteinte aux droits de quelqu’un d’autre.
    8. +
    9. Nous nous réservons le droit de supprimer tout contenu nous + paraissant non pertinent pour l’usage du service, selon notre + seul jugement.
    10. +
    11. Nous pouvons, si nécessaire, supprimer ou empêcher la diffusion + de tout contenu sur le service qui ne respecterait pas les + présentes conditions.
    12. +
    + +

    Édition et partage de données

    +
      +
    • Les fichiers que vous créez avec le service peuvent être - si + vous le souhaitez - lus, copiés, utilisés et redistribués par + des gens que vous connaissez ou non.
    • +
    • En rendant publiques vos données, vous reconnaissez et acceptez + que toute personne utilisant l'un des services puisse les consulter + sans restrictions.
    • +
    • Antopie ne peut être tenu responsable de tout problème + résultant du partage ou de la publication de données entre + utilisateurs.
    • +
    + +

    Résiliation

    + +

    Antopie, à sa seule discrétion, a le droit de suspendre ou de + résilier votre compte et de refuser toute utilisation actuelle ou + future du service. Cette résiliation du service entraînera la + désactivation de l’accès à votre compte, et la restitution de tout le + contenu.
    Antopie se réserve le droit de refuser le service à + n’importe qui pour n’importe quelle raison à tout moment.

    + +

    Données personnelles

    + +

    Conformément à l’article 34 de la loi « Informatique et Libertés », + Antopie garantit à l’utilisateur un droit d’opposition, d’accès et de + rectification sur les données nominatives le concernant. L’utilisateur + a la possibilité d’exercer ce droit en envoyant un email à l'administrateur.

    + +
      +
    • Pour utiliser certains services d'Antopie, vous devez créer un + compte. Antopie demande certaines informations personnelles : + une adresse e-mail valide et un mot de passe qui est utilisé + pour protéger votre compte contre tout accès non autorisé. Les + champs « Nom » et « Prénom » peuvent être requis pour le bon + fonctionnement du logiciel, mais il n’est pas nécessaire qu’ils + révèlent votre véritable identité.
    • +
    • Tout comme d’autres services en ligne, Antopie enregistre + automatiquement certaines informations concernant votre + utilisation du service telles que l’activité du compte (exemple + : espace de stockage occupé, nombre d’entrées, mesures prises), + les données affichées ou cliquées (exemple : liens, éléments de + l’interface utilisateur), et d’autres informations pour vous + identifier (exemple : type de navigateur, adresse IP, date et + heure de l’accès, URL de référence). +
    • +
    • Nous utilisons ces informations en interne pour vous améliorer + l’interface utilisateur des services d'Antopie et maintenir une + expérience utilisateur cohérente et fiable.
    • +
    • Ces données ne sont ni vendues, ni transmises à des tiers.
    • +
    +
    - default: - echo "ERREUR"; - } - break; - - case 69: - echo "GA GA GA ! "; - break; - - - - default: - echo "ERREUR"; - } - $i++; - } - } - - function motShadockTitre($nombreDeMots) { - $i = 1; - while ($i <= $nombreDeMots) { - switch (mt_rand(1, 4)) { - case 1: - echo "GA "; - break; - - case 2: - echo "BU "; - break; - - case 3: - echo "ZO "; - break; - - case 4: - echo "MEU "; - break; - default: - echo "ERREUR"; - } - $i++; - } - } - - - - $i = 1; - $max = mt_rand(2, 8); - while ($i <= $max) { ?> -

    - -

    - -

    - - - - -

    - - - - + diff --git a/commentaire.php b/commentaire.php deleted file mode 100755 index bc74f55..0000000 --- a/commentaire.php +++ /dev/null @@ -1,220 +0,0 @@ - -

    Espace commentaire

    -
    - Bienvenue dans l'espace commentaire ! Ici vous pouvez laisser des commentaires pour améliorer le site ou dire ce que vous en pensez. -
    - - -
    - - -
    -

    Pseudo



    - - -
    - - - -
    -

    Pseudo

    - -
    - - - - -
    -
    -

    Commentaire

    - - Les retours à la ligne ne sont pas pris en compte -

    - -
    - - - - - - -
    -

    Captcha

    - - -

    - - Veuillez recopier ci-dessous les 3 nombres des images ci-dessus. -

    -
    - - -
    - -
    - -
    -
    - -

    - - -
    - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $req = $bdd->prepare('INSERT INTO commentaires(pseudo, anonyme, commentaire) VALUES(:pseudo, :anonyme, :commentaire)'); - - if (isset($_SESSION['pseudo'])) { - - - $req->execute(array( - 'pseudo' => $_SESSION['pseudo'], - 'anonyme' => $anonyme, - 'commentaire' => $_POST['commentaire'] - - )); - - } else { - - - $req->execute(array( - 'pseudo' => $_POST['pseudo'], - 'anonyme' => $anonyme, - 'commentaire' => $_POST['commentaire'] - )); - - } - - - $req->closeCursor(); - - } - - - - - - - - } else { - echo "Vous avez mal rempli le captcha"; - } - - - - } else { - echo "Vous n'avez pas rempli tous les champs"; - } - ?> - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->query('SELECT * FROM commentaires'); - - while ($donnees = $reponse->fetch()) { ?> -
    - - - Anonyme - - - - -

    - .' class="commentaire">

    -
    -
    - closeCursor(); ?> - -

    - diff --git a/confirmationlien.php b/confirmationlien.php deleted file mode 100755 index d13a888..0000000 --- a/confirmationlien.php +++ /dev/null @@ -1,119 +0,0 @@ - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $req = $bdd->prepare('UPDATE `compte` SET `confirmerLien` = "non" WHERE `compte`.`pseudo` = :pseudo'); - - $req->execute(array( - 'pseudo' => $_SESSION['pseudo'] - )); - - $req->closeCursor(); - - - } - - - - - // Identifier le nom de domaine - $nomDeDomaine = htmlspecialchars(preg_replace("#https://#", "", $_GET['lien'])); - $nomDeDomaine = preg_replace("#http://#", "", $nomDeDomaine); - $nomDeDomaine = preg_replace("#/s#", "SAKLDGHK", $nomDeDomaine); - $nomDeDomaine = preg_replace("#/a|/z|/e|/r|/t|/y|/u|/i|/o|/p|/q|/d|/f|/g|/h|/j|/k|/l|/m|/v|/w|/x|/c|/v|/b|/n#", "", $nomDeDomaine); - $nomDeDomaine = preg_replace("#

    in ' + filenameNoPath + ' '; - - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':

    .{1,100}#", "", $nomDeDomaine); - $nomDeDomaine = preg_replace("#SAKLDGHK.{1,100}#", "", $nomDeDomaine); - - - if (isset($_GET['nepasconfirmer']) AND $_GET['nepasconfirmer'] == "oui") { ?> - - - - - -
    -

    - Vous avez cliqué sur ce lien : -

    - -

    - Avez-vous confiance envers ce lien ou la personne qui vous l'a envoyé ? -

    - Souhaitez-vous suivre ce lien ? -

    - Non, revenir en arrière Oui, suivre ce lien - -
    -
    - toujours suivre les liens - - - - -
    - - - - - -
    -

    - Vous avez cliqué sur ce lien : -

    - -

    - Mais ce lien parait erroné : il ne parais pas utiliser le protocol http ou https. -

    - revenir en arrière - - -
    - - - - -Erreur : il n'y a pas de lien en argument dans l'URL. Pour utiliser cette page, il faut ajouter à sa suite "?lien=" et une URL. - - - - - - - diff --git a/connexion.php b/connexion.php deleted file mode 100755 index 2eaacea..0000000 --- a/connexion.php +++ /dev/null @@ -1,134 +0,0 @@ - - - - PDO::ERRMODE_EXCEPTION)); - } - - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->query('SELECT * FROM compte'); - - - $compteExiste = false; - while ($donnees = $reponse->fetch()) { - - - if ($_POST['pseudo'] == $donnees['pseudo']) { - $compteExiste = true; - - if (password_verify($_POST['mdp'], $donnees['mdp'])) { - $_SESSION['pseudo'] = htmlspecialchars($donnees['pseudo']); - $_SESSION['confirmerLien'] = $donnees['confirmerLien']; - - if (isset($_GET['depuis'])) { ?> - -
    -

    - Connexion réussie, bienvenue ! -

    - Vous allez être redirigé·e vers la page d'où vous venez. - Si vous n'êtes pas redirigé·e automatiquement, veuillez cliquer ici. - -
    - - - - - - -
    -

    - Connexion réussie, bienvenue ! -

    - Vous allez être redirigé·e vers la page d'accueil.
    - Si vous n'êtes pas redirigé·e automatiquement, veuillez cliquer ici. - -
    - - Mot de passe incorrect - closeCursor(); - - - if ($compteExiste == false) { ?> - - Ce pseudo ne correspond à aucun compte ! - - -
    -

    Connexion

    - -

    Pseudo :

    - -
    -

    Mot de passe :

    - -
    -
    -

    -
    - -
    -
    -
    - Pas encore de compte ? -
    -
    - Créer un compte - -
    - - - - diff --git a/css/base.less b/css/base.less index 99ea071..6f1077d 100755 --- a/css/base.less +++ b/css/base.less @@ -320,14 +320,20 @@ strong { } body { - font-family: fin; + font-family: ubuntu; padding: 0px; margin: 0px; background-color: @fond; color: @texte-principal; + font-size: 25px; + line-height: 35px; } +h1, h2, h3, h4, h5, h6 { + font-family: fin; +} + .milieu { display: flex; @@ -337,8 +343,7 @@ body { .main { display: flex; - margin-right: 10px; - margin: 8px; + margin: 0px; } @@ -519,15 +524,16 @@ footer { /* ----------------------- MENU ------------------------ */ .menugauche { - margin: 6px; + margin: 0px; overflow: auto; - border-radius: 12px; - width: 17em; - border: 3px white solid; + margin-top: 20px; + width: 16em; + border-bottom: 3px white solid; + border-right: 3px white solid; + border-top: 3px white solid; + border-radius: 0px 12px 12px 0px; text-align: center; - // transition: all 1s ease-in; - margin-bottom: 0px; - margin-right: 0px; + } @@ -888,6 +894,11 @@ footer { } +.gomez { + + +} + // HEADERS diff --git a/css/gomez.css b/css/gomez.css new file mode 100644 index 0000000..3d60582 --- /dev/null +++ b/css/gomez.css @@ -0,0 +1,397 @@ + +.gomez-items-wrap { + display: flex; + flex: 70; + width: 100%; + justify-content: space-around; +} + +.gomez-item-wrap { + width: 142px; + height: 192px; + display: flex; + align-items: center; + justify-content: center; +} + +.gomez { + width: 10px; + height: 10px; + display: block; + transform: translate(-500%, -500%); /* OMG, it's magic */ + background: transparent; +} + +.gomez.yeah { + box-shadow: + /* + Conjuntos de sombras, da esquerda para direita, de cima para baixo (exceção do chapéu) + */ + + /* linha 1 */ + 10px 0 0 #a3a085, + 19px 0 0 #e1ced2, + 29px 0 0 #fff, + 39px 0 0 #fff, + 49px 0 0 #fff, + 59px 0 0 #fff, + 69px 0 0 #fff, + 79px 0 0 #fff, + 89px 0 0 #fff, + 99px 0 0 #fff, + 106px 0 0 #fff, + + /* linha 2 */ + 0 10px 0 #a3a085, + 10px 10px 0 #e1ced2, + 19px 10px 0 #e1ced2, + 29px 10px 0 #fff, + 39px 10px 0 #fff, + 49px 10px 0 #fff, + 59px 10px 0 #fff, + 69px 10px 0 #fff, + 79px 10px 0 #fff, + 89px 10px 0 #fff, + 99px 10px 0 #fff, + 109px 10px 0 #fff, + 116px 10px 0 #fff, + + /* linha 3 */ + 0 20px 0 #a3a085, + 10px 20px 0 #e1ced2, + 19px 20px 0 #fff, + 29px 20px 0 #000, /* olho */ + 39px 20px 0 #fff, + 49px 20px 0 #fff, + 59px 20px 0 #fff, + 69px 20px 0 #fff, + 79px 20px 0 #fff, + 89px 20px 0 #fff, + 96px 20px 0 #fff, + 106px 20px 0 #000, /* olho */ + 116px 20px 0 #fff, + + /* linha 4 */ + 0 30px 0 #a3a085, + 10px 30px 0 #e1ced2, + 19px 30px 0 #fff, + 29px 30px 0 #fff, + 39px 30px 0 #fff, + 49px 30px 0 #fff, + 59px 30px 0 #000, + 69px 30px 0 #000, + 79px 30px 0 #000, + 87px 30px 0 #000, + 97px 30px 0 #fff, + 107px 30px 0 #fff, + 116px 30px 0 #fff, + + /* linha 5 */ + 0 40px 0 #a3a085, + 10px 40px 0 #e1ced2, + 19px 40px 0 #fff, + 29px 40px 0 #fff, + 39px 40px 0 #fff, + 49px 40px 0 #fff, + 59px 40px 0 #c9326e, + 68px 40px 0 #c9326e, + 78px 40px 0 #000, + 87px 40px 0 #000, + 97px 40px 0 #fff, + 107px 40px 0 #fff, + 116px 40px 0 #fff, + + /* linha 6 */ + 0 50px 0 #a3a085, + 10px 50px 0 #e1ced2, + 19px 50px 0 #fff, + 29px 50px 0 #fff, + 39px 50px 0 #fff, + 49px 50px 0 #fff, + 59px 50px 0 #fff, + 68px 50px 0 #c9326e, + 78px 50px 0 #000, + 87px 50px 0 #fff, + 97px 50px 0 #fff, + 107px 50px 0 #fff, + 116px 50px 0 #fff, + + /* linha 7 abaixo da boca */ + 29px 60px 0 #e1ced2, + 20px 60px 0 #a3a085, + 29px 60px 0 #e1ced2, + 39px 60px 0 #fff, + 49px 60px 0 #fff, + 59px 60px 0 #fff, + 69px 60px 0 #fff, + 79px 60px 0 #fff, + 87px 60px 0 #fff, + 97px 60px 0 #fff, + 107px 60px 0 #fff, + + /* linha 8 pescoço */ + 39px 70px 0 #a3a085, + 49px 70px 0 #a3a085, + 59px 70px 0 #e1ced2, + 68px 70px 0 #fff, + + /* linha 9 braços */ + 10px 80px 0 #a3a085, + 19px 80px 0 #fff, + 29px 80px 0 #fff, + 39px 80px 0 #e1ced2, + 49px 80px 0 #fff, + 59px 80px 0 #fff, + 68px 80px 0 #fff, + 78px 80px 0 #fff, + 88px 80px 0 #a3a085, + 97px 80px 0 #a3a085, + + /* linha 10 */ + 29px 90px 0 #fff, + 20px 90px 0 #a3a085, + 29px 90px 0 #fff, + 39px 90px 0 #fff, + 49px 90px 0 #fff, + 59px 90px 0 #fff, + 69px 90px 0 #fff, + 78px 90px 0 #fff, + 88px 90px 0 #a3a085, + + /* linha 11 */ + 29px 100px 0 #a3a085, + 39px 100px 0 #fff, + 49px 100px 0 #fff, + 59px 100px 0 #fff, + 69px 100px 0 #fff, + 78px 100px 0 #fff, + + /* linha 12 */ + 29px 110px 0 #a3a085, + 39px 110px 0 #e1ced2, + 49px 110px 0 #fff, + 59px 110px 0 #fff, + 69px 110px 0 #fff, + 78px 110px 0 #fff, + + /* linha 13 */ + 29px 120px 0 #a3a085, + 39px 120px 0 #e1ced2, + 49px 120px 0 #fff, + 59px 120px 0 #fff, + 69px 120px 0 #fff, + 78px 120px 0 #fff, + + /* linha 14 */ + 29px 130px 0 #a3a085, + 39px 130px 0 #e1ced2, + 49px 130px 0 #a3a085, + 59px 130px 0 #a3a085, + 69px 130px 0 #e1ced2, + 78px 130px 0 #a3a085, + + /* linha 15 pés */ + 19px 140px 0 #a3a085, + 29px 140px 0 #e1ced2, + 69px 140px 0 #a3a085, + + /* chapéu linha 1 */ + 30px -40px 0 #e89a2e, + 40px -40px 0 #c0060b, + 50px -40px 0 #c0060b, + + /* chapéu linha 2 */ + 20px -30px 0 #e89a2e, + 30px -30px 0 #91000f, + 40px -30px 0 #c0060b, + 50px -30px 0 #c0060b, + + /* chapéu linha 3 */ + 30px -20px 0 #91000f, + 40px -20px 0 #c0060b, + 50px -20px 0 #c0060b; +} + +.gomez.umm { + box-shadow: + /* + Conjuntos de sombras, da esquerda para direita, de cima para baixo (exceção do chapéu) + */ + + /* linha 1 */ + 10px 0 0 #a3a085, + 19px 0 0 #e1ced2, + 29px 0 0 #fff, + 39px 0 0 #fff, + 49px 0 0 #fff, + 59px 0 0 #fff, + 69px 0 0 #fff, + 79px 0 0 #fff, + 89px 0 0 #fff, + 99px 0 0 #fff, + 106px 0 0 #fff, + + /* linha 2 */ + 0 10px 0 #a3a085, + 10px 10px 0 #e1ced2, + 19px 10px 0 #fff, + 29px 10px 0 #fff, + 39px 10px 0 #fff, + 49px 10px 0 #fff, + 59px 10px 0 #fff, + 69px 10px 0 #fff, + 79px 10px 0 #fff, + 89px 10px 0 #fff, + 99px 10px 0 #fff, + 109px 10px 0 #fff, + 116px 10px 0 #fff, + + /* linha 3 */ + 0 20px 0 #a3a085, + 10px 20px 0 #e1ced2, + 19px 20px 0 #fff, + 29px 20px 0 #fff, + 39px 20px 0 #fff, + 49px 20px 0 #fff, + 59px 20px 0 #fff, + 69px 20px 0 #fff, + 79px 20px 0 #fff, + 89px 20px 0 #fff, + 96px 20px 0 #fff, + 106px 20px 0 #fff, /* olho */ + 116px 20px 0 #fff, + + /* linha 4 */ + 0 30px 0 #a3a085, + 10px 30px 0 #e1ced2, + 19px 30px 0 #fff, + 29px 30px 0 #000, /* olho */ + 39px 30px 0 #fff, + 49px 30px 0 #fff, + 59px 30px 0 #fff, + 69px 30px 0 #fff, + 79px 30px 0 #fff, + 87px 30px 0 #fff, + 97px 30px 0 #fff, + 107px 30px 0 #000, /* olho */ + 116px 30px 0 #fff, + + /* linha 5 */ + 0 40px 0 #a3a085, + 10px 40px 0 #e1ced2, + 19px 40px 0 #fff, + 29px 40px 0 #fff, + 39px 40px 0 #fff, + 49px 40px 0 #fff, + 59px 40px 0 #fff, + 68px 40px 0 #fff, + 78px 40px 0 #fff, + 87px 40px 0 #fff, + 97px 40px 0 #fff, + 107px 40px 0 #fff, + 116px 40px 0 #fff, + + /* linha 6 */ + 0 50px 0 #a3a085, + 10px 50px 0 #e1ced2, + 19px 50px 0 #fff, + 29px 50px 0 #fff, + 39px 50px 0 #fff, + 49px 50px 0 #fff, + 59px 50px 0 #fff, + 68px 50px 0 #fff, + 78px 50px 0 #000, /* boca */ + 87px 50px 0 #fff, + 97px 50px 0 #fff, + 107px 50px 0 #fff, + 116px 50px 0 #fff, + + /* linha 7 */ + 29px 60px 0 #e1ced2, + 20px 60px 0 #a3a085, + 29px 60px 0 #e1ced2, + 39px 60px 0 #fff, + 49px 60px 0 #fff, + 59px 60px 0 #fff, + 69px 60px 0 #fff, + 79px 60px 0 #fff, + 87px 60px 0 #fff, + 97px 60px 0 #fff, + 107px 60px 0 #fff, + + /* linha 8 pescoço */ + 39px 70px 0 #a3a085, + 49px 70px 0 #a3a085, + 59px 70px 0 #e1ced2, + 68px 70px 0 #fff, + + /* linha 9 */ + 29px 80px 0 #a3a085, + 39px 80px 0 #e1ced2, + 49px 80px 0 #fff, + 59px 80px 0 #fff, + 68px 80px 0 #fff, + 78px 80px 0 #fff, + + /* linha 10 */ + 19px 90px 0 #a3a085, + 29px 90px 0 #fff, + 39px 90px 0 #fff, + 49px 90px 0 #fff, + 59px 90px 0 #fff, + 68px 90px 0 #fff, + 78px 90px 0 #fff, + + /* linha 11 */ + 10px 100px 0 #a3a085, + 19px 100px 0 #fff, + 29px 100px 0 #a3a085, + 39px 100px 0 #fff, + 49px 100px 0 #fff, + 59px 100px 0 #fff, + 68px 100px 0 #fff, + 78px 100px 0 #fff, + 88px 100px 0 #e1ced2, + + /* linha 12 */ + 29px 110px 0 #a3a085, + 39px 110px 0 #e1ced2, + 49px 110px 0 #fff, + 59px 110px 0 #fff, + 69px 110px 0 #fff, + 78px 110px 0 #fff, + + /* linha 13 */ + 29px 120px 0 #a3a085, + 39px 120px 0 #e1ced2, + 49px 120px 0 #e1ced2, + 59px 120px 0 #e1ced2, + 69px 120px 0 #fff, + 78px 120px 0 #fff, + + /* linha 14 */ + 29px 130px 0 #a3a085, + 39px 130px 0 #e1ced2, + 69px 130px 0 #a3a085, + 78px 130px 0 #e1ced2, + + /* linha 15 */ + 29px 140px 0 #a3a085, + 78px 140px 0 #a3a085, + + /* chapéu linha 1 */ + 30px -30px 0 #e89a2e, + 40px -30px 0 #c0060b, + 50px -30px 0 #c0060b, + + /* chapéu linha 2 */ + 20px -20px 0 #e89a2e, + 30px -20px 0 #91000f, + 40px -20px 0 #c0060b, + 50px -20px 0 #c0060b, + + /* chapéu linha 3 */ + 30px -10px 0 #91000f, + 40px -10px 0 #c0060b, + 50px -10px 0 #c0060b; +} diff --git a/deconnexion.php b/deconnexion.php deleted file mode 100755 index 378fed3..0000000 --- a/deconnexion.php +++ /dev/null @@ -1,38 +0,0 @@ - - - -
    -

    - Vous avez été déconnecté·e -

    -

    - Votre session PHP a été effacée avec l'instruction session_destroy(). -

    - Vous allez être redirigé·e vers la page d'où vous venez. - -
    - - - - - - -
    -

    - Vous avez été déconnecté·e -

    -

    - Votre session PHP a été effacée avec l'instruction session_destroy(). -

    - Vous allez être redirigé·e vers la page d'accueil. - -
    - diff --git a/fourmiliere.php b/fourmiliere.php deleted file mode 100755 index 6786d67..0000000 --- a/fourmiliere.php +++ /dev/null @@ -1,634 +0,0 @@ - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $req = $bdd->prepare('INSERT INTO commentairesArticle(titre, pseudo, commentaire) VALUES(:titre, :pseudo, :commentaire)'); - - $req->execute(array( - 'titre' => $_GET['articlecommenté'], - 'pseudo' => $_SESSION['pseudo'], - 'commentaire' => $_POST['commentaire'] - )); - - $req->closeCursor(); - -} - - - - -// --------------------------------------------- Enregistrer un article dans la BDD --------------------------------------------- -if (isset($_GET['etape']) AND $_GET['etape'] == "publier" AND isset($_POST['article']) AND isset($_SESSION['pseudo'])) { - - - // ------------------------- Enregistrer la modification d'un article ------------------------- - if (isset($_GET['modifier'])) { - - try { - $bdd = new PDO('mysql:host=localhost;dbname=my_webapp;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->prepare('SELECT * FROM articles WHERE `articles`.`titre` = :titre'); - - $reponse->execute(array( - 'titre' => $_GET['modifier'] - )); - - while ($donnees = $reponse->fetch()) { - - $createurDeLArticle = $donnees['pseudo']; - - } $reponse->closeCursor(); - - - if ($_SESSION['pseudo'] == $createurDeLArticle) { - - include "inc/loginsbdd.php"; - - try { - $bdd = new PDO('mysql:host=localhost;dbname=my_webapp;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $req = $bdd->prepare('UPDATE `articles` SET `article` = :article WHERE `articles`.`titre` = :titre'); - - $req->execute(array( - 'titre' => htmlspecialchars($_GET['modifier']), - 'article' => htmlspecialchars($_POST['article']) - )); - - $req->closeCursor(); - - - } else { - echo "ERREUR : Vous n'avez pas créé cet article"; - } - - - - // ------------------------- Enregistrer un nouvel article ------------------------- -} else if (isset($_POST['titre'])) { - - include "inc/loginsbdd.php"; - - try { - $bdd = new PDO('mysql:host=localhost;dbname=my_webapp;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $req = $bdd->prepare('INSERT INTO articles(pseudo, titre, article, moment) VALUES(:pseudo, :titre, :article, NOW())'); - - $req->execute(array( - 'pseudo' => htmlspecialchars($_SESSION['pseudo']), - 'titre' => htmlspecialchars($_POST['titre']), - 'article' => htmlspecialchars($_POST['article']) - )); - - $req->closeCursor(); - - } else { - echo "ERREUR : Vous devez donner un titre à votre article"; - } - -} - - - - - -// ------------------------- Afficher seulement un article ------------------------- -if (isset($_GET['article'])) { - - - // Afficher un article déja créé - include "inc/loginsbdd.php"; - - try { - $bdd = new PDO('mysql:host=localhost;dbname=my_webapp;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->prepare('SELECT * FROM articles WHERE `articles`.`titre` = :titre'); - - $reponse->execute(array( - 'titre' => $_GET['article'] - )); - - while ($donnees = $reponse->fetch()) { ?> - - -
    - - -
    -
    - -
    -
    -
    -
    -
    - - - -
    - - -
    - - - - - - -
    - - -
    - - - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $repSQL = $bdd->prepare('SELECT * FROM commentairesArticle WHERE `commentairesArticle`.`titre` = :titre'); - - - $repSQL->execute(array( - 'titre' => htmlspecialchars($donnees['titre']) - )); - - while ($fourm = $repSQL->fetch()) { ?> - -
    - -
    -
    .' class="commentaire"> - -
    -
    -
    - - closeCursor(); ?> - - -
    - -closeCursor(); ?> - - - -
    - -
    -
    - -
    - Vous êtes connecté·e en tant que . -
    - -
    -
    -
    - Connexion -
    - - - - -
    - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->query('SELECT titre, pseudo, article, DAY(moment) AS jour, MONTH(moment) AS mois, YEAR(moment) AS annee, HOUR(moment) AS heure, MINUTE(moment) AS minute, SECOND(moment) AS seconde FROM articles'); - - while ($donnees = $reponse->fetch()) { ?> - -
    -
    - Posté par le à - : - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponseMOD = $bddMOD->prepare('SELECT * FROM articles WHERE `articles`.`titre` = :titre'); - - $reponseMOD->execute(array( - 'titre' => $donnees['titre'] - )); - - while ($donneesMOD = $reponseMOD->fetch()) { - - $createurDeLArticle = $donneesMOD['pseudo']; - - } $reponseMOD->closeCursor(); - - if (isset($_SESSION['pseudo']) AND $_SESSION['pseudo'] == $createurDeLArticle) { ?> - Modifier - - Afficher uniquement cet article - -
    -
    - -
    -
    -
    -
    -
    - -
    - - -
    - - - - - - -
    - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $repSQL = $bdd->prepare('SELECT * FROM commentairesArticle WHERE `commentairesArticle`.`titre` = :titre'); - - - $repSQL->execute(array( - 'titre' => $donnees['titre'] - )); - - while ($fourm = $repSQL->fetch()) { ?> -
    - -
    - -
    -
    .' class="commentaire">
    -
    - - closeCursor(); ?> - -
    - - closeCursor(); ?> - - - - - - - - PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponse = $bdd->prepare('SELECT * FROM articles WHERE `articles`.`titre` = :titre'); - - $reponse->execute(array( - 'titre' => $_GET['modifier'] - )); - - while ($donnees = $reponse->fetch()) { - - $createurDeLArticle = $donnees['pseudo']; - - } $reponse->closeCursor(); - - if (!isset($createurDeLArticle)) { - echo "YAPAS !"; - - } - - - if ($_SESSION['pseudo'] == $createurDeLArticle) { ?> - -
    etape=publier"> -

    - -
    -
    - -
    -
    - - -
    - - - - -
    - -

    - -
    -
    - -
    -
    - - -
    - - - - - -
    -

    Code fourmie

    - - - - - - - - - - - - - [l] Ceci est un tableau avec à [rouge] gauche[/rouge], le code que vous devez écrire sur votre page pour afficher le résultat à [bleu] droite[/bleu]. -
    [l] que l'on peut [gras] afficher [/gras] dans [lien|https://anternet.pw/web/fourmiliere.php|] La fourmilière [/lien] avec du [italique] code fourmie [/italique] ! -
    [l] [boite] [rouge] [souligné] /!\[/souligné] [/rouge] Il ne faut pas oublier la balise pour faire les retours à la ligne ! [/boite] -
    [l] Vous pouvez mettre un mot en [jaunefoncé] jaune foncé[/jaunefoncé], en [vert] vert[/vert], en [cyan] cyan[/cyan], en [rosefoncé] rose foncé[/rosefoncé] etc... -
    [l] -
    [l] Si vous ne voulez pas vous casser la tête, sachez que les balises suivantes ne sont qu'optionnelles, à l'exception de la lettre l entre crochets, indispensable pour créer une nouvelle ligne. -
    [l] -
    [l] Bonne chance :)"; ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Code Source (tel que l'on doit l'écrire)Code Compilé (tel qu'il sera affiché)
    [l](Les retours à la ligne ne sont pris en compte qu'avec cette balise)
    (Doit commencer par http:// ou https://)
    - - - - Vous n'êtes pas connecté·e ou vous n'avez rien écrit -

    - Se connecter - - - - - - - - - - diff --git a/media/404fourmie.png b/img/404fourmie.png similarity index 100% rename from media/404fourmie.png rename to img/404fourmie.png diff --git a/img/agpl.png b/img/agpl.png new file mode 100755 index 0000000..8d95bbe Binary files /dev/null and b/img/agpl.png differ diff --git a/media/logo/ant.png b/img/ant.png similarity index 100% rename from media/logo/ant.png rename to img/ant.png diff --git a/media/logo/antgris.png b/img/antgris.png similarity index 100% rename from media/logo/antgris.png rename to img/antgris.png diff --git a/media/logo/antorigine.png b/img/antorigine.png similarity index 100% rename from media/logo/antorigine.png rename to img/antorigine.png diff --git a/media/logo/antpetit.png b/img/antpetit.png similarity index 100% rename from media/logo/antpetit.png rename to img/antpetit.png diff --git a/media/logo/antpetitgris.png b/img/antpetitgris.png similarity index 100% rename from media/logo/antpetitgris.png rename to img/antpetitgris.png diff --git a/img/favicon.ico b/img/favicon.ico new file mode 100755 index 0000000..df1b45e Binary files /dev/null and b/img/favicon.ico differ diff --git a/img/favicon.png b/img/favicon.png new file mode 100755 index 0000000..e0f5f5e Binary files /dev/null and b/img/favicon.png differ diff --git a/media/logomastodon.svg b/img/logomastodon.svg similarity index 100% rename from media/logomastodon.svg rename to img/logomastodon.svg diff --git a/img/non-pub-horizontale.png b/img/non-pub-horizontale.png new file mode 100755 index 0000000..7625844 Binary files /dev/null and b/img/non-pub-horizontale.png differ diff --git a/img/non-pub-horizontale.xcf b/img/non-pub-horizontale.xcf new file mode 100755 index 0000000..259f2f7 Binary files /dev/null and b/img/non-pub-horizontale.xcf differ diff --git a/inc/codefourmie.php b/inc/codefourmie.php deleted file mode 100755 index cfb8d77..0000000 --- a/inc/codefourmie.php +++ /dev/null @@ -1,54 +0,0 @@ -#', '', $codeEnCompilation); - - include "inc/loginsbdd.php"; - - try { - $bddCF = new PDO('mysql:host=localhost;dbname=my_webapp;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); - } - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); } - - $reponseCF = $bddCF->query('SELECT * FROM codeFourmie'); - - while ($donneesCF = $reponseCF->fetch()) { - - $source = $donneesCF['codeSource']; - $compile = $donneesCF['codeCompilé']; - - $codeEnCompilation = preg_replace("$source", "$compile", $codeEnCompilation); - - - - } $reponseCF->closeCursor(); - - $codeEnCompilation = preg_replace('#\[/vert\]|\[/rouge\]|\[/bleu\]|\[/rose\]|\[/cyan\]|\[/vertfoncé\]|\[/rougefoncé\]|\[/gris\]|\[/orange\]|\[/bleufoncé\]|\[/rosefoncé\]|\[/cyanfoncé\]|\[/jaunefoncé\]|\[/souligné\]|\[/grand\]|\[/gras\]|\[/boite\]|\[/italique\]#', '
    ', $codeEnCompilation); - - - $codeEnCompilation = preg_replace('#\[/lien\]#', '', $codeEnCompilation); - $codeEnCompilation = preg_replace('#\|]#', '">', $codeEnCompilation); - $codeEnCompilation = preg_replace('#nepasconfirmer=oui#', '', $codeEnCompilation); - - - $codeEnCompilation = preg_replace('#\[image\|#', '', $codeEnCompilation);
-      $codeEnCompilation = preg_replace('#\|im\]#', '', $codeEnCompilation); - - - if (isset($_SESSION['confirmerLien']) AND $_SESSION['confirmerLien'] == "non") { - - $codeEnCompilation = preg_replace('#\[lien\|#', ' PDO::ERRMODE_EXCEPTION)); -} - -catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); -} - -$reponse = $bdd->prepare('SELECT * FROM pages WHERE `pages`.`adresse` = :adresse'); - - -$reponse->execute(array( - 'adresse' => $adresse -)); - -while ($page = $reponse->fetch()) { ?> + ?> <?php echo $page['titre']; ?> | Ant - - - + + @@ -46,13 +30,25 @@ while ($page = $reponse->fetch()) { ?> + + + + + + + J'aime les trains. +
    - -closeCursor(); ?> - + diff --git a/inc/footer.php b/inc/footer.php index f555b50..b87ccab 100755 --- a/inc/footer.php +++ b/inc/footer.php @@ -4,13 +4,13 @@
    @@ -40,16 +35,22 @@
    +
    + AGPLv3 Free Software, Free as in Freedom
    - Fait avec en France.
    - Copyleft Ant 2018. Tous droits distribués. Toute reproduction autorisée. -
    Antopie.org n'est ni affilié aux Illuminatis™, ni à Corée du Nord GmbH, ni à Lactalis® et ni à Nicolas Dupont-Aignan. - En utilisant ce site, vous acceptez ses Conditions générales d'utilisation. - Je n'ai pas bu de jus d'orange ces 15 dernières minutes. - Ce site est optimisé pour les navigateurs Web. - Ce site utilise du code HTML pour afficher du contenu. En continuant à naviguer sur ce site, vous acceptez cette utilisation. + Le code de ce site est publié sous AGPL version 3 ou toute version ultérieure. + Tu peut le lire ici.
    + En utilisant ce site, tu accepte ses Conditions d'utilisation.
    + Si tu active les cookies dans ton navigateur, tu accepte leur utilisation.
    +
    +
    +
    +
    + +
    +
    diff --git a/inc/login.php b/inc/login.php deleted file mode 100755 index 80a4ae7..0000000 --- a/inc/login.php +++ /dev/null @@ -1,25 +0,0 @@ - PDO::ERRMODE_EXCEPTION)); - } - catch (Exception $e) { - die('Problème lors de la connexion par cookie : erreur PHP / MySQL : ' . $e->getMessage()); - } - - $reponse = $bdd->query('SELECT * FROM compte'); - - while ($donnees = $reponse->fetch()) { - if (password_verify($_COOKIE['mdp'], $donnees['mdp'])) { - - $_SESSION['pseudo'] = htmlspecialchars($donnees['pseudo']); - - $reponse->closeCursor(); - } - } -} - - - -?> diff --git a/inc/loginsbdd.php b/inc/loginsbdd.php deleted file mode 100755 index d8da813..0000000 --- a/inc/loginsbdd.php +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/inc/page.php b/inc/page.php new file mode 100755 index 0000000..35d2dd4 --- /dev/null +++ b/inc/page.php @@ -0,0 +1,20 @@ + + +

    Bienvenue sur antopie.org !

    -
    -

    Services décentralisés

    - Des services en accès libre -

    - - - -
    +

    Présentation

    + +

    + Moi c'est Miraty, j'héberge divers services sur un serveur Kimsufi (OVH) sous YunoHost.
    + Je met certains de ces services en accès libre.
    + Antopie = ant (fourmi en anglais) + utopie +

    + +

    Liste des services

    +En utilisant l'un des services ci-dessous, tu acceptes les conditions d'utilisation. + + +

    Mastodon

    +

    + Mastodon est un réseau de microblogage fédéré du Fediverse.
    + Il peut notamment interagir avec Pleroma et PeerTube.
    + Mon instance est encore à la version 2.5.2. + +

    + +

    PeerTube

    +

    + + PeerTube est un service de partage de vidéos fédéré du Fediverse.
    + Il a pour particularité de permettre aux clients streamants la vidéo de se l'échanger entre eux (P2P via Webtorrent).
    + Il peut interagir avec Mastodon.
    + +

    + +

    Gitea

    +

    + Gitea est une forge logicielle légère. Une interface Web pour Git. + +

    + +

    Générateur de codes QR

    +

    + Ça, c'est moi que je l'ai fait. + Tu entre le texte à encoder, tu clique sur générer, et ça te renvoie un code QR scannable. + +

    + +

    Nextcloud

    +

    + Nextcloud est un système de stockage et de syncronisation de fichiers.
    + En lui ajoutant des applications, il peut aussi servir de webmail, de lecteur + musique, de bloc-notes, de sondage, de gestionnaire de mot de passe etc... + +

    + +

    PrivateBin

    +

    + PrivateBin est un 'pastebin' (ou gestionnaire d'extraits de texte et de code source) + minimaliste et open source, dans lequel le serveur n'a aucune connaissance des données envoyées. + Les données sont chiffrées/déchiffrées dans le navigateur par un chiffrage AES 256 bits. + +

    + +

    Jirafeau

    +

    + Téléverse un fichier et partage-le rapidement. + +

    + +

    Wallabag

    +

    + Enregistre des articles et lis-les plus tard ou partage-les. + J'ai pas réussi à activer la création de compte par n'importe qui, donc si tu veut un compte demande-le moi. + +

    + +

    Me contacter

    +Me contacter : +

    + Par E-mail : miraty+web@antopie.org. +

    + Sur Mastodon : @miraty@social.antopie.org -
    -

    La fourmilière

    - Un espace pour publier et lire des pages d'article. -
    -
    - - La fourmilière - - - - Nouvelle page - - - - - Connexion - - - - -
    - -
    -

    La cave à l'info-rmatique

    - Des infos sur les navigateurs web, les moteurs de recherche, les modules complémentaires, les systèmes d'exploitation ... -

    - -
    - -
    -

    AntMusiques

    - J'ai créé des musiques, les AntMusiques. Les voici. -
    -
    - - Écouter - - - Télécharger - -
    - - -
    -

    - Espace commentaire -

    - Pour lire ou envoyer des commentaires -

    - - Accéder à l'espace commentaire - -
    - - + diff --git a/js/editeur.js b/js/editeur.js deleted file mode 100755 index b754e1e..0000000 --- a/js/editeur.js +++ /dev/null @@ -1,29 +0,0 @@ -// https://openclassrooms.com/fr/courses/1744696-creez-un-editeur-de-texte-wysiwyg - -function commande(nom, argument){ - - if (typeof argument === 'undefined') { - - argument = ''; - - } - - switch(nom){ - case "createLink": - argument = prompt("Quelle est l'adresse du lien ?"); - break; - case "insertImage": - argument = prompt("Quelle est l'adresse de l'image ?"); - break; - } - - document.execCommand(nom, false, argument); - // Exécuter la commande - -} - -function resultat(){ - - document.getElementById("resultat").value = document.getElementById("editeur").innerHTML; - -} diff --git a/js/menu.js b/js/menu.js old mode 100755 new mode 100644 diff --git a/js/os.js b/js/os.js deleted file mode 100755 index 39829e5..0000000 --- a/js/os.js +++ /dev/null @@ -1,13 +0,0 @@ -function reduireSection() { - var div = document.getElementById('linux'), - display = getComputedStyle(div, null).display; - - if (display == "block") { - document.getElementById("linux").style.display = "none"; - document.getElementById("bouttonReduireSection").className = "icon-angle-down"; - } else { - document.getElementById("linux").style.display = "block"; - document.getElementById("bouttonReduireSection").className = "icon-angle-up"; - - } -} diff --git a/licences/cecill.html b/licences/cecill.html deleted file mode 100755 index e2c60e9..0000000 --- a/licences/cecill.html +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - -CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL - - - - - - - -

    CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL

    -
    Version 2.1 du 2013-06-21
    - - - -
    -

    Avertissement

    - -

    Ce -contrat est une licence de logiciel libre issue d'une -concertation entre ses auteurs afin que le respect de deux grands -principes préside à sa rédaction:

    -
      -
    • -d'une part, le respect des principes de diffusion des logiciels libres: -accès au code source, droits étendus conférés -aux utilisateurs,
    • -
    • -d'autre -part, la désignation d'un droit applicable, le droit français, auquel -elle est conforme, tant au regard -du droit de la responsabilité civile que du droit de la -propriété intellectuelle et de la protection qu'il -offre aux auteurs et titulaires des droits patrimoniaux sur un -logiciel.
    • -
    - - -

    Les -auteurs de la licence -CeCILL1 - - -sont:

    - -

    Commissariat -à l'énergie atomique et aux énergies alternatives - CEA, établissement -public de recherche à caractère scientifique, technique et industriel, dont -le siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.

    -

    Centre -National de la Recherche Scientifique - CNRS, -établissement public à caractère scientifique et -technologique, dont le siège est situé 3 rue -Michel-Ange, 75794 Paris cedex 16.

    - -

    Institut -National de Recherche en Informatique et en Automatique - Inria, -établissement public à caractère scientifique et -technologique, dont le siège est situé Domaine de -Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.

    - -
    -
    -

    Préambule

    - - -

    Ce -contrat est une licence de logiciel libre dont l'objectif est de -conférer aux utilisateurs la liberté de modification et -de redistribution du logiciel régi par cette licence dans le -cadre d'un modèle de diffusion -en logiciel libre. -

    -

    L'exercice -de ces libertés est assorti de certains devoirs à la -charge des utilisateurs afin de préserver ce statut au cours -des redistributions ultérieures. -

    - - - - - - -

    L'accessibilité -au code source et les droits de copie, de modification et de -redistribution qui en découlent - ont -pour contrepartie de n'offrir aux utilisateurs qu'une garantie limitée -et de ne faire peser sur l'auteur du logiciel, le titulaire des -droits patrimoniaux et les concédants successifs qu'une -responsabilité restreinte. -

    - -

    A -cet égard l'attention de l'utilisateur est attirée -sur les risques associés au chargement, à -l'utilisation, à la modification et/ou au développement -et à la reproduction du logiciel par l'utilisateur étant -donné sa spécificité de logiciel libre, qui peut -le rendre complexe à manipuler et qui le réserve donc à -des développeurs ou des professionnels avertis -possédant des connaissances informatiques approfondies. Les utilisateurs sont -donc invités à charger et tester l'adéquation -du logiciel à leurs besoins dans des conditions permettant -d'assurer la sécurité de leurs systèmes et/ou de leurs données et, -plus généralement, à l'utiliser et l'exploiter dans les mêmes conditions de -sécurité. Ce contrat peut être reproduit et diffusé librement, sous réserve -de le conserver en l'état, sans ajout ni suppression de -clauses. -

    -

    Ce -contrat est susceptible de s'appliquer à tout logiciel -dont le titulaire des droits patrimoniaux décide de soumettre -l'exploitation aux dispositions qu'il contient.

    - -

    -Une liste de questions fréquemment posées se trouve sur le site web -officiel de la famille des licences CeCILL -(http://www.cecill.info/index.fr.html) -pour toute clarification qui serait nécessaire. -

    - -
    -
    - -

    Article 1 - DEFINITIONS

    - -

    Dans - ce contrat, les termes suivants, lorsqu'ils seront écrits - avec une lettre capitale, auront la signification suivante:

    - -

    Contrat: - - désigne le présent contrat de licence, ses - éventuelles versions postérieures et annexes. - -

    - -

    Logiciel: - - désigne le logiciel sous sa forme de Code Objet et/ou de Code - Source et le cas échéant sa documentation, dans leur - état au moment de l'acceptation du Contrat par le - Licencié. - -

    - -

    Logiciel Initial: - - désigne le Logiciel sous sa forme de - Code Source et éventuellement - de Code Objet et le cas échéant sa - documentation, dans leur état au moment de leur première - diffusion sous les termes du Contrat. - -

    - - -

    Logiciel Modifié: - - désigne le Logiciel modifié par au moins une Contribution. -

    - - - - -

    Code Source: - - désigne l'ensemble des - instructions et des lignes de programme du Logiciel et auquel - l'accès est nécessaire en vue de modifier le - Logiciel. - -

    - -

    Code Objet: - - désigne les fichiers binaires issus de la compilation du - Code Source. - -

    - -

    Titulaire: - - désigne le ou les détenteurs des droits - patrimoniaux d'auteur sur le Logiciel Initial. - -

    - -

    Licencié: - - désigne le ou les utilisateurs du Logiciel - ayant accepté - le Contrat. - -

    - -

    Contributeur: - - désigne le Licencié auteur d'au moins une - Contribution. - -

    - -

    Concédant: - - désigne le Titulaire ou toute personne physique ou morale - distribuant le Logiciel sous le Contrat. - -

    - - -

    Contribution: - - désigne l'ensemble des modifications, corrections, - traductions, adaptations et/ou nouvelles fonctionnalités - intégrées dans le Logiciel par tout Contributeur, - ainsi que tout - Module Interne. - -

    - -

    Module: - - désigne un ensemble de fichiers sources y compris leur - documentation qui - permet de réaliser des fonctionnalités ou services - supplémentaires à ceux fournis par le Logiciel. - -

    - -

    Module Externe: - - désigne tout Module, non dérivé du Logiciel, tel que ce - Module et le Logiciel s'exécutent dans - des espaces d'adressage différents, - l'un appelant l'autre au moment de leur exécution. - -

    - -

    Module Interne: - - désigne tout Module - lié au Logiciel - de telle sorte qu'ils s'exécutent - dans le même espace d'adressage. - -

    - - - - - - - - - - -

    GNU GPL: - - désigne la GNU General Public License dans sa version 2 ou toute - version ultérieure, telle que publiée par Free Software Foundation - Inc. - -

    - - - -

    GNU Affero GPL: - - désigne la GNU Affero General Public License dans sa version 3 ou toute - version ultérieure, telle que publiée par Free Software Foundation - Inc. - -

    - - - -

    EUPL: - - désigne la Licence Publique de l'Union européenne dans sa - version 1.1 ou toute version ultérieure, telle que publiée par - la Commission Européenne. - -

    - - -

    Parties: - désigne collectivement le Licencié et le Concédant. -

    - -

    Ces termes s'entendent au singulier comme au pluriel.

    - -
    -
    - -

    Article 2 - OBJET

    - -

    Le - Contrat a pour objet la concession par le Concédant au - Licencié d'une licence non exclusive, cessible - et mondiale du Logiciel telle que définie ci-après à - l'article 5 pour toute la durée de protection - des droits portant sur ce Logiciel. -

    - -
    -
    - -

    Article 3 - ACCEPTATION

    - -
    -

    3.1 - L'acceptation - par le Licencié des termes du Contrat est réputée - acquise du fait du premier des faits suivants: -

    -
      -
    • (i) - le chargement du Logiciel par tout moyen notamment par - téléchargement à partir d'un serveur - distant ou par chargement à partir d'un support - physique;
    • -
    • - (ii) - le premier exercice par le Licencié de l'un quelconque - des droits concédés par le Contrat.
    • -
    -
    - -
    -

    3.2 Un - exemplaire du Contrat, contenant notamment un avertissement relatif - aux spécificités du Logiciel, à la restriction - de garantie et à la limitation à un usage par des - utilisateurs expérimentés a été mis à - disposition du Licencié préalablement à son - acceptation telle que définie à l'article - 3.1 ci - dessus et le Licencié reconnaît en avoir pris - connaissance.

    -
    - -
    -
    - -

    Article 4 - ENTREE EN VIGUEUR ET DUREE

    - -
    -

    -4.1 ENTREE EN VIGUEUR

    - -

    Le - Contrat entre en vigueur à la date de son acceptation par le - Licencié telle que définie en 3.1.

    - -
    - -
    -

    -4.2 DUREE

    - -

    Le - Contrat produira ses effets pendant toute la durée légale - de protection des droits patrimoniaux portant sur le Logiciel.

    - -
    - -
    -
    - -

    - Article 5 - ETENDUE DES DROITS CONCEDES

    - -

    Le - Concédant concède au Licencié, qui accepte, les - droits suivants sur le Logiciel pour toutes destinations et pour la - durée du Contrat dans les conditions ci-après - détaillées. -

    -

    - Par ailleurs, - si le Concédant détient ou venait à détenir un ou plusieurs - brevets d'invention protégeant tout ou partie des fonctionnalités - du Logiciel ou de ses composants, il s'engage à ne pas - opposer les éventuels droits conférés par ces brevets aux Licenciés - successifs qui utiliseraient, exploiteraient ou modifieraient le - Logiciel. En cas de cession de ces brevets, le - Concédant s'engage à faire reprendre les obligations du présent alinéa - aux cessionnaires. -

    - -
    -

    -5.1 DROIT D'UTILISATION

    - -

    Le - Licencié est autorisé à utiliser le Logiciel, - sans restriction quant aux domaines d'application, étant - ci-après précisé que cela comporte:

    -
      -
    1. la - reproduction permanente ou provisoire du Logiciel en tout ou partie - par tout moyen et sous toute forme. -

    2. -
    3. -

      le - chargement, l'affichage, l'exécution, ou le - stockage du Logiciel sur tout support.

      -
    4. -
    5. -

      la - possibilité d'en observer, d'en étudier, - ou d'en tester le fonctionnement afin de déterminer - les idées et principes qui sont à la base de - n'importe quel élément de ce Logiciel; et - ceci, lorsque le Licencié effectue toute opération de - chargement, d'affichage, d'exécution, de - transmission ou de stockage du Logiciel qu'il est en droit - d'effectuer en vertu du Contrat.

      -
    6. -
    - -
    - - -
    -

    -5.2 DROIT D'APPORTER DES CONTRIBUTIONS

    - -

    - Le - droit d'apporter des Contributions - comporte le droit de - traduire, d'adapter, d'arranger ou d'apporter - toute autre modification - au Logiciel et le droit de reproduire le - logiciel en résultant.

    -

    Le - Licencié est autorisé à apporter toute - Contribution au Logiciel sous réserve de mentionner, de façon - explicite, son nom en tant qu'auteur de cette Contribution et - la date de création de celle-ci.

    - -
    - - - - -
    -

    -5.3 DROIT - DE DISTRIBUTION

    - -

    Le - droit de distribution - comporte notamment le droit de diffuser, de - transmettre et de communiquer le Logiciel au public sur tout - support et par tout moyen ainsi que le droit de mettre sur le marché - à titre onéreux ou gratuit, un ou des exemplaires du - Logiciel par tout procédé.

    -

    Le - Licencié est autorisé à - distribuer des copies - du Logiciel, modifié ou non, à des tiers dans les - conditions ci-après détaillées.

    - -
    -

    -5.3.1 DISTRIBUTION - DU LOGICIEL SANS MODIFICATION

    - -

    Le - Licencié est autorisé à - distribuer des copies - conformes du Logiciel, sous forme de Code Source ou de Code Objet, - à condition que cette distribution respecte les - dispositions du Contrat dans leur totalité et soit accompagnée:

    -
      -
    1. d'un - exemplaire du Contrat,

    2. -
    3. d'un - avertissement relatif à la restriction de garantie et de - responsabilité du Concédant telle que prévue - aux articles 8 et - 9,

    4. -
    -

    et - que, dans le cas où seul le Code Objet du Logiciel est - redistribué, le Licencié permette un accès effectif - au Code Source complet du Logiciel - pour une durée d'au moins 3 ans à compter - de la distribution du logiciel, - étant - entendu que le coût additionnel d'acquisition du Code - Source ne devra pas excéder le simple coût de transfert - des données.

    - -
    - -
    -

    -5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE

    - - -

    Lorsque - le Licencié apporte une Contribution au Logiciel, les - conditions de distribution du Logiciel Modifié en résultant sont alors - soumises à l'intégralité des dispositions - du Contrat. -

    -

    Le - Licencié est autorisé à distribuer le - Logiciel Modifié, sous forme de code source ou de code objet, - à condition que cette distribution respecte les - dispositions du Contrat dans leur totalité et soit - accompagnée: -

    -
      -
    1. d'un - exemplaire du Contrat,

    2. -
    3. -

      d'un - avertissement relatif à la restriction de garantie et de - responsabilité du Concédant telle que - prévue aux articles 8 et - 9,

      -
    4. -
    -

    et, dans le cas où seul le code objet du Logiciel - Modifié est redistribué, -

    -
      -
    1. -

      d'une note précisant les conditions d'accès effectif au - code source complet du Logiciel Modifié, pendant une période - d'au moins 3 ans à compter de la distribution du Logiciel - Modifié, étant entendu que le coût additionnel d'acquisition - du code source ne devra pas excéder le simple coût de - transfert des données.

      -
    2. -
    - - - - - - -
    - - -
    -

    -5.3.3 DISTRIBUTION DES MODULES EXTERNES

    - -

    Lorsque le Licencié a développé un Module - Externe les conditions du Contrat ne s'appliquent pas à ce - Module Externe, qui peut être - distribué sous un contrat de licence différent.

    - -
    - - - - - - -
    - - -

    -5.3.4 COMPATIBILITE AVEC D'AUTRES LICENCES

    - -

    Le Licencié peut inclure un code soumis aux dispositions d'une - des versions de la licence GNU GPL, GNU Affero GPL et/ou EUPL - dans le Logiciel modifié ou non et - distribuer l'ensemble sous les conditions de la même version de la - licence GNU GPL, GNU Affero GPL et/ou EUPL. -

    - -

    Le Licencié peut inclure le Logiciel modifié ou non dans un code - soumis aux dispositions d'une des versions de la licence GNU GPL, - GNU Affero GPL et/ou EUPL et - distribuer l'ensemble sous les conditions de la même version de la - licence GNU GPL, GNU Affero GPL et/ou EUPL. -

    - - - - - - - - -
    - -
    - -
    -
    - -

    Article 6 - PROPRIETE INTELLECTUELLE

    - -
    -

    -6.1 SUR LE LOGICIEL INITIAL

    - -

    Le - Titulaire est détenteur des droits patrimoniaux sur le - Logiciel Initial. Toute utilisation du Logiciel Initial est soumise - au respect des conditions dans lesquelles le Titulaire a choisi de - diffuser son oeuvre et nul autre n'a la faculté de - modifier les conditions de diffusion de ce Logiciel Initial. -

    -

    Le - Titulaire s'engage à - ce que le Logiciel Initial - reste au moins régi par le Contrat - et ce, pour la durée visée à l'article 4.2.

    - -
    - - -
    -

    -6.2 SUR LES CONTRIBUTIONS

    - -

    - Le Licencié qui a développé une Contribution est titulaire - sur celle-ci des droits de propriété intellectuelle dans les conditions - définies par la législation applicable. -

    - -
    - -
    -

    -6.3 SUR LES MODULES - EXTERNES

    - -

    - Le - Licencié - qui a développé un Module Externe est titulaire - sur celui-ci des droits de propriété intellectuelle dans les conditions - définies par la législation applicable - et reste - libre du choix du contrat régissant - sa diffusion.

    - -
    - - - - -
    - -

    -6.4 DISPOSITIONS COMMUNES

    - - - -
    -

    - Le Licencié s'engage expressément:

    -
      -
    1. -

      à - ne pas supprimer ou modifier de quelque manière que ce soit - les mentions de propriété intellectuelle apposées - sur le Logiciel;

      -
    2. -
    3. -

      à reproduire à l'identique lesdites mentions de - propriété intellectuelle sur les copies du Logiciel modifié ou - non. -

      -
    4. - -
    -
    - -
    -

    Le - Licencié s'engage à ne pas porter atteinte, - directement ou indirectement, aux droits de propriété - intellectuelle du Titulaire et/ou des Contributeurs - sur le Logiciel et à - prendre, le cas échéant, à l'égard - de son personnel toutes les mesures nécessaires pour assurer - le respect des dits droits de propriété intellectuelle - du Titulaire et/ou des Contributeurs.

    -
    - -
    - -
    -
    - -

    Article 7 - SERVICES ASSOCIES

    - -
    -

    7.1 Le - Contrat n'oblige en aucun cas le Concédant à la - réalisation de prestations d'assistance technique ou de - maintenance du Logiciel.

    -

    Cependant - le Concédant reste libre de proposer ce type de services. Les - termes et conditions d'une telle assistance technique et/ou - d'une telle maintenance seront alors déterminés - dans un acte séparé. Ces actes de maintenance et/ou - assistance technique n'engageront que la seule responsabilité - du Concédant qui les propose.

    -
    - -
    -

    7.2 De - même, tout Concédant est libre de proposer, sous sa - seule responsabilité, à ses licenciés une - garantie, qui n'engagera que lui, lors de la redistribution du - Logiciel et/ou du Logiciel Modifié et ce, dans les conditions - qu'il souhaite. Cette garantie et les modalités - financières de son application feront l'objet d'un - acte séparé entre le Concédant et le Licencié.

    -
    - -
    -
    - -

    - Article 8 - RESPONSABILITE

    - -
    -

    8.1 Sous - réserve des dispositions de - l'article 8.2, - le Licencié a la faculté, sous réserve de prouver la faute du - Concédant concerné, de solliciter la réparation - du préjudice direct qu'il subirait du fait du - Logiciel et dont il apportera la preuve. -

    -
    - -
    -

    8.2 - La - responsabilité du Concédant est limitée aux - engagements pris en application du Contrat et ne saurait être - engagée en raison notamment: (i) des dommages dus à - l'inexécution, totale ou partielle, de ses obligations - par le Licencié, (ii) des dommages directs ou indirects - découlant de l'utilisation ou des performances du - Logiciel subis par le Licencié - et (iii) - plus généralement d'un quelconque - dommage - indirect. - En particulier, les Parties - conviennent expressément que tout préjudice financier - ou commercial (par exemple perte de données, perte de - bénéfices, perte d'exploitation, perte de - clientèle ou de commandes, manque à gagner, trouble - commercial quelconque) ou toute action dirigée contre le - Licencié par un tiers, constitue un dommage indirect et - n'ouvre pas droit à réparation par le - Concédant. -

    -
    - -
    -
    - -

    - Article 9 - GARANTIE

    - -
    -

    9.1 - Le - Licencié reconnaît que l'état actuel des - connaissances scientifiques et techniques au moment de la mise en - circulation du Logiciel ne permet pas d'en tester et d'en - vérifier toutes les utilisations ni de détecter - l'existence d'éventuels défauts. - L'attention du Licencié a été attirée - sur ce point sur les risques associés au chargement, à - l'utilisation, la modification et/ou au développement - et à la reproduction du Logiciel qui sont réservés - à des utilisateurs avertis.

    -

    Il - relève de la responsabilité du Licencié de - contrôler, par tous moyens, l'adéquation du - produit à ses besoins, son bon fonctionnement et de s'assurer - qu'il ne causera pas de dommages aux personnes et aux biens. -

    -
    - -
    -

    9.2 - Le Concédant déclare de bonne foi être en droit - de concéder l'ensemble des droits attachés au Logiciel - (comprenant notamment les droits visés à l'article - 5). -

    -
    - -
    -

    9.3 Le - Licencié reconnaît que le Logiciel est fourni "en - l'état" par le Concédant sans autre - garantie, expresse ou tacite, que celle prévue à - l'article 9.2 et notamment sans aucune garantie sur sa - valeur commerciale, son caractère sécurisé, innovant - ou pertinent. -

    -

    En - particulier, le Concédant ne garantit pas que le Logiciel est - exempt d'erreur, qu'il fonctionnera sans interruption, - qu'il - sera compatible avec l'équipement du Licencié et - sa configuration logicielle ni qu'il remplira les besoins du - Licencié.

    -
    - -
    -

    9.4 Le - Concédant ne garantit pas, de manière expresse ou - tacite, que le Logiciel ne porte pas atteinte à un quelconque - droit de propriété intellectuelle d'un tiers - portant sur un brevet, un logiciel ou sur tout autre droit de - propriété. Ainsi, le Concédant exclut toute - garantie au profit du Licencié contre les actions en - contrefaçon qui pourraient être diligentées au - titre de l'utilisation, de la modification, et de la - redistribution du Logiciel. Néanmoins, si de telles actions - sont exercées contre le Licencié, le Concédant - lui apportera son expertise technique et juridique pour sa défense. - Cette expertise technique et juridique est déterminée au - cas par cas entre le Concédant concerné et le - Licencié - dans le cadre d'un protocole d'accord. Le Concédant - dégage toute responsabilité quant à - l'utilisation de la dénomination du Logiciel par le - Licencié. Aucune garantie n'est apportée quant - à - l'existence de droits antérieurs sur le nom du Logiciel - et sur l'existence d'une marque.

    -
    - -
    -
    - -

    Article 10 - RESILIATION

    - -
    -

    10.1 En - cas de manquement par le Licencié aux obligations mises à - sa charge par le Contrat, le Concédant pourra résilier - de plein droit le Contrat trente (30) jours après - notification adressée au Licencié et restée - sans effet.

    -
    - -
    -

    10.2 Le - Licencié dont le Contrat est résilié n'est - plus autorisé à utiliser, modifier ou distribuer le - Logiciel. Cependant, toutes les licences qu'il aura - concédées - antérieurement à la résiliation du Contrat - resteront valides sous réserve qu'elles aient - été - effectuées en conformité avec le Contrat.

    -
    - -
    -
    - -

    Article 11 - DISPOSITIONS DIVERSES

    - -
    -

    -11.1 CAUSE EXTERIEURE

    - -

    Aucune - des Parties ne sera responsable d'un retard ou d'une - défaillance d'exécution du Contrat qui serait dû - à un cas de force majeure, un cas fortuit ou une cause - extérieure, telle que, notamment, le mauvais fonctionnement - ou les interruptions du réseau électrique ou de - télécommunication, la paralysie du réseau liée - à une attaque informatique, l'intervention des - autorités gouvernementales, les catastrophes naturelles, les - dégâts des eaux, les tremblements de terre, le feu, les - explosions, les grèves et les conflits sociaux, l'état - de guerre...

    -
    - -
    -

    11.2 Le - fait, par l'une ou l'autre des Parties, d'omettre - en une ou plusieurs occasions de se prévaloir d'une ou - plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer - renonciation par la Partie intéressée à s'en - prévaloir ultérieurement.

    -
    - -
    -

    11.3 Le - Contrat annule et remplace toute convention antérieure, - écrite ou orale, entre les Parties sur le même objet et - constitue l'accord entier entre les Parties sur cet objet. - Aucune addition ou modification aux termes du Contrat n'aura - d'effet à l'égard des Parties à - moins d'être faite par écrit et signée par - leurs représentants dûment habilités.

    -
    - -
    -

    11.4 Dans - l'hypothèse où une ou plusieurs des dispositions - du Contrat s'avèrerait contraire à une loi ou à - un texte applicable, existants ou futurs, cette loi ou ce texte - prévaudrait, et les Parties feraient les amendements - nécessaires pour se conformer à cette loi ou à - ce texte. Toutes les autres dispositions resteront en vigueur. De - même, la nullité, pour quelque raison que ce soit, - d'une des dispositions du Contrat ne saurait entraîner - la nullité de l'ensemble du Contrat.

    -
    - -
    -

    -11.5 LANGUE

    -

    Le - Contrat est rédigé en langue française et en - langue anglaise, ces deux versions - faisant également foi. -

    -
    - -
    -
    - -

    Article 12 - NOUVELLES VERSIONS DU CONTRAT

    - -
    -

    12.1 Toute personne est autorisée à copier et distribuer des - copies de ce Contrat.

    -
    - -
    -

    12.2 Afin d'en préserver la cohérence, le texte du Contrat - est protégé et ne peut être modifié que - par les auteurs de la licence, lesquels se réservent le droit - de publier périodiquement des mises à jour ou de - nouvelles versions du Contrat, qui posséderont chacune un - numéro distinct. Ces versions ultérieures seront - susceptibles de prendre en compte de nouvelles problématiques - rencontrées par les logiciels libres.

    -
    - - -
    -

    12.3 Tout - Logiciel diffusé sous une version donnée du Contrat ne - pourra faire l'objet d'une diffusion ultérieure que sous la - même version du Contrat ou une version postérieure, - sous réserve des dispositions de l'article - 5.3.4.

    -
    - - - - -
    -
    - -

    Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE

    - -
    -

    13.1 - Le Contrat est régi par la loi - française. Les Parties conviennent de tenter de régler - à l'amiable les différends ou litiges qui - viendraient à se produire par suite ou à l'occasion - du Contrat. -

    -
    - -
    -

    13.2 - A défaut d'accord amiable dans un délai de deux - (2) mois à compter de leur survenance et sauf situation - relevant d'une procédure d'urgence, les - différends ou litiges seront portés par la Partie la - plus diligente devant les Tribunaux compétents de - Paris.

    -
    - -
    - - - - - - diff --git a/licences/fontello.txt b/licences/fontello.txt deleted file mode 100755 index 042eb1a..0000000 --- a/licences/fontello.txt +++ /dev/null @@ -1,129 +0,0 @@ -Font license info - - -## Fontelico - - Copyright (C) 2012 by Fontello project - - Author: Crowdsourced, for Fontello project - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://fontello.com - - -## Font Awesome - - Copyright (C) 2016 by Dave Gandy - - Author: Dave Gandy - License: SIL () - Homepage: http://fortawesome.github.com/Font-Awesome/ - - -## Entypo - - Copyright (C) 2012 by Daniel Bruce - - Author: Daniel Bruce - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://www.entypo.com - - -## Typicons - - (c) Stephen Hutchings 2012 - - Author: Stephen Hutchings - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://typicons.com/ - - -## Iconic - - Copyright (C) 2012 by P.J. Onori - - Author: P.J. Onori - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://somerandomdude.com/work/iconic/ - - -## Modern Pictograms - - Copyright (c) 2012 by John Caserta. All rights reserved. - - Author: John Caserta - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://thedesignoffice.org/project/modern-pictograms/ - - -## Meteocons - - Copyright (C) 2012 by Alessio Atzeni - - Author: Alessio Atzeni - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://www.alessioatzeni.com - - -## MFG Labs - - Copyright (C) 2012 by Daniel Bruce - - Author: MFG Labs - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://www.mfglabs.com/ - - -## Maki - - Copyright (C) Mapbox, LCC - - Author: Mapbox - License: BSD (https://github.com/mapbox/maki/blob/gh-pages/LICENSE.txt) - Homepage: http://mapbox.com/maki/ - - -## Zocial - - Copyright (C) 2012 by Sam Collins - - Author: Sam Collins - License: MIT (http://opensource.org/licenses/mit-license.php) - Homepage: http://zocial.smcllns.com/ - - -## Brandico - - (C) 2012 by Vitaly Puzrin - - Author: Crowdsourced, for Fontello project - License: SIL (http://scripts.sil.org/OFL) - Homepage: - - -## Elusive - - Copyright (C) 2013 by Aristeides Stathopoulos - - Author: Aristeides Stathopoulos - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://aristeides.com/ - - -## Linecons - - Copyright (C) 2013 by Designmodo - - Author: Designmodo for Smashing Magazine - License: CC BY () - Homepage: http://designmodo.com/linecons-free/ - - -## Web Symbols - - Copyright (c) 2011 by Just Be Nice studio. All rights reserved. - - Author: Just Be Nice studio - License: SIL (http://scripts.sil.org/OFL) - Homepage: http://www.justbenicestudio.com/ - - diff --git a/licences/less.txt b/licences/less.txt deleted file mode 100755 index 0629ee6..0000000 --- a/licences/less.txt +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/licences/lftcqtv.html b/licences/lftcqtv.html deleted file mode 100755 index a2886a9..0000000 --- a/licences/lftcqtv.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - LICENCE FAIS TOUT CE QUE TU VEUX - - - -

    LFTCQTV | LICENCE FAIS TOUT CE QUE TU VEUX

    - Version 1, Mai 2018 -
    -
    - N'importe qui est autorisé à copier, distribuer et modifier ce texte de licence sans restriction. -
    -

    TERMES ET CONDITIONS DE COPIE, PUBLICATION ET MODIFICATION D'OEUVRE PUBLIÉE SOUS LFTCQTV

    - Article 1 : Fais TOUT CE QUE TU VEUX ! - - diff --git a/licences/normalize.txt b/licences/normalize.txt deleted file mode 100755 index 8bdc135..0000000 --- a/licences/normalize.txt +++ /dev/null @@ -1,8 +0,0 @@ - -Copyright © Nicolas Gallagher and Jonathan Neal - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/licences/sense3.txt b/licences/sense3.txt deleted file mode 100755 index 44b8bd2..0000000 --- a/licences/sense3.txt +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2018 JosephK - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/liste_des_nombres.php b/liste_des_nombres.php deleted file mode 100755 index 6f776d6..0000000 --- a/liste_des_nombres.php +++ /dev/null @@ -1,7 +0,0 @@ - - -
    - - diff --git a/media/2048.png b/media/2048.png deleted file mode 100755 index fecb295..0000000 Binary files a/media/2048.png and /dev/null differ diff --git a/media/2048.xpi b/media/2048.xpi deleted file mode 100755 index 33ccf82..0000000 Binary files a/media/2048.xpi and /dev/null differ diff --git a/media/404fourmieorigine.png b/media/404fourmieorigine.png deleted file mode 100755 index bad8a2e..0000000 Binary files a/media/404fourmieorigine.png and /dev/null differ diff --git a/media/728x90.xcf b/media/728x90.xcf deleted file mode 100755 index 8a0612c..0000000 Binary files a/media/728x90.xcf and /dev/null differ diff --git a/media/activerprotection.png b/media/activerprotection.png deleted file mode 100755 index 3283ddd..0000000 Binary files a/media/activerprotection.png and /dev/null differ diff --git a/media/activerprotectionfondblanc.png b/media/activerprotectionfondblanc.png deleted file mode 100755 index a839654..0000000 Binary files a/media/activerprotectionfondblanc.png and /dev/null differ diff --git a/media/am1.mp3 b/media/am1.mp3 deleted file mode 100755 index 2dc33e4..0000000 Binary files a/media/am1.mp3 and /dev/null differ diff --git a/media/am1.png b/media/am1.png deleted file mode 100755 index c243271..0000000 Binary files a/media/am1.png and /dev/null differ diff --git a/media/am10.mp3 b/media/am10.mp3 deleted file mode 100755 index fe5d65e..0000000 Binary files a/media/am10.mp3 and /dev/null differ diff --git a/media/am10.png b/media/am10.png deleted file mode 100755 index fef39ed..0000000 Binary files a/media/am10.png and /dev/null differ diff --git a/media/am2.mp3 b/media/am2.mp3 deleted file mode 100755 index a8017b7..0000000 Binary files a/media/am2.mp3 and /dev/null differ diff --git a/media/am2.png b/media/am2.png deleted file mode 100755 index cd18d87..0000000 Binary files a/media/am2.png and /dev/null differ diff --git a/media/am3.mp3 b/media/am3.mp3 deleted file mode 100755 index bb5fd99..0000000 Binary files a/media/am3.mp3 and /dev/null differ diff --git a/media/am3.png b/media/am3.png deleted file mode 100755 index 75e922a..0000000 Binary files a/media/am3.png and /dev/null differ diff --git a/media/am4.mp3 b/media/am4.mp3 deleted file mode 100755 index 538e0be..0000000 Binary files a/media/am4.mp3 and /dev/null differ diff --git a/media/am4.png b/media/am4.png deleted file mode 100755 index 6708ffb..0000000 Binary files a/media/am4.png and /dev/null differ diff --git a/media/am5.mp3 b/media/am5.mp3 deleted file mode 100755 index ddd737f..0000000 Binary files a/media/am5.mp3 and /dev/null differ diff --git a/media/am5.png b/media/am5.png deleted file mode 100755 index 6946c8b..0000000 Binary files a/media/am5.png and /dev/null differ diff --git a/media/am6.mp3 b/media/am6.mp3 deleted file mode 100755 index 7618e48..0000000 Binary files a/media/am6.mp3 and /dev/null differ diff --git a/media/am6.png b/media/am6.png deleted file mode 100755 index 4fef268..0000000 Binary files a/media/am6.png and /dev/null differ diff --git a/media/am7.mp3 b/media/am7.mp3 deleted file mode 100755 index ec85057..0000000 Binary files a/media/am7.mp3 and /dev/null differ diff --git a/media/am7.png b/media/am7.png deleted file mode 100755 index 736d005..0000000 Binary files a/media/am7.png and /dev/null differ diff --git a/media/am8.mp3 b/media/am8.mp3 deleted file mode 100755 index 7a9bf06..0000000 Binary files a/media/am8.mp3 and /dev/null differ diff --git a/media/am8.png b/media/am8.png deleted file mode 100755 index 5e005b1..0000000 Binary files a/media/am8.png and /dev/null differ diff --git a/media/am9.mp3 b/media/am9.mp3 deleted file mode 100755 index 1abb8ae..0000000 Binary files a/media/am9.mp3 and /dev/null differ diff --git a/media/am9.png b/media/am9.png deleted file mode 100755 index e8889ad..0000000 Binary files a/media/am9.png and /dev/null differ diff --git a/media/antmusiques.zip b/media/antmusiques.zip deleted file mode 100755 index ec2cfa1..0000000 Binary files a/media/antmusiques.zip and /dev/null differ diff --git a/media/cookie.png b/media/cookie.png deleted file mode 100755 index dd2ac0d..0000000 Binary files a/media/cookie.png and /dev/null differ diff --git a/media/favicon.ico b/media/favicon.ico deleted file mode 100755 index 33c8be8..0000000 Binary files a/media/favicon.ico and /dev/null differ diff --git a/media/ghostery.png b/media/ghostery.png deleted file mode 100755 index 57ab74b..0000000 Binary files a/media/ghostery.png and /dev/null differ diff --git a/media/httpspartout.png b/media/httpspartout.png deleted file mode 100755 index ff2472f..0000000 Binary files a/media/httpspartout.png and /dev/null differ diff --git a/media/logo/alt/ant1.jpg b/media/logo/alt/ant1.jpg deleted file mode 100755 index 7c621b1..0000000 Binary files a/media/logo/alt/ant1.jpg and /dev/null differ diff --git a/media/logo/alt/ant1.png b/media/logo/alt/ant1.png deleted file mode 100755 index 86f7fbc..0000000 Binary files a/media/logo/alt/ant1.png and /dev/null differ diff --git a/media/logo/alt/ant2.jpg b/media/logo/alt/ant2.jpg deleted file mode 100755 index 04fb1ec..0000000 Binary files a/media/logo/alt/ant2.jpg and /dev/null differ diff --git a/media/logo/alt/ant2.png b/media/logo/alt/ant2.png deleted file mode 100755 index d993215..0000000 Binary files a/media/logo/alt/ant2.png and /dev/null differ diff --git a/media/logo/alt/ant3.jpg b/media/logo/alt/ant3.jpg deleted file mode 100755 index 9953ade..0000000 Binary files a/media/logo/alt/ant3.jpg and /dev/null differ diff --git a/media/logo/alt/ant3.png b/media/logo/alt/ant3.png deleted file mode 100755 index 836f706..0000000 Binary files a/media/logo/alt/ant3.png and /dev/null differ diff --git a/media/logo/alt/ant4.jpg b/media/logo/alt/ant4.jpg deleted file mode 100755 index 3b7fcbe..0000000 Binary files a/media/logo/alt/ant4.jpg and /dev/null differ diff --git a/media/logo/alt/ant4.png b/media/logo/alt/ant4.png deleted file mode 100755 index 41e4ad9..0000000 Binary files a/media/logo/alt/ant4.png and /dev/null differ diff --git a/media/logo/alt/ant5.jpg b/media/logo/alt/ant5.jpg deleted file mode 100755 index 7224860..0000000 Binary files a/media/logo/alt/ant5.jpg and /dev/null differ diff --git a/media/logo/alt/ant5.png b/media/logo/alt/ant5.png deleted file mode 100755 index 4d439c9..0000000 Binary files a/media/logo/alt/ant5.png and /dev/null differ diff --git a/media/logo/alt/ant6.jpg b/media/logo/alt/ant6.jpg deleted file mode 100755 index 3f2c3d5..0000000 Binary files a/media/logo/alt/ant6.jpg and /dev/null differ diff --git a/media/logo/alt/ant6.png b/media/logo/alt/ant6.png deleted file mode 100755 index 4f09114..0000000 Binary files a/media/logo/alt/ant6.png and /dev/null differ diff --git a/media/logo/alt/ant7.jpg b/media/logo/alt/ant7.jpg deleted file mode 100755 index 3bacc41..0000000 Binary files a/media/logo/alt/ant7.jpg and /dev/null differ diff --git a/media/logo/alt/ant7.png b/media/logo/alt/ant7.png deleted file mode 100755 index 4769c2c..0000000 Binary files a/media/logo/alt/ant7.png and /dev/null differ diff --git a/media/module/wappalyser.png b/media/module/wappalyser.png deleted file mode 100755 index 85d3f84..0000000 Binary files a/media/module/wappalyser.png and /dev/null differ diff --git a/media/nav/brave.png b/media/nav/brave.png deleted file mode 100755 index 434f4c5..0000000 Binary files a/media/nav/brave.png and /dev/null differ diff --git a/media/nav/chrome.png b/media/nav/chrome.png deleted file mode 100755 index 0ac7417..0000000 Binary files a/media/nav/chrome.png and /dev/null differ diff --git a/media/nav/chromium.png b/media/nav/chromium.png deleted file mode 100755 index e95a044..0000000 Binary files a/media/nav/chromium.png and /dev/null differ diff --git a/media/nav/cliqz.png b/media/nav/cliqz.png deleted file mode 100755 index 478a6e7..0000000 Binary files a/media/nav/cliqz.png and /dev/null differ diff --git a/media/nav/cyberfox.png b/media/nav/cyberfox.png deleted file mode 100755 index 0802327..0000000 Binary files a/media/nav/cyberfox.png and /dev/null differ diff --git a/media/nav/edge.png b/media/nav/edge.png deleted file mode 100755 index d2a970f..0000000 Binary files a/media/nav/edge.png and /dev/null differ diff --git a/media/nav/falkon.png b/media/nav/falkon.png deleted file mode 100755 index 5a8885e..0000000 Binary files a/media/nav/falkon.png and /dev/null differ diff --git a/media/nav/firefox.png b/media/nav/firefox.png deleted file mode 100755 index 0126678..0000000 Binary files a/media/nav/firefox.png and /dev/null differ diff --git a/media/nav/firefoxdeveloperedition.png b/media/nav/firefoxdeveloperedition.png deleted file mode 100755 index b5bcadc..0000000 Binary files a/media/nav/firefoxdeveloperedition.png and /dev/null differ diff --git a/media/nav/firefoxesr.png b/media/nav/firefoxesr.png deleted file mode 100755 index 01848e8..0000000 Binary files a/media/nav/firefoxesr.png and /dev/null differ diff --git a/media/nav/gnomeweb.png b/media/nav/gnomeweb.png deleted file mode 100755 index 60f9aed..0000000 Binary files a/media/nav/gnomeweb.png and /dev/null differ diff --git a/media/nav/icecat.png b/media/nav/icecat.png deleted file mode 100755 index 258b1c8..0000000 Binary files a/media/nav/icecat.png and /dev/null differ diff --git a/media/nav/iceweasel.png b/media/nav/iceweasel.png deleted file mode 100755 index 78d1e0a..0000000 Binary files a/media/nav/iceweasel.png and /dev/null differ diff --git a/media/nav/internetexplorer.png b/media/nav/internetexplorer.png deleted file mode 100755 index aaac64a..0000000 Binary files a/media/nav/internetexplorer.png and /dev/null differ diff --git a/media/nav/konqueror.png b/media/nav/konqueror.png deleted file mode 100755 index ab00936..0000000 Binary files a/media/nav/konqueror.png and /dev/null differ diff --git a/media/nav/maxthon.png b/media/nav/maxthon.png deleted file mode 100755 index 8173455..0000000 Binary files a/media/nav/maxthon.png and /dev/null differ diff --git a/media/nav/midori.png b/media/nav/midori.png deleted file mode 100755 index 7f066a0..0000000 Binary files a/media/nav/midori.png and /dev/null differ diff --git a/media/nav/nightly.png b/media/nav/nightly.png deleted file mode 100755 index 7ea90c6..0000000 Binary files a/media/nav/nightly.png and /dev/null differ diff --git a/media/nav/opera.png b/media/nav/opera.png deleted file mode 100755 index 9baec6c..0000000 Binary files a/media/nav/opera.png and /dev/null differ diff --git a/media/nav/palemoon.png b/media/nav/palemoon.png deleted file mode 100755 index 0b18aac..0000000 Binary files a/media/nav/palemoon.png and /dev/null differ diff --git a/media/nav/safari.png b/media/nav/safari.png deleted file mode 100755 index eafcb88..0000000 Binary files a/media/nav/safari.png and /dev/null differ diff --git a/media/nav/seamonkey.png b/media/nav/seamonkey.png deleted file mode 100755 index df0664c..0000000 Binary files a/media/nav/seamonkey.png and /dev/null differ diff --git a/media/nav/tor.png b/media/nav/tor.png deleted file mode 100755 index a1c822a..0000000 Binary files a/media/nav/tor.png and /dev/null differ diff --git a/media/nav/torch.png b/media/nav/torch.png deleted file mode 100755 index b1fdf82..0000000 Binary files a/media/nav/torch.png and /dev/null differ diff --git a/media/nav/vivaldi.png b/media/nav/vivaldi.png deleted file mode 100755 index 13875db..0000000 Binary files a/media/nav/vivaldi.png and /dev/null differ diff --git a/media/nav/waterfox.png b/media/nav/waterfox.png deleted file mode 100755 index e46351d..0000000 Binary files a/media/nav/waterfox.png and /dev/null differ diff --git a/media/nav/yandex.png b/media/nav/yandex.png deleted file mode 100755 index 95de4d8..0000000 Binary files a/media/nav/yandex.png and /dev/null differ diff --git a/media/nb/cat.png b/media/nb/cat.png deleted file mode 100755 index 64191af..0000000 Binary files a/media/nb/cat.png and /dev/null differ diff --git a/media/nb/cet.png b/media/nb/cet.png deleted file mode 100755 index 7eaf17f..0000000 Binary files a/media/nb/cet.png and /dev/null differ diff --git a/media/nb/de.png b/media/nb/de.png deleted file mode 100755 index 949405a..0000000 Binary files a/media/nb/de.png and /dev/null differ diff --git a/media/nb/in.png b/media/nb/in.png deleted file mode 100755 index 44884d1..0000000 Binary files a/media/nb/in.png and /dev/null differ diff --git a/media/nb/noeuf.png b/media/nb/noeuf.png deleted file mode 100755 index b698e62..0000000 Binary files a/media/nb/noeuf.png and /dev/null differ diff --git a/media/nb/sinc.png b/media/nb/sinc.png deleted file mode 100755 index b8566dc..0000000 Binary files a/media/nb/sinc.png and /dev/null differ diff --git a/media/nb/sis.png b/media/nb/sis.png deleted file mode 100755 index 1317db5..0000000 Binary files a/media/nb/sis.png and /dev/null differ diff --git a/media/nb/troi.png b/media/nb/troi.png deleted file mode 100755 index dcd324a..0000000 Binary files a/media/nb/troi.png and /dev/null differ diff --git a/media/nb/uite.png b/media/nb/uite.png deleted file mode 100755 index 47d43bb..0000000 Binary files a/media/nb/uite.png and /dev/null differ diff --git a/media/non-pub-horizontale.png b/media/non-pub-horizontale.png deleted file mode 100755 index 0ceba62..0000000 Binary files a/media/non-pub-horizontale.png and /dev/null differ diff --git a/media/onglet/brave.png b/media/onglet/brave.png deleted file mode 100755 index d3c34e6..0000000 Binary files a/media/onglet/brave.png and /dev/null differ diff --git a/media/onglet/chrome.png b/media/onglet/chrome.png deleted file mode 100755 index 1ac9118..0000000 Binary files a/media/onglet/chrome.png and /dev/null differ diff --git a/media/onglet/chromium.png b/media/onglet/chromium.png deleted file mode 100755 index 1ac9118..0000000 Binary files a/media/onglet/chromium.png and /dev/null differ diff --git a/media/onglet/cliqz.png b/media/onglet/cliqz.png deleted file mode 100755 index dbfad59..0000000 Binary files a/media/onglet/cliqz.png and /dev/null differ diff --git a/media/onglet/cyberfox.png b/media/onglet/cyberfox.png deleted file mode 100755 index 9d1deee..0000000 Binary files a/media/onglet/cyberfox.png and /dev/null differ diff --git a/media/onglet/edge.png b/media/onglet/edge.png deleted file mode 100755 index 3717fab..0000000 Binary files a/media/onglet/edge.png and /dev/null differ diff --git a/media/onglet/falkon.png b/media/onglet/falkon.png deleted file mode 100755 index 866629c..0000000 Binary files a/media/onglet/falkon.png and /dev/null differ diff --git a/media/onglet/firefox.png b/media/onglet/firefox.png deleted file mode 100755 index 4d369b9..0000000 Binary files a/media/onglet/firefox.png and /dev/null differ diff --git a/media/onglet/firefoxdeveloperedition.png b/media/onglet/firefoxdeveloperedition.png deleted file mode 100755 index 0fb7513..0000000 Binary files a/media/onglet/firefoxdeveloperedition.png and /dev/null differ diff --git a/media/onglet/gnomeweb.png b/media/onglet/gnomeweb.png deleted file mode 100755 index 3fa75bc..0000000 Binary files a/media/onglet/gnomeweb.png and /dev/null differ diff --git a/media/onglet/internetexplorer.png b/media/onglet/internetexplorer.png deleted file mode 100755 index ad72c8d..0000000 Binary files a/media/onglet/internetexplorer.png and /dev/null differ diff --git a/media/onglet/konqueror.png b/media/onglet/konqueror.png deleted file mode 100755 index 0f26a15..0000000 Binary files a/media/onglet/konqueror.png and /dev/null differ diff --git a/media/onglet/maxthon.png b/media/onglet/maxthon.png deleted file mode 100755 index 2fe28bf..0000000 Binary files a/media/onglet/maxthon.png and /dev/null differ diff --git a/media/onglet/midori.png b/media/onglet/midori.png deleted file mode 100755 index ff3f399..0000000 Binary files a/media/onglet/midori.png and /dev/null differ diff --git a/media/onglet/opera.png b/media/onglet/opera.png deleted file mode 100755 index b62f02f..0000000 Binary files a/media/onglet/opera.png and /dev/null differ diff --git a/media/onglet/palemoon.png b/media/onglet/palemoon.png deleted file mode 100755 index 17e4c7d..0000000 Binary files a/media/onglet/palemoon.png and /dev/null differ diff --git a/media/onglet/safari.png b/media/onglet/safari.png deleted file mode 100755 index 1ca8a61..0000000 Binary files a/media/onglet/safari.png and /dev/null differ diff --git a/media/onglet/seamonkey.png b/media/onglet/seamonkey.png deleted file mode 100755 index ba9e7ea..0000000 Binary files a/media/onglet/seamonkey.png and /dev/null differ diff --git a/media/onglet/tor.png b/media/onglet/tor.png deleted file mode 100755 index f970f49..0000000 Binary files a/media/onglet/tor.png and /dev/null differ diff --git a/media/onglet/torch.png b/media/onglet/torch.png deleted file mode 100755 index be1f28c..0000000 Binary files a/media/onglet/torch.png and /dev/null differ diff --git a/media/onglet/vivaldi.png b/media/onglet/vivaldi.png deleted file mode 100755 index b4f9bf1..0000000 Binary files a/media/onglet/vivaldi.png and /dev/null differ diff --git a/media/onglet/waterfox.png b/media/onglet/waterfox.png deleted file mode 100755 index b8f7352..0000000 Binary files a/media/onglet/waterfox.png and /dev/null differ diff --git a/media/onglet/yandex.png b/media/onglet/yandex.png deleted file mode 100755 index eeaa0ae..0000000 Binary files a/media/onglet/yandex.png and /dev/null differ diff --git a/media/oslogo/4MLinux.png b/media/oslogo/4MLinux.png deleted file mode 100755 index e504fc7..0000000 Binary files a/media/oslogo/4MLinux.png and /dev/null differ diff --git a/media/oslogo/AIX.png b/media/oslogo/AIX.png deleted file mode 100755 index 2a16e0a..0000000 Binary files a/media/oslogo/AIX.png and /dev/null differ diff --git a/media/oslogo/ALT.png b/media/oslogo/ALT.png deleted file mode 100755 index e9c64a5..0000000 Binary files a/media/oslogo/ALT.png and /dev/null differ diff --git a/media/oslogo/Alpine.png b/media/oslogo/Alpine.png deleted file mode 100755 index a0963a2..0000000 Binary files a/media/oslogo/Alpine.png and /dev/null differ diff --git a/media/oslogo/Amazon.png b/media/oslogo/Amazon.png deleted file mode 100755 index 3ed73c2..0000000 Binary files a/media/oslogo/Amazon.png and /dev/null differ diff --git a/media/oslogo/Android.png b/media/oslogo/Android.png deleted file mode 100755 index fdf819e..0000000 Binary files a/media/oslogo/Android.png and /dev/null differ diff --git a/media/oslogo/Apple.png b/media/oslogo/Apple.png deleted file mode 100755 index ac1178d..0000000 Binary files a/media/oslogo/Apple.png and /dev/null differ diff --git a/media/oslogo/Arch.png b/media/oslogo/Arch.png deleted file mode 100755 index eb35007..0000000 Binary files a/media/oslogo/Arch.png and /dev/null differ diff --git a/media/oslogo/BOSS.png b/media/oslogo/BOSS.png deleted file mode 100755 index 23745c6..0000000 Binary files a/media/oslogo/BOSS.png and /dev/null differ diff --git a/media/oslogo/Calculate.png b/media/oslogo/Calculate.png deleted file mode 100755 index 808b295..0000000 Binary files a/media/oslogo/Calculate.png and /dev/null differ diff --git a/media/oslogo/Canaima.png b/media/oslogo/Canaima.png deleted file mode 100755 index 7388c47..0000000 Binary files a/media/oslogo/Canaima.png and /dev/null differ diff --git a/media/oslogo/CentOS.png b/media/oslogo/CentOS.png deleted file mode 100755 index e2c8a11..0000000 Binary files a/media/oslogo/CentOS.png and /dev/null differ diff --git a/media/oslogo/Chakra.png b/media/oslogo/Chakra.png deleted file mode 100755 index 06a5609..0000000 Binary files a/media/oslogo/Chakra.png and /dev/null differ diff --git a/media/oslogo/ClearOS.png b/media/oslogo/ClearOS.png deleted file mode 100755 index f2a1f2e..0000000 Binary files a/media/oslogo/ClearOS.png and /dev/null differ diff --git a/media/oslogo/Cloud.png b/media/oslogo/Cloud.png deleted file mode 100755 index 0b0fd83..0000000 Binary files a/media/oslogo/Cloud.png and /dev/null differ diff --git a/media/oslogo/Cobalt.png b/media/oslogo/Cobalt.png deleted file mode 100755 index 674def8..0000000 Binary files a/media/oslogo/Cobalt.png and /dev/null differ diff --git a/media/oslogo/CoreOS.png b/media/oslogo/CoreOS.png deleted file mode 100755 index c955f77..0000000 Binary files a/media/oslogo/CoreOS.png and /dev/null differ diff --git a/media/oslogo/Crux.png b/media/oslogo/Crux.png deleted file mode 100755 index ba889da..0000000 Binary files a/media/oslogo/Crux.png and /dev/null differ diff --git a/media/oslogo/Darwin.png b/media/oslogo/Darwin.png deleted file mode 100755 index a4d8d2d..0000000 Binary files a/media/oslogo/Darwin.png and /dev/null differ diff --git a/media/oslogo/Debian.png b/media/oslogo/Debian.png deleted file mode 100755 index 00093f9..0000000 Binary files a/media/oslogo/Debian.png and /dev/null differ diff --git a/media/oslogo/Deepin.png b/media/oslogo/Deepin.png deleted file mode 100755 index 8a9e502..0000000 Binary files a/media/oslogo/Deepin.png and /dev/null differ diff --git a/media/oslogo/Devuan.png b/media/oslogo/Devuan.png deleted file mode 100755 index d1888d6..0000000 Binary files a/media/oslogo/Devuan.png and /dev/null differ diff --git a/media/oslogo/DragonFly.png b/media/oslogo/DragonFly.png deleted file mode 100755 index 574bb6a..0000000 Binary files a/media/oslogo/DragonFly.png and /dev/null differ diff --git a/media/oslogo/Eisfair.png b/media/oslogo/Eisfair.png deleted file mode 100755 index 4d5aa07..0000000 Binary files a/media/oslogo/Eisfair.png and /dev/null differ diff --git a/media/oslogo/Fedora.png b/media/oslogo/Fedora.png deleted file mode 100755 index 883e96a..0000000 Binary files a/media/oslogo/Fedora.png and /dev/null differ diff --git a/media/oslogo/Foresight.png b/media/oslogo/Foresight.png deleted file mode 100755 index 34d427d..0000000 Binary files a/media/oslogo/Foresight.png and /dev/null differ diff --git a/media/oslogo/FreeBSD.png b/media/oslogo/FreeBSD.png deleted file mode 100755 index 597afb5..0000000 Binary files a/media/oslogo/FreeBSD.png and /dev/null differ diff --git a/media/oslogo/Frugalware.png b/media/oslogo/Frugalware.png deleted file mode 100755 index b30c4cd..0000000 Binary files a/media/oslogo/Frugalware.png and /dev/null differ diff --git a/media/oslogo/Fuduntu.png b/media/oslogo/Fuduntu.png deleted file mode 100755 index 73e2e43..0000000 Binary files a/media/oslogo/Fuduntu.png and /dev/null differ diff --git a/media/oslogo/Generations.png b/media/oslogo/Generations.png deleted file mode 100755 index f3adfd0..0000000 Binary files a/media/oslogo/Generations.png and /dev/null differ diff --git a/media/oslogo/Gentoo.png b/media/oslogo/Gentoo.png deleted file mode 100755 index d806c57..0000000 Binary files a/media/oslogo/Gentoo.png and /dev/null differ diff --git a/media/oslogo/Gobo.png b/media/oslogo/Gobo.png deleted file mode 100755 index 9efde30..0000000 Binary files a/media/oslogo/Gobo.png and /dev/null differ diff --git a/media/oslogo/HPUX.png b/media/oslogo/HPUX.png deleted file mode 100755 index 0ebb4ad..0000000 Binary files a/media/oslogo/HPUX.png and /dev/null differ diff --git a/media/oslogo/Haiku.png b/media/oslogo/Haiku.png deleted file mode 100755 index 21fb376..0000000 Binary files a/media/oslogo/Haiku.png and /dev/null differ diff --git a/media/oslogo/Handy.png b/media/oslogo/Handy.png deleted file mode 100755 index 436de66..0000000 Binary files a/media/oslogo/Handy.png and /dev/null differ diff --git a/media/oslogo/HipServ.png b/media/oslogo/HipServ.png deleted file mode 100755 index 4df68cc..0000000 Binary files a/media/oslogo/HipServ.png and /dev/null differ diff --git a/media/oslogo/IPFire.png b/media/oslogo/IPFire.png deleted file mode 100755 index 5e7870f..0000000 Binary files a/media/oslogo/IPFire.png and /dev/null differ diff --git a/media/oslogo/KaOS.png b/media/oslogo/KaOS.png deleted file mode 100755 index 0e50498..0000000 Binary files a/media/oslogo/KaOS.png and /dev/null differ diff --git a/media/oslogo/Korora.png b/media/oslogo/Korora.png deleted file mode 100755 index 8abd2f3..0000000 Binary files a/media/oslogo/Korora.png and /dev/null differ diff --git a/media/oslogo/LFS.png b/media/oslogo/LFS.png deleted file mode 100755 index 3796f48..0000000 Binary files a/media/oslogo/LFS.png and /dev/null differ diff --git a/media/oslogo/Linaro.png b/media/oslogo/Linaro.png deleted file mode 100755 index b076f7a..0000000 Binary files a/media/oslogo/Linaro.png and /dev/null differ diff --git a/media/oslogo/Lunar.png b/media/oslogo/Lunar.png deleted file mode 100755 index 4d25176..0000000 Binary files a/media/oslogo/Lunar.png and /dev/null differ diff --git a/media/oslogo/Mageia.png b/media/oslogo/Mageia.png deleted file mode 100755 index c885533..0000000 Binary files a/media/oslogo/Mageia.png and /dev/null differ diff --git a/media/oslogo/Mandrake.png b/media/oslogo/Mandrake.png deleted file mode 100755 index 09ccd20..0000000 Binary files a/media/oslogo/Mandrake.png and /dev/null differ diff --git a/media/oslogo/Manjaro.png b/media/oslogo/Manjaro.png deleted file mode 100755 index ae3a642..0000000 Binary files a/media/oslogo/Manjaro.png and /dev/null differ diff --git a/media/oslogo/Mer.png b/media/oslogo/Mer.png deleted file mode 100755 index 2eeb38e..0000000 Binary files a/media/oslogo/Mer.png and /dev/null differ diff --git a/media/oslogo/Minix.png b/media/oslogo/Minix.png deleted file mode 100755 index 2025d08..0000000 Binary files a/media/oslogo/Minix.png and /dev/null differ diff --git a/media/oslogo/Mint.png b/media/oslogo/Mint.png deleted file mode 100755 index a886bb3..0000000 Binary files a/media/oslogo/Mint.png and /dev/null differ diff --git a/media/oslogo/NeoKylin.png b/media/oslogo/NeoKylin.png deleted file mode 100755 index 3fcf530..0000000 Binary files a/media/oslogo/NeoKylin.png and /dev/null differ diff --git a/media/oslogo/NetBSD.png b/media/oslogo/NetBSD.png deleted file mode 100755 index ebcc33f..0000000 Binary files a/media/oslogo/NetBSD.png and /dev/null differ diff --git a/media/oslogo/Netrunner.png b/media/oslogo/Netrunner.png deleted file mode 100755 index 7616118..0000000 Binary files a/media/oslogo/Netrunner.png and /dev/null differ diff --git a/media/oslogo/NixOS.png b/media/oslogo/NixOS.png deleted file mode 100755 index 054a0b0..0000000 Binary files a/media/oslogo/NixOS.png and /dev/null differ diff --git a/media/oslogo/OpenBSD.png b/media/oslogo/OpenBSD.png deleted file mode 100755 index 84da5c7..0000000 Binary files a/media/oslogo/OpenBSD.png and /dev/null differ diff --git a/media/oslogo/OpenMamba.png b/media/oslogo/OpenMamba.png deleted file mode 100755 index caa7200..0000000 Binary files a/media/oslogo/OpenMamba.png and /dev/null differ diff --git a/media/oslogo/OpenMandriva.png b/media/oslogo/OpenMandriva.png deleted file mode 100755 index 0df0ebf..0000000 Binary files a/media/oslogo/OpenMandriva.png and /dev/null differ diff --git a/media/oslogo/Oracle.png b/media/oslogo/Oracle.png deleted file mode 100755 index a9b1de1..0000000 Binary files a/media/oslogo/Oracle.png and /dev/null differ diff --git a/media/oslogo/PCLinuxOS.png b/media/oslogo/PCLinuxOS.png deleted file mode 100755 index 23b5d1b..0000000 Binary files a/media/oslogo/PCLinuxOS.png and /dev/null differ diff --git a/media/oslogo/PLD.png b/media/oslogo/PLD.png deleted file mode 100755 index 2b09d7d..0000000 Binary files a/media/oslogo/PLD.png and /dev/null differ diff --git a/media/oslogo/Parsix.png b/media/oslogo/Parsix.png deleted file mode 100755 index 9cddb1d..0000000 Binary files a/media/oslogo/Parsix.png and /dev/null differ diff --git a/media/oslogo/Pear.png b/media/oslogo/Pear.png deleted file mode 100755 index 8811a7b..0000000 Binary files a/media/oslogo/Pear.png and /dev/null differ diff --git a/media/oslogo/Peppermint.png b/media/oslogo/Peppermint.png deleted file mode 100755 index 59d8e68..0000000 Binary files a/media/oslogo/Peppermint.png and /dev/null differ diff --git a/media/oslogo/Pisi.png b/media/oslogo/Pisi.png deleted file mode 100755 index 3d44955..0000000 Binary files a/media/oslogo/Pisi.png and /dev/null differ diff --git a/media/oslogo/Porteus.png b/media/oslogo/Porteus.png deleted file mode 100755 index 0ddafdb..0000000 Binary files a/media/oslogo/Porteus.png and /dev/null differ diff --git a/media/oslogo/Puppy.png b/media/oslogo/Puppy.png deleted file mode 100755 index b4835e8..0000000 Binary files a/media/oslogo/Puppy.png and /dev/null differ diff --git a/media/oslogo/QNX.png b/media/oslogo/QNX.png deleted file mode 100755 index cb0f559..0000000 Binary files a/media/oslogo/QNX.png and /dev/null differ diff --git a/media/oslogo/QTS.png b/media/oslogo/QTS.png deleted file mode 100755 index 0d4406b..0000000 Binary files a/media/oslogo/QTS.png and /dev/null differ diff --git a/media/oslogo/Qubes.png b/media/oslogo/Qubes.png deleted file mode 100755 index 96d568a..0000000 Binary files a/media/oslogo/Qubes.png and /dev/null differ diff --git a/media/oslogo/ROSA.png b/media/oslogo/ROSA.png deleted file mode 100755 index de0a0b5..0000000 Binary files a/media/oslogo/ROSA.png and /dev/null differ diff --git a/media/oslogo/Raspbian.png b/media/oslogo/Raspbian.png deleted file mode 100755 index 85e5ad5..0000000 Binary files a/media/oslogo/Raspbian.png and /dev/null differ diff --git a/media/oslogo/ReactOS.png b/media/oslogo/ReactOS.png deleted file mode 100755 index 37495b6..0000000 Binary files a/media/oslogo/ReactOS.png and /dev/null differ diff --git a/media/oslogo/RedFlag.png b/media/oslogo/RedFlag.png deleted file mode 100755 index c291121..0000000 Binary files a/media/oslogo/RedFlag.png and /dev/null differ diff --git a/media/oslogo/RedHat.png b/media/oslogo/RedHat.png deleted file mode 100755 index 2092015..0000000 Binary files a/media/oslogo/RedHat.png and /dev/null differ diff --git a/media/oslogo/Rubix.png b/media/oslogo/Rubix.png deleted file mode 100755 index ace28b0..0000000 Binary files a/media/oslogo/Rubix.png and /dev/null differ diff --git a/media/oslogo/SMEServer.png b/media/oslogo/SMEServer.png deleted file mode 100755 index 75712f6..0000000 Binary files a/media/oslogo/SMEServer.png and /dev/null differ diff --git a/media/oslogo/SMS.png b/media/oslogo/SMS.png deleted file mode 100755 index fdabecd..0000000 Binary files a/media/oslogo/SMS.png and /dev/null differ diff --git a/media/oslogo/SUSE.png b/media/oslogo/SUSE.png deleted file mode 100755 index a4d1126..0000000 Binary files a/media/oslogo/SUSE.png and /dev/null differ diff --git a/media/oslogo/Sabayon.png b/media/oslogo/Sabayon.png deleted file mode 100755 index 8213c2b..0000000 Binary files a/media/oslogo/Sabayon.png and /dev/null differ diff --git a/media/oslogo/SalentOS.png b/media/oslogo/SalentOS.png deleted file mode 100755 index 5cb1095..0000000 Binary files a/media/oslogo/SalentOS.png and /dev/null differ diff --git a/media/oslogo/Salix.png b/media/oslogo/Salix.png deleted file mode 100755 index fe1b474..0000000 Binary files a/media/oslogo/Salix.png and /dev/null differ diff --git a/media/oslogo/Scientific.png b/media/oslogo/Scientific.png deleted file mode 100755 index cb5621f..0000000 Binary files a/media/oslogo/Scientific.png and /dev/null differ diff --git a/media/oslogo/Semplice.png b/media/oslogo/Semplice.png deleted file mode 100755 index 9875c7e..0000000 Binary files a/media/oslogo/Semplice.png and /dev/null differ diff --git a/media/oslogo/Slackware.png b/media/oslogo/Slackware.png deleted file mode 100755 index b711e48..0000000 Binary files a/media/oslogo/Slackware.png and /dev/null differ diff --git a/media/oslogo/Slax.png b/media/oslogo/Slax.png deleted file mode 100755 index 6f01c94..0000000 Binary files a/media/oslogo/Slax.png and /dev/null differ diff --git a/media/oslogo/SliTaz.png b/media/oslogo/SliTaz.png deleted file mode 100755 index 8dd4293..0000000 Binary files a/media/oslogo/SliTaz.png and /dev/null differ diff --git a/media/oslogo/Solus.png b/media/oslogo/Solus.png deleted file mode 100755 index 93f4aae..0000000 Binary files a/media/oslogo/Solus.png and /dev/null differ diff --git a/media/oslogo/SolusOS.png b/media/oslogo/SolusOS.png deleted file mode 100755 index 522d160..0000000 Binary files a/media/oslogo/SolusOS.png and /dev/null differ diff --git a/media/oslogo/SolydXK.png b/media/oslogo/SolydXK.png deleted file mode 100755 index 2143593..0000000 Binary files a/media/oslogo/SolydXK.png and /dev/null differ diff --git a/media/oslogo/StartOS.png b/media/oslogo/StartOS.png deleted file mode 100755 index ab48528..0000000 Binary files a/media/oslogo/StartOS.png and /dev/null differ diff --git a/media/oslogo/SteamOS.png b/media/oslogo/SteamOS.png deleted file mode 100755 index ddd679e..0000000 Binary files a/media/oslogo/SteamOS.png and /dev/null differ diff --git a/media/oslogo/SunOS.png b/media/oslogo/SunOS.png deleted file mode 100755 index e7de00f..0000000 Binary files a/media/oslogo/SunOS.png and /dev/null differ diff --git a/media/oslogo/Synology.png b/media/oslogo/Synology.png deleted file mode 100755 index 06662d5..0000000 Binary files a/media/oslogo/Synology.png and /dev/null differ diff --git a/media/oslogo/Tails.png b/media/oslogo/Tails.png deleted file mode 100755 index 4058145..0000000 Binary files a/media/oslogo/Tails.png and /dev/null differ diff --git a/media/oslogo/Tanglu.png b/media/oslogo/Tanglu.png deleted file mode 100755 index f215845..0000000 Binary files a/media/oslogo/Tanglu.png and /dev/null differ diff --git a/media/oslogo/TinyCore.png b/media/oslogo/TinyCore.png deleted file mode 100755 index 3b18b95..0000000 Binary files a/media/oslogo/TinyCore.png and /dev/null differ diff --git a/media/oslogo/Tizen.png b/media/oslogo/Tizen.png deleted file mode 100755 index 08100f4..0000000 Binary files a/media/oslogo/Tizen.png and /dev/null differ diff --git a/media/oslogo/Trisquel.png b/media/oslogo/Trisquel.png deleted file mode 100755 index d632108..0000000 Binary files a/media/oslogo/Trisquel.png and /dev/null differ diff --git a/media/oslogo/Trustix.png b/media/oslogo/Trustix.png deleted file mode 100755 index 6b2dd70..0000000 Binary files a/media/oslogo/Trustix.png and /dev/null differ diff --git a/media/oslogo/Turbo.png b/media/oslogo/Turbo.png deleted file mode 100755 index 4d040d9..0000000 Binary files a/media/oslogo/Turbo.png and /dev/null differ diff --git a/media/oslogo/Ubuntu.png b/media/oslogo/Ubuntu.png deleted file mode 100755 index a0ea4a4..0000000 Binary files a/media/oslogo/Ubuntu.png and /dev/null differ diff --git a/media/oslogo/UltimateEdition.png b/media/oslogo/UltimateEdition.png deleted file mode 100755 index 9eb8f0b..0000000 Binary files a/media/oslogo/UltimateEdition.png and /dev/null differ diff --git a/media/oslogo/Vector.png b/media/oslogo/Vector.png deleted file mode 100755 index cb625ba..0000000 Binary files a/media/oslogo/Vector.png and /dev/null differ diff --git a/media/oslogo/Void.png b/media/oslogo/Void.png deleted file mode 100755 index bc1bfdc..0000000 Binary files a/media/oslogo/Void.png and /dev/null differ diff --git a/media/oslogo/VortexBox.png b/media/oslogo/VortexBox.png deleted file mode 100755 index db6158e..0000000 Binary files a/media/oslogo/VortexBox.png and /dev/null differ diff --git a/media/oslogo/Win2000.png b/media/oslogo/Win2000.png deleted file mode 100755 index 3147daa..0000000 Binary files a/media/oslogo/Win2000.png and /dev/null differ diff --git a/media/oslogo/Win8.png b/media/oslogo/Win8.png deleted file mode 100755 index 157d353..0000000 Binary files a/media/oslogo/Win8.png and /dev/null differ diff --git a/media/oslogo/WinVista.png b/media/oslogo/WinVista.png deleted file mode 100755 index 6cbed9e..0000000 Binary files a/media/oslogo/WinVista.png and /dev/null differ diff --git a/media/oslogo/WinXP.png b/media/oslogo/WinXP.png deleted file mode 100755 index 5d2e08d..0000000 Binary files a/media/oslogo/WinXP.png and /dev/null differ diff --git a/media/oslogo/Zenwalk.png b/media/oslogo/Zenwalk.png deleted file mode 100755 index 0820e02..0000000 Binary files a/media/oslogo/Zenwalk.png and /dev/null differ diff --git a/media/oslogo/Zorin.png b/media/oslogo/Zorin.png deleted file mode 100755 index 215ea8a..0000000 Binary files a/media/oslogo/Zorin.png and /dev/null differ diff --git a/media/oslogo/antiX.png b/media/oslogo/antiX.png deleted file mode 100755 index 7c00384..0000000 Binary files a/media/oslogo/antiX.png and /dev/null differ diff --git a/media/oslogo/elementaryOS.png b/media/oslogo/elementaryOS.png deleted file mode 100755 index 0888918..0000000 Binary files a/media/oslogo/elementaryOS.png and /dev/null differ diff --git a/media/oslogo/free-eos.png b/media/oslogo/free-eos.png deleted file mode 100755 index 0cee490..0000000 Binary files a/media/oslogo/free-eos.png and /dev/null differ diff --git a/media/oslogo/gNewSense.png b/media/oslogo/gNewSense.png deleted file mode 100755 index 469f654..0000000 Binary files a/media/oslogo/gNewSense.png and /dev/null differ diff --git a/media/oslogo/iycc.png b/media/oslogo/iycc.png deleted file mode 100755 index 0c30fab..0000000 Binary files a/media/oslogo/iycc.png and /dev/null differ diff --git a/media/oslogo/openSUSE.png b/media/oslogo/openSUSE.png deleted file mode 100755 index 7bd7d8d..0000000 Binary files a/media/oslogo/openSUSE.png and /dev/null differ diff --git a/media/oslogo/pfSense.png b/media/oslogo/pfSense.png deleted file mode 100755 index eeba67f..0000000 Binary files a/media/oslogo/pfSense.png and /dev/null differ diff --git a/media/oslogo/unknown.png b/media/oslogo/unknown.png deleted file mode 100755 index 63e5e3c..0000000 Binary files a/media/oslogo/unknown.png and /dev/null differ diff --git a/media/privacy.png b/media/privacy.png deleted file mode 100755 index 4643119..0000000 Binary files a/media/privacy.png and /dev/null differ diff --git a/media/tntblanc.png b/media/tntblanc.png deleted file mode 100755 index 715637a..0000000 Binary files a/media/tntblanc.png and /dev/null differ diff --git a/media/tntbleu.png b/media/tntbleu.png deleted file mode 100755 index d314cfc..0000000 Binary files a/media/tntbleu.png and /dev/null differ diff --git a/media/tntgris.png b/media/tntgris.png deleted file mode 100755 index 5aba137..0000000 Binary files a/media/tntgris.png and /dev/null differ diff --git a/media/tntnoir.png b/media/tntnoir.png deleted file mode 100755 index f8a0eaa..0000000 Binary files a/media/tntnoir.png and /dev/null differ diff --git a/media/ublockpopup.png b/media/ublockpopup.png deleted file mode 100755 index c93b062..0000000 Binary files a/media/ublockpopup.png and /dev/null differ diff --git a/media/wappalyser.png b/media/wappalyser.png deleted file mode 100755 index f401472..0000000 Binary files a/media/wappalyser.png and /dev/null differ diff --git a/monnavigateur.php b/monnavigateur.php deleted file mode 100755 index 34c3e4a..0000000 --- a/monnavigateur.php +++ /dev/null @@ -1,73 +0,0 @@ - - -

    Mon navigateur

    - -
    -

    Mon adresse IP

    -
    - Votre adresse IP est : -

    - Une adresse IP (IP pour Internet Protocol) est une information permettant d'identifier votre ordinateur. Elle est utilisée pour n'importe quel échange sur internet. -
    - - - - -
    -

    Mon référent HTTP

    -
    - - - - Votre navigateur n'a pas envoyé de référent HTTP (HTTP referer). -

    - Un référent HTTP est une information envoyée par votre navigateur indiquant au site sur quelle page vous vous trouviez avant d'utiliser le lien qui vous a conduit ici. - - - Votre référent HTTP (HTTP referer) est : -

    - Un référent HTTP est une information envoyée par votre navigateur indiquant au site sur quelle page vous vous trouviez avant d'utiliser le lien qui vous a conduit ici. - -
    - -
    - - - -
    - - -
    -

    Mon agent utilisateur

    -
    - Votre agent utilisateur (user agent) est : -

    - Un agent utilisateur est une information envoyée par votre navigateur indiquant au site diverses informations sur vous. Il peut contenir votre système d'exploitation, votre navigateur, sa version et votre langue. -
    - - - - "; - echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']); - -} else { - echo "Erreur : Mauvais argument·s"; -} diff --git a/navigateur.php b/navigateur.php new file mode 100755 index 0000000..8bab712 --- /dev/null +++ b/navigateur.php @@ -0,0 +1,86 @@ + + + +

    Informations de ton navigateur Web

    + + + +

    +

    Ton adresse IP

    + + Ton adresse IP est : +

    + Une adresse IP (IP pour Internet Protocol) est une information permettant d'identifier ton ordinateur. Elle est utilisée pour n'importe quel échange sur internet. +

    + + + + +

    +

    Ton référent HTTP

    + + + + + Ton navigateur n'a pas envoyé de référent HTTP (HTTP referer). +

    + Un référent HTTP est une information envoyée par ton navigateur indiquant au site sur quelle page tu te trouvais avant d'utiliser le lien qui t'a conduit ici. + + + Ton référent HTTP (HTTP referer) est : +

    + Un référent HTTP est une information envoyée par ton navigateur indiquant au site sur quelle page tu te trouviez avant d'utiliser le lien qui t'a conduit ici. + +
    + +

    + + + + + +

    +

    Ton agent utilisateur

    + L'agent utilisateur (user agent) envoyé par ton navigateur est : +

    + Un agent utilisateur est une information envoyée par ton navigateur indiquant au site diverses informations sur vous. Il peut contenir ton système d'exploitation, ton navigateur, sa version et ta langue. +

    + + + + +

    +

    Langues demandées

    + Ton navigateur a demandé la ou les langue·s suivante·s : +

    + Ton navigateur envoie aux pages qu'il visite la liste des langues que tu est censé·e pouvoir lire (généralement en se basant sur la langue de son interface). + + +

    + + + + "; + echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']); + +} else { + echo "Erreur : Mauvais argument·s"; +} diff --git a/polices/condense.ttf b/polices/condense.ttf deleted file mode 100755 index 8d3e867..0000000 Binary files a/polices/condense.ttf and /dev/null differ diff --git a/polices/fin-it.ttf b/polices/fin-it.ttf deleted file mode 100755 index e36de45..0000000 Binary files a/polices/fin-it.ttf and /dev/null differ diff --git a/polices/fin.ttf b/polices/fin.ttf deleted file mode 100755 index 7b7ac7d..0000000 Binary files a/polices/fin.ttf and /dev/null differ diff --git a/polices/gras-it.ttf b/polices/gras-it.ttf deleted file mode 100755 index 12e4c7d..0000000 Binary files a/polices/gras-it.ttf and /dev/null differ diff --git a/polices/gras.ttf b/polices/gras.ttf deleted file mode 100755 index c0142fe..0000000 Binary files a/polices/gras.ttf and /dev/null differ diff --git a/polices/moyen-it.ttf b/polices/moyen-it.ttf deleted file mode 100755 index 321eccf..0000000 Binary files a/polices/moyen-it.ttf and /dev/null differ diff --git a/polices/moyen.ttf b/polices/moyen.ttf deleted file mode 100755 index 443ec8b..0000000 Binary files a/polices/moyen.ttf and /dev/null differ diff --git a/polices/ubuntu-it.ttf b/polices/ubuntu-it.ttf deleted file mode 100755 index 6f819f6..0000000 Binary files a/polices/ubuntu-it.ttf and /dev/null differ diff --git a/polices/ubuntu.ttf b/polices/ubuntu.ttf deleted file mode 100755 index 45a038b..0000000 Binary files a/polices/ubuntu.ttf and /dev/null differ diff --git a/signup.php b/signup.php deleted file mode 100755 index 57cab90..0000000 --- a/signup.php +++ /dev/null @@ -1,143 +0,0 @@ - - - - -
    - -

    Créer un compte Ant

    - -

    Pseudo :

    - - - -
    - -

    Mot de passe :

    - - - -

    - - - - - -

    - -

    - -
    - - -
    -
    -
    - Déjà un compte ? -
    -
    - Se connecter - - - -
    - - PDO::ERRMODE_EXCEPTION)); - } - - - catch (Exception $e) { - die('Erreur PHP / MySQL : ' . $e->getMessage()); - } - - - $reponse = $bdd->query('SELECT * FROM compte'); - - $pseudoExisteDeja = false; - - while ($donnees = $reponse->fetch()) { - - if ($_POST['pseudo'] == $donnees['pseudo']) { - $pseudoExisteDeja = true; - - } - - - - - } $reponse->closeCursor(); - - - if ($pseudoExisteDeja == true) { - echo "Un compte porte déjà ce nom"; - - } else { - - - - $req = $bdd->prepare('INSERT INTO compte(pseudo, mdp, confirmerLien) VALUES(:pseudo, :mdp, :confirmerLien)'); - - $req->execute(array( - 'pseudo' => htmlspecialchars($_POST['pseudo']), - 'mdp' => $mdphash, - 'confirmerLien' => "oui" - )); - - $req->closeCursor(); ?> - - Compte créé avec succès ! Veuillez vous connecter sur la page suivante. - - - - - - Le compte n'a pas pu être créé : Le premier et le second champ de mot de passe ne correspondent pas ! - - - - - Vous devez accepter les Conditions générales d'utilisation pour vous créer un compte ! - - - - Erreur inconnue - - - - - - - - - - -
    - -
    - - - - - diff --git a/style/ant.less b/style/ant.less new file mode 100755 index 0000000..8d1c8b6 --- /dev/null +++ b/style/ant.less @@ -0,0 +1 @@ + diff --git a/style/vrac.less b/style/vrac.less new file mode 100755 index 0000000..8cf8e45 --- /dev/null +++ b/style/vrac.less @@ -0,0 +1,818 @@ +@import "bibli/fontello/css/fontello.css"; // Icones +@import "bibli/normalize.css"; // Réinitialisation + +@fond: #2D2F34; +@fond-footer: darken(@fond, 3%); +@fond-option-hover: lighten(@fond, 10%); +@texte-secondaire: #9DA3B0; +@texte-principal: white; +@couleur-lien: white; +@couleur-principale: red; +.texte-secondaire { + color: @texte-secondaire; +} + +input[type=text],[type=password] { + background-color: @fond-footer; + border: 2px @texte-principal solid; + border-radius: 10px; + height: 50px; + + &:hover { + background-color: @fond; + transition: all 0.2s; + border: 2px fadein(@couleur-principale, 70%) solid; + + } + + &:focus { + background-color: @fond; + border: 2px fadein(@couleur-principale, 30%) solid; + + + } + + +} + +// BOUTONS + +.button { + border: 2px solid grey; + padding: 10px; + margin: 5px; + display: inline-block; + border-radius: 10px; + color: white; + + &:hover { + background-color: red; + color: darkred; + } + +} + + + + +.conteneurLigne { + display: flex; + justify-content: space-around; + text-align: center; + +} + +.elementLigne { + width: (100% / 5); + display: inline-block; + display: flex; + justify-content: space-around; + text-align: center; + +} + + + + +html { + font-size: 20px; +} + +@media all and (max-width: 700px) { + + html { + font-size: 13px; + } + +} + + +#editeur { + width: 500px; + height: 200px; + border: 1px solid white; + padding: 5px; + overflow: auto; +} + + + +a { + text-decoration: underline; + color: @couleur-lien; + + &:hover { + text-decoration: none; + color: @couleur-principale; + transition: all 0.5s ease-out; + } + +} + +a:visited { + text-decoration: underline; + color: @couleur-lien; + transition: all 0.5s ease-out; + + + &:hover { + text-decoration: none; + color: @couleur-principale; + transition: all 0.5s ease-out; + } + + +} + + + +nav a:link { + text-decoration: none; + +} + +.button:link { + text-decoration: none; + color: @couleur-lien; +} + + + +.pub-carree-bloc { + display: flex; + text-align: center; + justify-content: center; + +} + +.pub-carree { + + display: flex; + border: white 3px solid; + text-align: center; + justify-content: center; + max-width: 300px; + line-height : 0pt; + border-radius: 10px; + + margin: 20px; + padding: 2px; + + + +} + +.pub-horizontale-bloc { + + display: flex; + text-align: center; + justify-content: center; + +} + +.pub-horizontale { + + border: #808080 2px solid; + border-radius: 10px; + margin: 30px; + padding: 2px; + width: 729px; + min-height: 90px; + + + /* Affiche "Vous avez bloqué cette publicité" quand on a un bloqueur de pub ou quand on clic sur la croix */ + background-image: url("img/non-pub-horizontale.png"); + +} + +#bouttonmenu { + + height: 50px; + width: 50px; + color: white; + + background-color: @fond; + + border: white 2px solid; + +} + +.descriptionCategorie { + font-size: 1.4em; +} + +.bouttonModifier { + margin-right: 20px; +} + +.vert { + color: limegreen; +} + +.rouge { + color: red; +} + +.optionhaute { + border-top: 0px white solid; + +} +.boite { + border: 3px white solid; + border-radius: 10px; + margin: 10px; + padding: 10px; + display: inline-block; + +} + +.logo { + margin-bottom: 10px; + +} + +.inline { + display: inline; + +} + +.titreArticle { + font-size: 2em; + +} + +.articlePseudo { + border: 2px white solid; + border-radius: 10px; + margin: 30px 20px 30px 0px; + padding: 20px; + +} + + +.formArticle { + width: 100%; + +} + +.formCommentaire { + width: 30%; + +} + +.petitChamp { + width: 400px; + font-size: 1em; + +} + +.champMoyen { + width: 800px; + +} + +.champLarge { + width: 100%; + +} + +.number { + margin: 10px; + display: inline-flex; + width: 180px; + +} + +.img404 { + + text-align: center; + padding-top: 10px; + padding-bottom: 30px; + +} + +.img { + display: block; + margin: 20px; + border: 3px white solid; + border-radius: 5px; + max-width: 45em; + overflow: hidden; + +} + +.module { + border-left: 4px white solid; + padding-left: 20px; + padding-top: 10px; + padding-bottom: 10px; + margin-top: 10px; + margin-bottom: 10px; + +} + +strong { + font-weight: 400; + +} + +body, code { + font-family: ubuntu, "ubuntu-dl"; + padding: 0px; + margin: 0px; + background-color: @fond; + color: @texte-principal; + font-size: 25px; + line-height: 35px; + +} + +h1, h2, h3, h4, h5, h6 { + font-family: "ubuntu-fin-dl"; +} + + +.milieu { + display: flex; + justify-content: space-between; + +} + +.main { + display: flex; + margin: 0px; + +} + + + +.texte { + margin-top: 20px; + margin-left: 30px; + margin-bottom: 50px; + + margin-right: 50px; + +} + +.hautoto { + display: flex; + justify-content: space-between; + +} + +.centre { + text-align: center; + justify-content: center; + +} + +.droite { + text-align: right; + +} + +.pres { + padding-bottom: 20px; + +} + +.pgauche { + text-align: left; + padding-left: 20px; + border-left: 5px white solid; + + +} + +.pdroite { + text-align: right; + padding-right: 20px; + margin-right: -30px; + border-right: 5px white solid; + +} + +.mdpincorrect { + color: red; + font-weight: bold; + +} + +.avertissement { + border: 2px yellow solid; + border-radius: 12px; + padding: 10px; + margin: 5px; + background-color: lemonchiffon; + +} + +.descriptionNavigateur { + margin: 12px; + padding: 12px; + overflow: auto; + border: 1px white solid; + +} + +.monAvis { + margin: 12px; + padding: 12px; + overflow: auto; + border-left: 3px white solid; + +} + +.gras-css { +font-weight: bold; + +} + +.souligne { + text-decoration: underline; + +} + +.nomNavigateur { + font-size: 3em; + +} + +// FOOTER + +.textefooter { + margin: 10px; + line-height: 1.5em; + width: 60%; + +} + +.logofooter { + padding-left: 6%; + margin-top: 20px; + +} + +.interlude { + display: flex; + justify-content: center; + + +} + +.traitinterlude { + border-top: 2px gray dashed; + width: 800px; + +} + +.basfooter { + display: flex; + justify-content: space-around; + margin-top: 30px; + margin-bottom: 20px; + +} + +footer { + text-align: center; + background-color: @fond-footer; + display: flex; + flex-direction: column; + +} + +.logogris { + background-color: @fond-footer; + background-image: url(img/antpetitgris.png); + width: 264px; + height: 80px; + display: inline-block; + +} + +.logogris:hover { + background-image: url(img/antpetit.png); +} + + +.liensfooter { + display: flex; + flex-direction: row; + padding: 20px; + +} + +.lienfooter { + margin: 10px; + +} + +@media (max-width: 500px) { + .textefooter { + padding-left: 10%; + padding-right: 10%; + + } +} + +/* ----------------------- MENU ------------------------ */ + +.menugauche { + margin: 0px; + overflow: auto; + margin-top: 20px; + width: 16em; + border-bottom: 3px white solid; + border-right: 3px white solid; + border-top: 3px white solid; + border-radius: 0px 12px 12px 0px; + text-align: center; + + +} + +.option { + padding: 30px; + display: block; + border-top: 2px white solid; + // transition: all 0.2s ease-in; + +} + +.option:active { + box-shadow: 2px 2px 3px white inset; + +} + +.option:hover { + background-color: @fond-option-hover; + transition: all 0.2s ease-in-out; + color: @couleur-lien !important; + +} + +.optionhaute { + border-top: 0px white solid; + +} + +.premieroptiondossier { + border-radius: 12px 0px 0px 0px; + +} + +.optiondossier { + margin-left: 20px; + border-left: 2px white solid; + +} + +.petiteoption { + padding: 24px; + +} + +.nomdossier { + display: block; + padding-top: 10px; + padding-bottom: 10px; + border-top: 2px white solid; + +} + + +/* ----------------------- ESPACE COMMENTAIRE ------------------------ */ + + +.commentairePseudo { + padding: 10px; + +} + +.pseudo { + font-weight: bold; + +} + +.commentaire { + margin: 10px; + padding: 10px; + border-left: 4px white solid; + +} + + + +// HEADERS + +h1, h2, h3, h4, h5, h6 { + font-style: ubuntu, ubuntu-dl; + +} + +h1 { + font-size: 250%; + text-align: center; + +} + +h2 { +font-size: 200%; + +} + +h3 { +font-size: 160%; + +} + +h4 { +font-size: 140%; + +} + +h5 { +font-size: 125%; + +} + +h6 { +font-size: 110%; + +} + + + + + +/* Définition de la police Ubuntu */ + +@font-face { + font-family: "ubuntu-dl"; + src: url("bibli/ubuntu/Ubuntu-R.ttf"); +} + +@font-face { + font-family: "ubuntu-fin-dl"; + src: url("bibli/ubuntu/Ubuntu-L.ttf"); +} + +/* ----------------------- TAILLES DE TEXTE ------------------------ */ + + +.t03 { + font-size: 0.3em; +} + +.t04 { + font-size: 0.4em; +} + +.t05 { + font-size: 0.5em; +} + +.t06 { + font-size: 0.6em; +} + +.t07 { + font-size: 0.7em; +} + +.t08 { + font-size: 0.8em; +} + +.t09 { + font-size: 0.9em; +} + +.t10 { + font-size: 1.0em; +} + +.t11 { + font-size: 1.1em; +} + +.t12 { + font-size: 1.2em; +} + +.t13 { + font-size: 1.3em; +} + +.t14 { + font-size: 1.4em; +} + +.t15 { + font-size: 1.5em; +} + +.t16 { + font-size: 1.6em; +} + +.t17 { + font-size: 1.7em; +} + +.t18 { + font-size: 1.8em; +} + +.t19 { + font-size: 1.9em; +} + +.t20 { + font-size: 2.0em; +} + +.t21 { + font-size: 2.1em; +} + +.t22 { + font-size: 2.2em; +} + +.t23 { + font-size: 2.3em; +} + +.t24 { + font-size: 2.4em; +} + +.t25 { + font-size: 2.5em; +} + +.t26 { + font-size: 2.6em; +} + +.t27 { + font-size: 2.7em; +} + +.t28 { + font-size: 2.8em; +} + +.t29 { + font-size: 2.9em; +} + +.t30 { + font-size: 3.0em; +} + +.in92pack { + color: @fond !important; + text-decoration: none !important; +} + +.li192pack { + color: @fond !important; + text-decoration: none !important; + +} + +.li192pack:hover { + color: #de00ff; + text-decoration: none; + transition: color 10s ease-in-out; + +} + + +.gomeza { + display: none; // Sera changé le moment voulu en JS + position: fixed; + bottom: 0px; + right: 30px; + z-index: 100; + + + +} + + +.pgauche > h1 { + + text-align: left; + +} + +.pdroite > h1 { + + text-align: right; + +}